Commit 955b2e29 authored by Kristian Feldsam's avatar Kristian Feldsam
Browse files

Added new methods from updated api docs


Signed-off-by: Kristian Feldsam's avatarKristian Feldsam <feldsam@gmail.com>
parent a443bff6
......@@ -6,7 +6,7 @@
This library provides you with XML-RPC client, which parses XML responses to an array.
You can traverse over it by using dot notation.
We generated all public methods from [api.rst](https://raw.githubusercontent.com/OpenNebula/docs/master/source/development_guide/system_interfaces/api.rst) file.
We generated all public methods from [api.rst](https://raw.githubusercontent.com/OpenNebula/docs/master/source/integration_and_development/system_interfaces/api.rst) file.
Check example method with doc block. For more, check [src/One.php](https://github.com/FELDSAM-INC/one-php/blob/master/src/One.php)
......
......@@ -190,6 +190,12 @@ onevm
+----------------------+---------------------------+-------------------+
| unlock | one.vm.unlock | VM:MANAGE |
+----------------------+---------------------------+-------------------+
| create-chart | one.vm.schedadd | VM:MANAGE |
+----------------------+---------------------------+-------------------+
| update-chart | one.vm.schedupdate | VM:MANAGE |
+----------------------+---------------------------+-------------------+
| delete-chart | one.vm.scheddelete | VM:MANAGE |
+----------------------+---------------------------+-------------------+
 
 
 
......@@ -630,6 +636,10 @@ onemarket
+--------------------+---------------------+------------------------------+
| rename | one.market.rename | MARKETPLACE:MANAGE |
+--------------------+---------------------+------------------------------+
| enable | one.market.enable | MARKETPLACE:MANAGE |
| | | |
| disable | | |
+--------------------+---------------------+------------------------------+
| list | one.marketpool.info | MARKETPLACE:USE |
+--------------------+---------------------+------------------------------+
 
......@@ -740,6 +750,10 @@ onezone
+-----------------+-------------------+---------------+
| delete | one.zone.delete | ZONE:ADMIN |
+-----------------+-------------------+---------------+
| enable | one.zone.enable | ZONE:ADMIN |
| | | |
| disable | | |
+-----------------+-------------------+---------------+
| show | one.zone.info | ZONE:USE |
+-----------------+-------------------+---------------+
| list | one.zonepool.info | ZONE:USE |
......@@ -1918,13 +1932,13 @@ one.vm.updateconf
| OUT | Int | ID of the Virtual Machine that caused the error. |
+------+------------+--------------------------------------------------------------------------------------------------+
 
The supported attributes are:
 
+--------------+-------------------------------------------------------------------------+
| Attribute | Sub-attributes |
+==============+=========================================================================+
| ``OS`` | ``ARCH``, ``MACHINE``, ``KERNEL``, ``INITRD``, ``BOOTLOADER``, ``BOOT`` |
| ``OS`` | ``ARCH``, ``MACHINE``, ``KERNEL``, ``INITRD``, ``BOOTLOADER``, ``BOOT``,|
| | ``SD_DISK_BUS``, ``UUID`` |
+--------------+-------------------------------------------------------------------------+
| ``FEATURES`` | ``ACPI``, ``PAE``, ``APIC``, ``LOCALTIME``, ``HYPERV``, ``GUEST_AGENT`` |
+--------------+-------------------------------------------------------------------------+
......@@ -2083,6 +2097,80 @@ one.vm.unlock
| OUT | Int | ID of the object that caused the error. |
+------+-----------+--------------------------------------------------------------------------------------------------------+
 
one.vm.schedadd
--------------------------------------------------------------------------------
- **Description**: Add scheduled action to VM
- **Parameters**
+------+------------+----------------------------------------------------------------------+
| Type | Data Type | Description |
+======+============+======================================================================+
| IN | String | The session string. |
+------+------------+----------------------------------------------------------------------+
| IN | Int | The object ID. |
+------+------------+----------------------------------------------------------------------+
| IN | String | Template containing the new scheduled action. |
+------+------------+----------------------------------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+------------+----------------------------------------------------------------------+
| OUT | Int/String | The VM ID / The error string. |
+------+------------+----------------------------------------------------------------------+
| OUT | Int | Error code. |
+------+------------+----------------------------------------------------------------------+
| OUT | Int | ID of the Virtual Machine object that caused the error |
+------+------------+----------------------------------------------------------------------+
one.vm.schedupdate
--------------------------------------------------------------------------------
- **Description**: Update scheduled VM action
- **Parameters**
+------+------------+----------------------------------------------------------------------+
| Type | Data Type | Description |
+======+============+======================================================================+
| IN | String | The session string. |
+------+------------+----------------------------------------------------------------------+
| IN | Int | The object ID. |
+------+------------+----------------------------------------------------------------------+
| IN | Int | The ID of the scheduled action. |
+------+------------+----------------------------------------------------------------------+
| IN | String | Template containing the updated scheduled action. |
+------+------------+----------------------------------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+------------+----------------------------------------------------------------------+
| OUT | Int/String | The VM ID / The error string. |
+------+------------+----------------------------------------------------------------------+
| OUT | Int | Error code. |
+------+------------+----------------------------------------------------------------------+
| OUT | Int | ID of the Virtual Machine object that caused the error |
+------+------------+----------------------------------------------------------------------+
one.vm.scheddelete
--------------------------------------------------------------------------------
- **Description**: Delete scheduled action from VM
- **Parameters**
+------+------------+----------------------------------------------------------------------+
| Type | Data Type | Description |
+======+============+======================================================================+
| IN | String | The session string. |
+------+------------+----------------------------------------------------------------------+
| IN | Int | The object ID. |
+------+------------+----------------------------------------------------------------------+
| IN | Int | The ID of the scheduled action. |
+------+------------+----------------------------------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+------------+----------------------------------------------------------------------+
| OUT | Int/String | The VM ID / The error string. |
+------+------------+----------------------------------------------------------------------+
| OUT | Int | Error code. |
+------+------------+----------------------------------------------------------------------+
| OUT | Int | ID of the Virtual Machine object that caused the error |
+------+------------+----------------------------------------------------------------------+
one.vmpool.info
--------------------------------------------------------------------------------
 
......@@ -2197,33 +2285,6 @@ one.vmpool.infoextended
| OUT | Int | ID of the object that caused the error. |
+------+-----------+-----------------------------------------------------------------------+
 
one.vmpool.infoset
--------------------------------------------------------------------------------
- **Description**: Retrieves information for a specific set of VMs.
- **Parameters**
+------+-----------+-----------------------------------------------------------------------+
| Type | Data Type | Description |
+======+===========+=======================================================================+
| IN | String | The session string. |
+------+-----------+-----------------------------------------------------------------------+
| IN | String | VMs set. A comma separated list of VMs IDs to be retrieved |
+------+-----------+-----------------------------------------------------------------------+
| IN | Bool | Extended. If true the entire VM will be retrived (similar to |
| | | one.vmpool.infoextended) |
+------+-----------+-----------------------------------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+-----------+-----------------------------------------------------------------------+
| OUT | String | Version of the VM Pool containing the set of VMs. |
+------+-----------+-----------------------------------------------------------------------+
| OUT | Int | Error code. |
+------+-----------+-----------------------------------------------------------------------+
| OUT | Int | ID of the object that caused the error. |
+------+-----------+-----------------------------------------------------------------------+
The range can be used to retrieve a subset of the pool, from the 'start' to the 'end' ID. To retrieve the complete pool, use ``(-1, -1)``; to retrieve all the pool from a specific ID to the last one, use ``(<id>, -1)``, and to retrieve the first elements up to an ID, use ``(0, <id>)``.
The state filter can be one of the following:
 
+-------+---------------------------+
......@@ -2260,6 +2321,33 @@ The state filter can be one of the following:
 
Value 7 is reserved for FAILED VMs for compatibility reasons.
 
one.vmpool.infoset
--------------------------------------------------------------------------------
- **Description**: Retrieves information for a specific set of VMs.
- **Parameters**
+------+-----------+-----------------------------------------------------------------------+
| Type | Data Type | Description |
+======+===========+=======================================================================+
| IN | String | The session string. |
+------+-----------+-----------------------------------------------------------------------+
| IN | String | VMs set. A comma separated list of VMs IDs to be retrieved |
+------+-----------+-----------------------------------------------------------------------+
| IN | Bool | Extended. If true the entire VM will be retrived (similar to |
| | | one.vmpool.infoextended) |
+------+-----------+-----------------------------------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+-----------+-----------------------------------------------------------------------+
| OUT | String | Version of the VM Pool containing the set of VMs. |
+------+-----------+-----------------------------------------------------------------------+
| OUT | Int | Error code. |
+------+-----------+-----------------------------------------------------------------------+
| OUT | Int | ID of the object that caused the error. |
+------+-----------+-----------------------------------------------------------------------+
The range can be used to retrieve a subset of the pool, from the 'start' to the 'end' ID. To retrieve the complete pool, use ``(-1, -1)``; to retrieve all the pool from a specific ID to the last one, use ``(<id>, -1)``, and to retrieve the first elements up to an ID, use ``(0, <id>)``.
one.vmpool.monitoring
--------------------------------------------------------------------------------
 
......@@ -2631,6 +2719,8 @@ For example:
</HOST>
</MONITORING_DATA>
 
.. _api_hostpool_info:
one.hostpool.info
--------------------------------------------------------------------------------
 
......@@ -4883,6 +4973,31 @@ one.market.rename
| OUT | Int | ID of the object that caused the error. |
+------+------------+---------------------------------------------+
 
one.market.enable
-----------------
- **Description**: Enable/disable the Marketplace.
- **Parameters**
+------+------------+---------------------------------------------+
| Type | Data Type | Description |
+======+============+=============================================+
| IN | String | The session string. |
+------+------------+---------------------------------------------+
| IN | Int | The Marketplace ID. |
+------+------------+---------------------------------------------+
| IN | Boolean | True for enabling, false for disabling. |
+------+------------+---------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+------------+---------------------------------------------+
| OUT | Int/String | The resource ID / The error string. |
+------+------------+---------------------------------------------+
| OUT | Int | Error code. |
+------+------------+---------------------------------------------+
| OUT | Int | ID of the object that caused the error. |
+------+------------+---------------------------------------------+
one.market.info
--------------------------------------------------------------------------------
 
......@@ -5232,7 +5347,6 @@ one.marketapppool.info
 
The range can be used to retrieve a subset of the pool, from the 'start' to the 'end' ID. To retrieve the complete pool, use ``(-1, -1)``; to retrieve all the pool from a specific ID to the last one, use ``(<id>, -1)``, and to retrieve the first elements up to an ID, use ``(0, <id>)``.
 
Actions for Virtual Routers Management
================================================================================
 
......@@ -6592,6 +6706,30 @@ one.zone.delete
| OUT | Int | ID of the object that caused the error. |
+------+------------+---------------------------------------------+
 
one.zone.enable
----------------
- **Description**: Enable/disable the given zone.
- **Parameters**
+------+------------+---------------------------------------------+
| Type | Data Type | Description |
+======+============+=============================================+
| IN | String | The session string. |
+------+------------+---------------------------------------------+
| IN | Int | The Zone ID. |
+------+------------+---------------------------------------------+
| IN | Boolean | True for enabling, false for disabling. |
+------+------------+---------------------------------------------+
| OUT | Boolean | true or false whenever is successful or not |
+------+------------+---------------------------------------------+
| OUT | Int/String | The resource ID / The error string. |
+------+------------+---------------------------------------------+
| OUT | Int | Error code. |
+------+------------+---------------------------------------------+
| OUT | Int | ID of the object that caused the error. |
+------+------------+---------------------------------------------+
one.zone.update
----------------
 
......@@ -7708,4 +7846,4 @@ one.hooklog.info
XSD Reference
=============
 
The XML schema files that describe the XML documents returned by the one.*.info methods `can be found here <https://github.com/OpenNebula/one/tree/master/share/doc/xsd>`__.
\ No newline at end of file
The XML schema files that describe the XML documents returned by the one.*.info methods `can be found here <https://github.com/OpenNebula/one/tree/master/share/doc/xsd>`__.
......@@ -15,7 +15,7 @@ $parser = new Parser();
$parser->getEnvironment()->getErrorManager()->abortOnError(false);
// parse docs and get nodes we are interested in
$nodes = $parser->parseFile('https://raw.githubusercontent.com/OpenNebula/docs/master/source/development_guide/system_interfaces/api.rst')->getNodes(function(Node $node){
$nodes = $parser->parseFile('https://raw.githubusercontent.com/OpenNebula/docs/master/source/integration_and_development/system_interfaces/api.rst')->getNodes(function(Node $node){
if ($node instanceof TitleNode) {
$method = (string)$node->getValue();
if (preg_match('/^one\.(.+)\.(.+)$/', $method, $m)) {
......
......@@ -482,6 +482,40 @@ class One extends OneBase {
return $this->makeCall('one.vm.unlock', $a);
}
/**
* Add scheduled action to VM
*
* @param int $a The object ID.
* @param string $b Template containing the new scheduled action.
* @return \One\Resource
*/
public function vmSchedadd(int $a, string $b) {
return $this->makeCall('one.vm.schedadd', $a, $b);
}
/**
* Update scheduled VM action
*
* @param int $a The object ID.
* @param int $b The ID of the scheduled action.
* @param string $c Template containing the updated scheduled action.
* @return \One\Resource
*/
public function vmSchedupdate(int $a, int $b, string $c) {
return $this->makeCall('one.vm.schedupdate', $a, $b, $c);
}
/**
* Delete scheduled action from VM
*
* @param int $a The object ID.
* @param int $b The ID of the scheduled action.
* @return \One\Resource
*/
public function vmScheddelete(int $a, int $b) {
return $this->makeCall('one.vm.scheddelete', $a, $b);
}
/**
* Retrieves information for all or part of the VMs in the pool.
*
......@@ -1603,6 +1637,17 @@ class One extends OneBase {
return $this->makeCall('one.market.rename', $a, $b);
}
/**
* Enable/disable the Marketplace.
*
* @param int $a The Marketplace ID.
* @param bool $b True for enabling, false for disabling.
* @return \One\Resource
*/
public function marketEnable(int $a, bool $b) {
return $this->makeCall('one.market.enable', $a, $b);
}
/**
* Retrieves information for the marketplace.
*
......@@ -2377,6 +2422,17 @@ class One extends OneBase {
return $this->makeCall('one.zone.delete', $a);
}
/**
* Enable/disable the given zone.
*
* @param int $a The Zone ID.
* @param bool $b True for enabling, false for disabling.
* @return \One\Resource
*/
public function zoneEnable(int $a, bool $b) {
return $this->makeCall('one.zone.enable', $a, $b);
}
/**
* Replaces the zone template contents.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment