.. _api: ================================================================================ XML-RPC API ================================================================================ This reference documentation describes the xml-rpc methods exposed by OpenNebula. Each description consists of the method name and the input and output values. All xml-rpc responses share a common structure. +--------+-------------+-------------------------------------------------+ | Type | Data Type | Description | +========+=============+=================================================+ | OUT | Boolean | True or false whenever is successful or not. | +--------+-------------+-------------------------------------------------+ | OUT | String | If an error occurs this is the error message. | +--------+-------------+-------------------------------------------------+ | OUT | Int | Error code. | +--------+-------------+-------------------------------------------------+ The output will always consist of three values. The first and third ones are fixed, but the second one will contain the String error message only in case of failure. If the method is successful, the returned value may be of another Data Type. The Error Code will contain one of the following values: +--------+----------------+-----------------------------------------------------------------------+ | Value | Code | Meaning | +========+================+=======================================================================+ | 0x0000 | SUCCESS | Success response. | +--------+----------------+-----------------------------------------------------------------------+ | 0x0100 | AUTHENTICATION | User could not be authenticated. | +--------+----------------+-----------------------------------------------------------------------+ | 0x0200 | AUTHORIZATION | User is not authorized to perform the requested action. | +--------+----------------+-----------------------------------------------------------------------+ | 0x0400 | NO\_EXISTS | The requested resource does not exist. | +--------+----------------+-----------------------------------------------------------------------+ | 0x0800 | ACTION | Wrong state to perform action. | +--------+----------------+-----------------------------------------------------------------------+ | 0x1000 | XML\_RPC\_API | Wrong parameters, e.g. param should be -1 or -2, but -3 was received. | +--------+----------------+-----------------------------------------------------------------------+ | 0x2000 | INTERNAL | Internal error, e.g. the resource could not be loaded from the DB. | +--------+----------------+-----------------------------------------------------------------------+ | 0x4000 | ALLOCATE | The resource cannot be allocated. | +--------+----------------+-----------------------------------------------------------------------+ | 0x8000 | LOCKED | The resource is locked. | +--------+----------------+-----------------------------------------------------------------------+ .. note:: All methods expect a session string associated to the connected user as the first parameter. It has to be formed with the contents of the ONE\_AUTH file, which will be ``:`` with the default 'core' auth driver. .. note:: Each XML-RPC request has to be authenticated and authorized. See the :ref:`Auth Subsystem documentation ` for more information. The information strings returned by the ``one.*.info`` methods are XML-formatted. The complete XML Schemas (XSD) reference is included at the end of this page. We encourage you to use the ``-x`` option of the :ref:`command line interface ` to collect sample outputs from your own infrastructure. The methods that accept XML templates require the root element to be TEMPLATE. For instance, this template: .. code-block:: none NAME = abc MEMORY = 1024 ATT1 = value1 Can be also given to OpenNebula with the following XML: .. code-block:: xml Authorization Requests Reference ================================================================================ OpenNebula features a CLI that wraps the XML-RPC requests. For each XML-RPC request, the session token is authenticated, and after that the Request Manager generates an authorization request that can include more than one operation. The following tables document these requests from the different CLI commands. .. note:: Commands with marked with * are asynchronous. The success response for these commands means that all preconditions passed and the action started. To check the action result you need to inspect the resource or its state. .. _onevm_api: onevm -------------------------------------------------------------------------------- +----------------------+---------------------------+-------------------+ | onevm command | XML-RPC Method | Auth. Request | +======================+===========================+===================+ | deploy* | one.vm.deploy | VM:ADMIN | | | | | | | | HOST:MANAGE | +----------------------+---------------------------+-------------------+ | undeploy* | one.vm.action | VM:MANAGE | | | | | | terminate* | | | | | | | | suspend* | | | | | | | | hold | | | | | | | | stop* | | | | | | | | resume | | | | | | | | release | | | | | | | | poweroff* | | | | | | | | reboot* | | | +----------------------+---------------------------+-------------------+ | resched | one.vm.action | VM:ADMIN | | | | | | unresched | | | +----------------------+---------------------------+-------------------+ | migrate* | one.vm.migrate | VM:ADMIN | | | | | | | | HOST:MANAGE | +----------------------+---------------------------+-------------------+ | disk-saveas* | one.vm.disksaveas | VM:MANAGE | | | | | | | | IMAGE:CREATE | +----------------------+---------------------------+-------------------+ | disk-snapshot-create*| one.vm.disksnapshotcreate | VM:MANAGE | | | | | | | | IMAGE:MANAGE | +----------------------+---------------------------+-------------------+ | disk-snapshot-delete*| one.vm.disksnapshotdelete | VM:MANAGE | | | | | | | | IMAGE:MANAGE | +----------------------+---------------------------+-------------------+ | disk-snapshot-revert*| one.vm.disksnapshotrevert | VM:MANAGE | +----------------------+---------------------------+-------------------+ | disk-snapshot-rename | one.vm.disksnapshotrename | VM:MANAGE | +----------------------+---------------------------+-------------------+ | disk-attach* | one.vm.attach | VM:MANAGE | | | | | | | | IMAGE:USE | +----------------------+---------------------------+-------------------+ | disk-detach* | one.vm.detach | VM:MANAGE | +----------------------+---------------------------+-------------------+ | disk-resize* | one.vm.diskresize | VM:MANAGE | +----------------------+---------------------------+-------------------+ | nic-attach* | one.vm.attachnic | VM:MANAGE | | | | | | | | NET:USE | +----------------------+---------------------------+-------------------+ | nic-detach* | one.vm.detachnic | VM:MANAGE | +----------------------+---------------------------+-------------------+ | nic-update* | one.vm.updatenic | VM:MANAGE | +----------------------+---------------------------+-------------------+ | sg-attach* | one.vm.attachsg | VM:MANAGE | +----------------------+---------------------------+-------------------+ | sg-detach* | one.vm.detachsg | VM:MANAGE | +----------------------+---------------------------+-------------------+ | create | one.vm.allocate | VM:CREATE | | | | | | | | IMAGE:USE | | | | | | | | NET:USE | +----------------------+---------------------------+-------------------+ | show | one.vm.info | VM:USE | +----------------------+---------------------------+-------------------+ | chown | one.vm.chown | VM:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +----------------------+---------------------------+-------------------+ | chmod | one.vm.chmod | VM: | +----------------------+---------------------------+-------------------+ | rename | one.vm.rename | VM:MANAGE | +----------------------+---------------------------+-------------------+ | snapshot-create* | one.vm.snapshotcreate | VM:MANAGE | +----------------------+---------------------------+-------------------+ | snapshot-delete* | one.vm.snapshotdelete | VM:MANAGE | +----------------------+---------------------------+-------------------+ | snapshot-revert* | one.vm.snapshotrevert | VM:MANAGE | +----------------------+---------------------------+-------------------+ | resize* | one.vm.resize | VM:MANAGE | +----------------------+---------------------------+-------------------+ | update | one.vm.update | VM:MANAGE | +----------------------+---------------------------+-------------------+ | recover* | one.vm.recover | VM:ADMIN | +----------------------+---------------------------+-------------------+ | save* | -- (ruby method) | VM:MANAGE | | | | | | | | IMAGE:CREATE | | | | | | | | TEMPLATE:CREATE | +----------------------+---------------------------+-------------------+ | updateconf | one.vm.updateconf | VM:MANAGE | +----------------------+---------------------------+-------------------+ | list | one.vmpool.info | VM:USE | | top | | | +----------------------+---------------------------+-------------------+ | list | one.vmpool.infoextended | VM:USE | +----------------------+---------------------------+-------------------+ | -- | one.vm.monitoring | VM:USE | +----------------------+---------------------------+-------------------+ | lock | one.vm.lock | VM:MANAGE | +----------------------+---------------------------+-------------------+ | unlock | one.vm.unlock | VM:MANAGE | +----------------------+---------------------------+-------------------+ | create-chart | one.vm.schedadd | VM:MANAGE | | | | | | \-\-schedule | | | +----------------------+---------------------------+-------------------+ | sched-update | one.vm.schedupdate | VM:MANAGE | +----------------------+---------------------------+-------------------+ | sched-delete | one.vm.scheddelete | VM:MANAGE | +----------------------+---------------------------+-------------------+ | backup \ :sup:`*` | one.vm.backup | VM:ADMIN | +----------------------+---------------------------+-------------------+ | backup-cancel* | one.vm.backupcancel | VM:ADMIN | +----------------------+---------------------------+-------------------+ | pci-attach | one.vm.attachpci | VM:MANAGE | +----------------------+---------------------------+-------------------+ | pci-detach | one.vm.detachpci | VM:MANAGE | +----------------------+---------------------------+-------------------+ .. note:: The **deploy** action requires the user issuing the command to have VM:ADMIN rights. This user will usually be the scheduler with the oneadmin credentials. The scheduler deploys VMs to the Hosts over which the VM owner has MANAGE rights. The **backup** action can be done by regular users through the schedule action interface (``--schedule``). onetemplate -------------------------------------------------------------------------------- +---------------------+--------------------------+-------------------------+ | onetemplate command | XML-RPC Method | Auth. Request | +=====================+==========================+=========================+ | update | one.template.update | TEMPLATE:MANAGE | +---------------------+--------------------------+-------------------------+ | instantiate | one.template.instantiate | TEMPLATE:USE | | | | | | | | [IMAGE:USE] | | | | | | | | [NET:USE] | +---------------------+--------------------------+-------------------------+ | create | one.template.allocate | TEMPLATE:CREATE | +---------------------+--------------------------+-------------------------+ | clone | one.template.clone | TEMPLATE:CREATE | | | | | | | | TEMPLATE:USE | +---------------------+--------------------------+-------------------------+ | delete | one.template.delete | TEMPLATE:MANAGE | +---------------------+--------------------------+-------------------------+ | show | one.template.info | TEMPLATE:USE | +---------------------+--------------------------+-------------------------+ | chown | one.template.chown | TEMPLATE:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +---------------------+--------------------------+-------------------------+ | chmod | one.template.chmod | TEMPLATE: | +---------------------+--------------------------+-------------------------+ | rename | one.template.rename | TEMPLATE:MANAGE | +---------------------+--------------------------+-------------------------+ | list | one.templatepool.info | TEMPLATE:USE | | | | | | top | | | +---------------------+--------------------------+-------------------------+ | lock | one.template.lock | TEMPLATE:MANAGE | +---------------------+--------------------------+-------------------------+ | unlock | one.template.unlock | TEMPLATE:MANAGE | +---------------------+--------------------------+-------------------------+ onehost -------------------------------------------------------------------------------- +-----------------+-------------------+-----------------+ | onehost command | XML-RPC Method | Auth. Request | +=================+===================+=================+ | enable | one.host.status | HOST:ADMIN | | | | | | disable | | | | | | | | offline | | | +-----------------+-------------------+-----------------+ | update | one.host.update | HOST:ADMIN | +-----------------+-------------------+-----------------+ | create | one.host.allocate | HOST:CREATE | | | | | | | | [CLUSTER:ADMIN] | +-----------------+-------------------+-----------------+ | delete | one.host.delete | HOST:ADMIN | +-----------------+-------------------+-----------------+ | rename | one.host.rename | HOST:ADMIN | +-----------------+-------------------+-----------------+ | show | one.host.info | HOST:USE | +-----------------+-------------------+-----------------+ | list | one.hostpool.info | HOST:USE | | top | | | +-----------------+-------------------+-----------------+ .. warning:: onehost sync is not performed by the core, it is done by the ruby command onehost. onecluster -------------------------------------------------------------------------------- +--------------------+--------------------------+-----------------+ | onecluster command | XML-RPC Method | Auth. Request | +====================+==========================+=================+ | create | one.cluster.allocate | CLUSTER:CREATE | +--------------------+--------------------------+-----------------+ | delete | one.cluster.delete | CLUSTER:ADMIN | +--------------------+--------------------------+-----------------+ | update | one.cluster.update | CLUSTER:MANAGE | +--------------------+--------------------------+-----------------+ | addhost | one.cluster.addhost | CLUSTER:ADMIN | | | | | | | | HOST:ADMIN | +--------------------+--------------------------+-----------------+ | delhost | one.cluster.delhost | CLUSTER:ADMIN | | | | | | | | HOST:ADMIN | +--------------------+--------------------------+-----------------+ | adddatastore | one.cluster.adddatastore | CLUSTER:ADMIN | | | | | | | | DATASTORE:ADMIN | +--------------------+--------------------------+-----------------+ | deldatastore | one.cluster.deldatastore | CLUSTER:ADMIN | | | | | | | | DATASTORE:ADMIN | +--------------------+--------------------------+-----------------+ | addvnet | one.cluster.addvnet | CLUSTER:ADMIN | | | | | | | | NET:ADMIN | +--------------------+--------------------------+-----------------+ | delvnet | one.cluster.delvnet | CLUSTER:ADMIN | | | | | | | | NET:ADMIN | +--------------------+--------------------------+-----------------+ | rename | one.cluster.rename | CLUSTER:MANAGE | +--------------------+--------------------------+-----------------+ | show | one.cluster.info | CLUSTER:USE | +--------------------+--------------------------+-----------------+ | list | one.clusterpool.info | CLUSTER:USE | +--------------------+--------------------------+-----------------+ onegroup -------------------------------------------------------------------------------- +------------------+-----------------------+-----------------------------------------+ | onegroup command | XML-RPC Method | Auth. Request | +==================+=======================+=========================================+ | create | one.group.allocate | GROUP:CREATE | +------------------+-----------------------+-----------------------------------------+ | delete | one.group.delete | GROUP:ADMIN | +------------------+-----------------------+-----------------------------------------+ | show | one.group.info | GROUP:USE | +------------------+-----------------------+-----------------------------------------+ | update | one.group.update | GROUP:MANAGE | +------------------+-----------------------+-----------------------------------------+ | addadmin | one.group.addadmin | GROUP:MANAGE | | | | | | | | USER:MANAGE | +------------------+-----------------------+-----------------------------------------+ | deladmin | one.group.deladmin | GROUP:MANAGE | | | | | | | | USER:MANAGE | +------------------+-----------------------+-----------------------------------------+ | quota | one.group.quota | GROUP:ADMIN | +------------------+-----------------------+-----------------------------------------+ | list | one.grouppool.info | GROUP:USE | +------------------+-----------------------+-----------------------------------------+ | -- | one.groupquota.info | -- | +------------------+-----------------------+-----------------------------------------+ | defaultquota | one.groupquota.update | Ony for users in the ``oneadmin`` group | +------------------+-----------------------+-----------------------------------------+ onevdc -------------------------------------------------------------------------------- +----------------+----------------------+-----------------+ | onevdc command | XML-RPC Method | Auth. Request | +================+======================+=================+ | create | one.vdc.allocate | VDC:CREATE | +----------------+----------------------+-----------------+ | rename | one.vdc.rename | VDC:MANAGE | +----------------+----------------------+-----------------+ | delete | one.vdc.delete | VDC:ADMIN | +----------------+----------------------+-----------------+ | update | one.vdc.update | VDC:MANAGE | +----------------+----------------------+-----------------+ | show | one.vdc.info | VDC:USE | +----------------+----------------------+-----------------+ | list | one.vdcpool.info | VDC:USE | +----------------+----------------------+-----------------+ | addgroup | one.vdc.addgroup | VDC:ADMIN | | | | | | | | GROUP:ADMIN | +----------------+----------------------+-----------------+ | delgroup | one.vdc.delgroup | VDC:ADMIN | | | | | | | | GROUP:ADMIN | +----------------+----------------------+-----------------+ | addcluster | one.vdc.addcluster | VDC:ADMIN | | | | | | | | CLUSTER:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | delcluster | one.vdc.delcluster | VDC:ADMIN | | | | | | | | CLUSTER:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | addhost | one.vdc.addhost | VDC:ADMIN | | | | | | | | HOST:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | delhost | one.vdc.delhost | VDC:ADMIN | | | | | | | | HOST:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | adddatastore | one.vdc.adddatastore | VDC:ADMIN | | | | | | | | DATASTORE:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | deldatastore | one.vdc.deldatastore | VDC:ADMIN | | | | | | | | DATASTORE:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | addvnet | one.vdc.addvnet | VDC:ADMIN | | | | | | | | NET:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ | delvnet | one.vdc.delvnet | VDC:ADMIN | | | | | | | | NET:ADMIN | | | | | | | | ZONE:ADMIN | +----------------+----------------------+-----------------+ onevnet -------------------------------------------------------------------------------- +-----------------+------------------+--------------------+ | onevnet command | XML-RPC Method | Auth. Request | +=================+==================+====================+ | addar | one.vn.add_ar | NET:ADMIN | +-----------------+------------------+--------------------+ | rmar | one.vn.rm_ar | NET:ADMIN | +-----------------+------------------+--------------------+ | free | one.vn.free_ar | NET:MANAGE | +-----------------+------------------+--------------------+ | reserve | one.vn.reserve | NET:USE | +-----------------+------------------+--------------------+ | updatear | one.vn.update_ar | NET:MANAGE | +-----------------+------------------+--------------------+ | hold | one.vn.hold | NET:MANAGE | +-----------------+------------------+--------------------+ | release | one.vn.release | NET:MANAGE | +-----------------+------------------+--------------------+ | update | one.vn.update | NET:MANAGE | +-----------------+------------------+--------------------+ | create | one.vn.allocate | NET:CREATE | | | | | | | | [CLUSTER:ADMIN] | +-----------------+------------------+--------------------+ | delete* | one.vn.delete | NET:MANAGE | +-----------------+------------------+--------------------+ | show | one.vn.info | NET:USE | +-----------------+------------------+--------------------+ | chown | one.vn.chown | NET:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +-----------------+------------------+--------------------+ | chmod | one.vn.chmod | NET: | +-----------------+------------------+--------------------+ | rename | one.vn.rename | NET:MANAGE | +-----------------+------------------+--------------------+ | list | one.vnpool.info | NET:USE | +-----------------+------------------+--------------------+ | lock | one.vn.lock | NET:MANAGE | +-----------------+------------------+--------------------+ | unlock | one.vn.unlock | NET:MANAGE | +-----------------+------------------+--------------------+ | recover | one.vn.recover | NET:MANAGE | +-----------------+------------------+--------------------+ oneuser -------------------------------------------------------------------------------- +-----------------+----------------------+-----------------------------------------+ | oneuser command | XML-RPC Method | Auth. Request | +=================+======================+=========================================+ | create | one.user.allocate | USER:CREATE | +-----------------+----------------------+-----------------------------------------+ | delete | one.user.delete | USER:ADMIN | +-----------------+----------------------+-----------------------------------------+ | show | one.user.info | USER:USE | +-----------------+----------------------+-----------------------------------------+ | passwd | one.user.passwd | USER:MANAGE | +-----------------+----------------------+-----------------------------------------+ | login | one.user.login | USER:MANAGE | +-----------------+----------------------+-----------------------------------------+ | update | one.user.update | USER:MANAGE | +-----------------+----------------------+-----------------------------------------+ | chauth | one.user.chauth | USER:ADMIN | +-----------------+----------------------+-----------------------------------------+ | quota | one.user.quota | USER:ADMIN | +-----------------+----------------------+-----------------------------------------+ | chgrp | one.user.chgrp | USER:MANAGE | | | | | | | | GROUP:MANAGE | +-----------------+----------------------+-----------------------------------------+ | addgroup | one.user.addgroup | USER:MANAGE | | | | | | | | GROUP:MANAGE | +-----------------+----------------------+-----------------------------------------+ | delgroup | one.user.delgroup | USER:MANAGE | | | | | | | | GROUP:MANAGE | +-----------------+----------------------+-----------------------------------------+ | enable | one.user.enable | USER:ADMIN | | | | | | disable | | | +-----------------+----------------------+-----------------------------------------+ | encode | -- | -- | +-----------------+----------------------+-----------------------------------------+ | list | one.userpool.info | USER:USE | +-----------------+----------------------+-----------------------------------------+ | -- | one.userquota.info | -- | +-----------------+----------------------+-----------------------------------------+ | defaultquota | one.userquota.update | Ony for users in the ``oneadmin`` group | +-----------------+----------------------+-----------------------------------------+ onedatastore -------------------------------------------------------------------------------- +----------------------+------------------------+----------------------------+ | onedatastore command | XML-RPC Method | Auth. Request | +======================+========================+============================+ | create | one.datastore.allocate | DATASTORE:CREATE | | | | | | | | [CLUSTER:ADMIN] | +----------------------+------------------------+----------------------------+ | delete | one.datastore.delete | DATASTORE:ADMIN | +----------------------+------------------------+----------------------------+ | show | one.datastore.info | DATASTORE:USE | +----------------------+------------------------+----------------------------+ | update | one.datastore.update | DATASTORE:MANAGE | +----------------------+------------------------+----------------------------+ | rename | one.datastore.rename | DATASTORE:MANAGE | +----------------------+------------------------+----------------------------+ | chown | one.datastore.chown | DATASTORE:MANAGE | | | | | | | | [USER:MANAGE] | | | | | | chgrp | | [GROUP:USE] | +----------------------+------------------------+----------------------------+ | chmod | one.datastore.chmod | DATASTORE: | +----------------------+------------------------+----------------------------+ | enable | one.datastore.enable | DATASTORE:MANAGE | | | | | | disable | | | +----------------------+------------------------+----------------------------+ | list | one.datastorepool.info | DATASTORE:USE | +----------------------+------------------------+----------------------------+ oneimage -------------------------------------------------------------------------------- +------------------+---------------------------+------------------------+ | oneimage command | XML-RPC Method | Auth. Request | +==================+===========================+========================+ | persistent | one.image.persistent | IMAGE:MANAGE | | | | | | nonpersistent | | | +------------------+---------------------------+------------------------+ | enable | one.image.enable | IMAGE:MANAGE | | | | | | disable | | | +------------------+---------------------------+------------------------+ | chtype | one.image.chtype | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | snapshot-delete* | one.image.snapshotdelete | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | snapshot-revert* | one.image.snapshotrevert | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | snapshot-flatten*| one.image.snapshotflatten | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | update | one.image.update | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | create | one.image.allocate | IMAGE:CREATE | | | | | | | | DATASTORE:USE | +------------------+---------------------------+------------------------+ | clone* | one.image.clone | IMAGE:CREATE | | | | | | | | IMAGE:USE | | | | | | | | DATASTORE:USE | +------------------+---------------------------+------------------------+ | delete* | one.image.delete | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | show | one.image.info | IMAGE:USE | +------------------+---------------------------+------------------------+ | chown | one.image.chown | IMAGE:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +------------------+---------------------------+------------------------+ | chmod | one.image.chmod | IMAGE: | +------------------+---------------------------+------------------------+ | rename | one.image.rename | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | list | one.imagepool.info | IMAGE:USE | | | | | | top | | | +------------------+---------------------------+------------------------+ | lock | one.image.lock | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | unlock | one.image.unlock | IMAGE:MANAGE | +------------------+---------------------------+------------------------+ | restore | one.image.restore | IMAGE:USE | +------------------+---------------------------+------------------------+ onemarket -------------------------------------------------------------------------------- +--------------------+---------------------+------------------------------+ | onemarket command | XML-RPC Method | Auth. Request | +====================+=====================+==============================+ | update | one.market.update | MARKETPLACE:MANAGE | +--------------------+---------------------+------------------------------+ | create | one.market.allocate | MARKETPLACE:CREATE | +--------------------+---------------------+------------------------------+ | delete | one.market.delete | MARKETPLACE:MANAGE | +--------------------+---------------------+------------------------------+ | show | one.market.info | MARKETPLACE:USE | +--------------------+---------------------+------------------------------+ | chown | one.market.chown | MARKETPLACE:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +--------------------+---------------------+------------------------------+ | chmod | one.market.chmod | MARKETPLACE: | +--------------------+---------------------+------------------------------+ | rename | one.market.rename | MARKETPLACE:MANAGE | +--------------------+---------------------+------------------------------+ | enable | one.market.enable | MARKETPLACE:MANAGE | | | | | | disable | | | +--------------------+---------------------+------------------------------+ | list | one.marketpool.info | MARKETPLACE:USE | +--------------------+---------------------+------------------------------+ onemarketapp -------------------------------------------------------------------------------- +----------------------+------------------------+---------------------------------+ | onemarketapp command | XML-RPC Method | Auth. Request | +======================+========================+=================================+ | create | one.marketapp.allocate | MARKETPLACEAPP:CREATE | | | | | | | | MARKETPLACE:USE | +----------------------+------------------------+---------------------------------+ | export* | -- (ruby method) | MARKETPLACEAPP:USE | | | | | | | | IMAGE:CREATE | | | | | | | | DATASTORE:USE | | | | | | | | [TEMPLATE:CREATE] | +----------------------+------------------------+---------------------------------+ | download* | -- (ruby method) | MARKETPLACEAPP:USE | +----------------------+------------------------+---------------------------------+ | enable | one.marketapp.enable | MARKETPLACEAPP:MANAGE | | | | | | disable | | | +----------------------+------------------------+---------------------------------+ | update | one.marketapp.update | MARKETPLACEAPP:MANAGE | +----------------------+------------------------+---------------------------------+ | delete | one.marketapp.delete | MARKETPLACEAPP:MANAGE | +----------------------+------------------------+---------------------------------+ | show | one.marketapp.info | MARKETPLACEAPP:USE | +----------------------+------------------------+---------------------------------+ | chown | one.marketapp.chown | MARKETPLACEAPP:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +----------------------+------------------------+---------------------------------+ | chmod | one.marketapp.chmod | MARKETPLACEAPP: | +----------------------+------------------------+---------------------------------+ | rename | one.marketapp.rename | MARKETPLACEAPP:MANAGE | +----------------------+------------------------+---------------------------------+ | list | one.marketapppool.info | MARKETPLACEAPP:USE | +----------------------+------------------------+---------------------------------+ | lock | one.marketapp.lock | MARKETPLACEAPP:MANAGE | +----------------------+------------------------+---------------------------------+ | unlock | one.marketapp.unlock | MARKETPLACEAPP:MANAGE | +----------------------+------------------------+---------------------------------+ onevrouter -------------------------------------------------------------------------------- +--------------------+-------------------------+------------------------+ | onevrouter command | XML-RPC Method | Auth. Request | +====================+=========================+========================+ | create | one.vrouter.allocate | VROUTER:CREATE | +--------------------+-------------------------+------------------------+ | update | one.vrouter.update | VROUTER:MANAGE | +--------------------+-------------------------+------------------------+ | instantiate | one.vrouter.instantiate | TEMPLATE:USE | | | | | | | | [IMAGE:USE] | | | | | | | | [NET:USE] | +--------------------+-------------------------+------------------------+ | nic-attach | one.vrouter.attachnic | VROUTER:MANAGE | | | | | | | | NET:USE | +--------------------+-------------------------+------------------------+ | nic-detach | one.vrouter.detachnic | VROUTER:MANAGE | +--------------------+-------------------------+------------------------+ | delete | one.vrouter.delete | VROUTER:MANAGE | +--------------------+-------------------------+------------------------+ | show | one.vrouter.info | VROUTER:USE | +--------------------+-------------------------+------------------------+ | chown | one.vrouter.chown | VROUTER:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +--------------------+-------------------------+------------------------+ | chmod | one.vrouter.chmod | VROUTER: | +--------------------+-------------------------+------------------------+ | rename | one.vrouter.rename | VROUTER:MANAGE | +--------------------+-------------------------+------------------------+ | list | one.vrouterpool.info | VROUTER:USE | | | | | | top | | | +--------------------+-------------------------+------------------------+ | lock | one.vrouter.lock | VROUTER:MANAGE | +--------------------+-------------------------+------------------------+ | unlock | one.vrouter.unlock | VROUTER:MANAGE | +--------------------+-------------------------+------------------------+ onezone -------------------------------------------------------------------------------- +-----------------+-------------------+---------------+ | onezone command | XML-RPC Method | Auth. Request | +=================+===================+===============+ | create | one.zone.allocate | ZONE:CREATE | +-----------------+-------------------+---------------+ | rename | one.zone.rename | ZONE:MANAGE | +-----------------+-------------------+---------------+ | update | one.zone.update | ZONE:MANAGE | +-----------------+-------------------+---------------+ | 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 | +-----------------+-------------------+---------------+ | set | -- | ZONE:USE | +-----------------+-------------------+---------------+ onesecgroup -------------------------------------------------------------------------------- +---------------------+-----------------------+---------------------------+ | onesecgroup command | XML-RPC Method | Auth. Request | +=====================+=======================+===========================+ | create | one.secgroup.allocate | SECGROUP:CREATE | +---------------------+-----------------------+---------------------------+ | clone | one.secgroup.clone | SECGROUP:CREATE | | | | | | | | SECGROUP:USE | +---------------------+-----------------------+---------------------------+ | delete | one.secgroup.delete | SECGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | chown | one.secgroup.chown | SECGROUP:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +---------------------+-----------------------+---------------------------+ | chmod | one.secgroup.chmod | SECGROUP: | +---------------------+-----------------------+---------------------------+ | update | one.secgroup.update | SECGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | commit | one.secgroup.commit | SECGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | rename | one.secgroup.rename | SECGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | show | one.secgroup.info | SECGROUP:USE | +---------------------+-----------------------+---------------------------+ | list | one.secgrouppool.info | SECGROUP:USE | +---------------------+-----------------------+---------------------------+ .. _onevmgroup_api: onevmgroup -------------------------------------------------------------------------------- +---------------------+-----------------------+---------------------------+ | onevmgroup command | XML-RPC Method | Auth. Request | +=====================+=======================+===========================+ | create | one.vmgroup.allocate | VMGROUP:CREATE | +---------------------+-----------------------+---------------------------+ | delete | one.vmgroup.delete | VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | chown | one.vmgroup.chown | VMGROUP:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +---------------------+-----------------------+---------------------------+ | chmod | one.vmgroup.chmod | VMGROUP: | +---------------------+-----------------------+---------------------------+ | update | one.vmgroup.update | VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | rename | one.vmgroup.rename | VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | show | one.vmgroup.info | VMGROUP:USE | +---------------------+-----------------------+---------------------------+ | list | one.vmgrouppool.info | VMGROUP:USE | +---------------------+-----------------------+---------------------------+ | lock | one.vmgroup.lock | VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | unlock | one.vmgroup.unlock | VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | role-add | one.vmgroup.roleadd | VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | role-delete | one.vmgroup.roledelete| VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ | role-update | one.vmgroup.roleupdate| VMGROUP:MANAGE | +---------------------+-----------------------+---------------------------+ oneacl -------------------------------------------------------------------------------- +----------------+-----------------+---------------+ | oneacl command | XML-RPC Method | Auth. Request | +================+=================+===============+ | create | one.acl.addrule | ACL:MANAGE | +----------------+-----------------+---------------+ | delete | one.acl.delrule | ACL:MANAGE | +----------------+-----------------+---------------+ | list | one.acl.info | ACL:MANAGE | +----------------+-----------------+---------------+ oneacct -------------------------------------------------------------------------------- +---------+-----------------------+---------------+ | command | XML-RPC Method | Auth. Request | +=========+=======================+===============+ | oneacct | one.vmpool.accounting | VM:USE | +---------+-----------------------+---------------+ oneshowback -------------------------------------------------------------------------------- +-----------+------------------------------+------------------------+ | command | XML-RPC Method | Auth. Request | +===========+==============================+========================+ | list | one.vmpool.showback | VM:USE | +-----------+------------------------------+------------------------+ | calculate | one.vmpool.calculateshowback | Only for oneadmin group| +-----------+------------------------------+------------------------+ .. _document_api: documents -------------------------------------------------------------------------------- +-----------------------+---------------------------+ | XML-RPC Method | Auth. Request | +=======================+===========================+ | one.document.update | DOCUMENT:MANAGE | +-----------------------+---------------------------+ | one.document.allocate | DOCUMENT:CREATE | +-----------------------+---------------------------+ | one.document.clone | DOCUMENT:CREATE | | | | | | DOCUMENT:USE | +-----------------------+---------------------------+ | one.document.delete | DOCUMENT:MANAGE | +-----------------------+---------------------------+ | one.document.info | DOCUMENT:USE | +-----------------------+---------------------------+ | one.document.chown | DOCUMENT:MANAGE | | | | | | [USER:MANAGE] | | | | | | [GROUP:USE] | +-----------------------+---------------------------+ | one.document.chmod | DOCUMENT: | +-----------------------+---------------------------+ | one.document.rename | DOCUMENT:MANAGE | +-----------------------+---------------------------+ | one.document.lock | DOCUMENT:MANAGE | +-----------------------+---------------------------+ | one.document.unlock | DOCUMENT:MANAGE | +-----------------------+---------------------------+ | one.documentpool.info | DOCUMENT:USE | +-----------------------+---------------------------+ | one.document.lock | DOCUMENT:MANAGE | +-----------------------+---------------------------+ | one.document.unlock | DOCUMENT:MANAGE | +-----------------------+---------------------------+ system -------------------------------------------------------------------------------- +---------+--------------------+-----------------------------------------+ | command | XML-RPC Method | Auth. Request | +=========+====================+=========================================+ | -- | one.system.version | -- | +---------+--------------------+-----------------------------------------+ | -- | one.system.config | Ony for users in the ``oneadmin`` group | +---------+--------------------+-----------------------------------------+ onevntemplate -------------------------------------------------------------------------------- +-----------------------+----------------------------+---------------------------+ | onevntemplate command | XML-RPC Method | Auth. Request | +=======================+============================+===========================+ | update | one.vntemplate.update | VNTEMPLATE:MANAGE | +-----------------------+----------------------------+---------------------------+ | instantiate | one.vntemplate.instantiate | VNTEMPLATE:USE | +-----------------------+----------------------------+---------------------------+ | create | one.vntemplate.allocate | VNTEMPLATE:CREATE | +-----------------------+----------------------------+---------------------------+ | clone | one.vntemplate.clone | VNTEMPLATE:CREATE | | | | | | | | VNTEMPLATE:USE | +-----------------------+----------------------------+---------------------------+ | delete | one.vntemplate.delete | VNTEMPLATE:MANAGE | +-----------------------+----------------------------+---------------------------+ | show | one.vntemplate.info | VNTEMPLATE:USE | +-----------------------+----------------------------+---------------------------+ | chown | one.vntemplate.chown | VNTEMPLATE:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +-----------------------+----------------------------+---------------------------+ | chmod | one.vntemplate.chmod | VNTEMPLATE: | +-----------------------+----------------------------+---------------------------+ | rename | one.vntemplate.rename | VNTEMPLATE:MANAGE | +-----------------------+----------------------------+---------------------------+ | list | one.vntemplatepool.info | VNTEMPLATE:USE | | | | | | top | | | +-----------------------+----------------------------+---------------------------+ | lock | one.vntemplate.lock | VNTEMPLATE:MANAGE | +-----------------------+----------------------------+---------------------------+ | unlock | one.vntemplate.unlock | VNTEMPLATE:MANAGE | +-----------------------+----------------------------+---------------------------+ onehook -------------------------------------------------------------------------------- +-----------------------+----------------------------+---------------------------+ | onevntemplate command | XML-RPC Method | Auth. Request | +=======================+============================+===========================+ | update | one.hook.update | HOOK:MANAGE | +-----------------------+----------------------------+---------------------------+ | create | one.hook.allocate | HOOK:CREATE | +-----------------------+----------------------------+---------------------------+ | delete | one.hook.delete | HOOK:MANAGE | +-----------------------+----------------------------+---------------------------+ | show | one.hook.info | HOOK:USE | +-----------------------+----------------------------+---------------------------+ | rename | one.hook.rename | HOOK:MANAGE | +-----------------------+----------------------------+---------------------------+ | list | one.hook.info | HOOK:USE | | | | | | top | | | +-----------------------+----------------------------+---------------------------+ | lock | one.hook.lock | HOOK:MANAGE | +-----------------------+----------------------------+---------------------------+ | unlock | one.hook.unlock | HOOK:MANAGE | +-----------------------+----------------------------+---------------------------+ | retry | one.hook.unlock | HOOK:MANAGE | +-----------------------+----------------------------+---------------------------+ | log | one.hooklog.info | HOOK:- | +-----------------------+----------------------------+---------------------------+ onebackupjob -------------------------------------------------------------------------------- +----------------------+---------------------------+--------------------------+ | onebackupjob command | XML-RPC Method | Auth. Request | +======================+===========================+==========================+ | create | one.backupjob.allocate | BACKUPJOB:CREATE | +----------------------+---------------------------+--------------------------+ | delete | one.backupjob.delete | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | show | one.backupjob.info | BACKUPJOB:USE | +----------------------+---------------------------+--------------------------+ | update | one.backupjob.update | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | rename | one.backupjob.rename | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | chown | one.backupjob.chown | BACKUPJOB:MANAGE | | | | | | chgrp | | [USER:MANAGE] | | | | | | | | [GROUP:USE] | +----------------------+---------------------------+--------------------------+ | chmod | one.backupjob.chmod | BACKUPJOB: | +----------------------+---------------------------+--------------------------+ | lock | one.backupjob.lock | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | unlock | one.backupjob.unlock | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | backup | one.backupjob.backup | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | cancel | one.backupjob.cancel | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | retry | one.backupjob.retry | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | priority | one.backupjob.priority | BACKUPJOB: | +----------------------+---------------------------+--------------------------+ | backup \-\-schedule | one.backupjob.schedadd | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | sched-delete | one.backupjob.scheddelete | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | sched-update | one.backupjob.schedupdate | BACKUPJOB:MANAGE | +----------------------+---------------------------+--------------------------+ | list | one.backupjobpool.info | BACKUPJOB:USE | +----------------------+---------------------------+--------------------------+ Actions for Templates Management ================================================================================ one.template.allocate -------------------------------------------------------------------------------- - **Description**: Allocates a new template in OpenNebula. - **Parameters** +------+------------+------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+================================================================================================+ | IN | String | The session string. | +------+------------+------------------------------------------------------------------------------------------------+ | IN | String | A string containing the template contents. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+------------------------------------------------------------------------------------------------+ | OUT | Int/String | The allocated resource ID / The error string. | +------+------------+------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+------------------------------------------------------------------------------------------------+ one.template.clone -------------------------------------------------------------------------------- - **Description**: Clones an existing virtual machine template. - **Parameters** +------+------------+----------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+====================================================================================================+ | IN | String | The session string. | +------+------------+----------------------------------------------------------------------------------------------------+ | IN | Int | The ID of the template to be cloned. | +------+------------+----------------------------------------------------------------------------------------------------+ | IN | String | Name for the new template. | +------+------------+----------------------------------------------------------------------------------------------------+ | IN | Boolean | true to clone the template plus any image defined in DISK. The new IMAGE_ID is set into each DISK. | +------+------------+----------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+----------------------------------------------------------------------------------------------------+ | OUT | Int/String | The new template ID / The error string. | +------+------------+----------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+----------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the original object that caused the error. | +------+------------+----------------------------------------------------------------------------------------------------+ one.template.delete -------------------------------------------------------------------------------- - **Description**: Deletes the given template from the pool. - **Parameters** +------+------------+-------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================================+ | IN | String | The session string. | +------+------------+-------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+-------------------------------------------------------------+ | IN | Boolean | true to delete the template plus any image defined in DISK. | +------+------------+-------------------------------------------------------------+ | 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.template.instantiate -------------------------------------------------------------------------------- - **Description**: Instantiates a new virtual machine from a template. - **Parameters** +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+==========================================================================================================================================================+ | IN | String | The session string. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | Name for the new VM instance. If it is an empty string, OpenNebula will assign one automatically. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Boolean | False to create the VM on pending (default), True to create it on hold. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | A string containing an extra template to be merged with the one being instantiated. It can be empty. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Boolean | true to create a private persistent copy of the template plus any image defined in DISK, and instantiate that copy. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The new virtual machine ID / The error string. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ Sample template string: .. code-block:: none MEMORY=4096\nCPU=4\nVCPU=4 .. note:: Declaring a field overwrites the template. Thus, declaring ``DISK=[...]`` overwrites the template ``DISK`` attribute and as such, must contain the entire ``DISK`` definition. one.template.update -------------------------------------------------------------------------------- - **Description**: Replaces the template contents. - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+==================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | String | The new template contents. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Int | Update type: **0**: replace the whole template. **1**: Merge new template with the existing one. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int/String | The resource ID / The error string. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+--------------------------------------------------------------------------------------------------+ one.template.chmod -------------------------------------------------------------------------------- - **Description**: Changes the permission bits of a template. - **Parameters** +------+------------+------------------------------------------------------------+ | Type | Data Type | Description | +======+============+============================================================+ | IN | String | The session string. | +------+------------+------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+------------------------------------------------------------+ | IN | Int | USER USE bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | USER MANAGE bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | USER ADMIN bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | GROUP USE bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | GROUP MANAGE bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | GROUP ADMIN bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | OTHER USE bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | OTHER MANAGE bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Int | OTHER ADMIN bit. If set to -1, it will not change. | +------+------------+------------------------------------------------------------+ | IN | Boolean | true to chmod the template plus any image defined in DISK. | +------+------------+------------------------------------------------------------+ | 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.template.chown -------------------------------------------------------------------------------- - **Description**: Changes the ownership of a template. - **Parameters** +------+------------+------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+========================================================================+ | IN | String | The session string. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The User ID of the new owner. If set to -1, the owner is not changed. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The Group ID of the new group. If set to -1, the group is not changed. | +------+------------+------------------------------------------------------------------------+ | 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.template.rename -------------------------------------------------------------------------------- - **Description**: Renames a template. - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | String | The new name. | +------+------------+---------------------------------------------+ | 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 object that caused the error. | +------+------------+---------------------------------------------+ one.template.info -------------------------------------------------------------------------------- - **Description**: Retrieves information for the template. - **Parameters** +------+-----------+--------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+===========+========================================================================================================+ | IN | String | The session string. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Boolean | optional flag to process the template and include extended information, such as the SIZE for each DISK | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Boolean | optional flag to decrypt contained secrets, valid only for admin | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | String | The information string / The error string. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the object that caused the error. | +------+-----------+--------------------------------------------------------------------------------------------------------+ one.templatepool.info -------------------------------------------------------------------------------- - **Description**: Retrieves information for all or part of the Resources in the pool. - **Parameters** +------+-----------+-----------------------------------------------------------------------+ | Type | Data Type | Description | +======+===========+=======================================================================+ | IN | String | The session string. | +------+-----------+-----------------------------------------------------------------------+ | IN | Int | Filter flag | | | | | | | | * **-4**: Resources belonging to the user's primary group | | | | * **-3**: Resources belonging to the user | | | | * **-2**: All resources | | | | * **-1**: Resources belonging to the user and any of his groups | | | | * **>= 0**: UID User's Resources | +------+-----------+-----------------------------------------------------------------------+ | IN | Int | When the next parameter is >= -1 this is the Range start ID. | | | | Can be -1. For smaller values this is the offset used for pagination. | +------+-----------+-----------------------------------------------------------------------+ | IN | Int | For values >= -1 this is the Range end ID. Can be -1 to get until the | | | | last ID. For values < -1 this is the page size used for pagination. | +------+-----------+-----------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+-----------+-----------------------------------------------------------------------+ | OUT | String | The information string / The error string. | +------+-----------+-----------------------------------------------------------------------+ | 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 ``(, -1)``, and to retrieve the first elements up to an ID, use ``(0, )``. one.template.lock -------------------------------------------------------------------------------- - **Description**: Locks a Template. - **Parameters** +------+-----------+--------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+===========+========================================================================================================+ | IN | String | The session string. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Int | Lock level: use (1), manage (2), admin (3), all (4) | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Boolean | Test: check if the object is already locked to return an error | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | The ID of the resource. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the object that caused the error. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | String | Timestamp when the object was locked in case of error when using test = true | +------+-----------+--------------------------------------------------------------------------------------------------------+ one.template.unlock -------------------------------------------------------------------------------- - **Description**: Unlocks a Template. - **Parameters** +------+-----------+--------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+===========+========================================================================================================+ | IN | String | The session string. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | The ID of the resource. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+-----------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the object that caused the error. | +------+-----------+--------------------------------------------------------------------------------------------------------+ Actions for Virtual Machine Management ================================================================================ one.vm.allocate -------------------------------------------------------------------------------- - **Description**: Allocates a new virtual machine in OpenNebula. - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+==================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | String | A string containing the template for the vm. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Boolean | False to create the VM on pending (default), True to create it on hold. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int/String | The allocated resource ID / The error string. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the Cluster that caused the error. | +------+------------+--------------------------------------------------------------------------------------------------+ one.vm.deploy -------------------------------------------------------------------------------- - **Description**: initiates the instance of the given vmid on the target host. - **Parameters** +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================================================================================================================================+ | IN | String | The session string. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The Host ID of the target host where the VM will be deployed. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Boolean | true to enforce the Host capacity is not overcommitted. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The Datastore ID of the target system datastore where the VM will be deployed. It is optional, and can be set to -1 to let OpenNebula choose the datastore. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | Template with network scheduling results for NIC in AUTO mode. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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 Datastore that caused the error. | +------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.action -------------------------------------------------------------------------------- - **Description**: submits an action to be performed on a virtual machine. - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | String | the action name to be performed, see below. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------+ The action String must be one of the following: * **terminate-hard** * **terminate** * **undeploy-hard** * **undeploy** * **poweroff-hard** * **poweroff** * **reboot-hard** * **reboot** * **hold** * **release** * **stop** * **suspend** * **resume** * **resched** * **unresched** .. _one_vm_migrate: one.vm.migrate -------------------------------------------------------------------------------- - **Description**: migrates one virtual machine (vid) to the target host (hid). - **Parameters** +------+------------+------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+========================================================================+ | IN | String | The session string. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+------------------------------------------------------------------------+ | IN | Int | the target host id (hid) where we want to migrate the vm. | +------+------------+------------------------------------------------------------------------+ | IN | Boolean | if true we are indicating that we want livemigration, otherwise false. | +------+------------+------------------------------------------------------------------------+ | IN | Boolean | true to enforce the Host capacity is not overcommitted. | +------+------------+------------------------------------------------------------------------+ | IN | Int | the target system DS id where we want to migrate the vm. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The migration type (0 save, 1 poweroff, 2 poweroff hard). | +------+------------+------------------------------------------------------------------------+ | 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 Datastore / Host that caused the error. | +------+------------+------------------------------------------------------------------------+ one.vm.disksaveas -------------------------------------------------------------------------------- - **Description**: Sets the disk to be saved in the given image. - **Parameters** +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=======================================================================================================================================================================================+ | IN | String | The session string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Disk ID of the disk we want to save. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | Name for the new Image where the disk will be saved. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | Type for the new Image. If it is an empty string, then :ref:`the default one ` will be used. See the existing types in the :ref:`Image template reference `. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Id of the snapshot to export, if -1 the current image state will be used. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The new allocated Image ID / The error string. | | | | | | | | If the Template was cloned, the new Template ID is not returned. The Template can be found by name: "-" | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the Image / Datastore that caused the error. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.disksnapshotcreate -------------------------------------------------------------------------------- - **Description**: Takes a new snapshot of the disk image - **Parameters** +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=======================================================================================================================================================================================+ | IN | String | The session string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Disk ID of the disk we want to snpashot. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | Description for the snapshot. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The new snapshot ID / The error string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the Image that caused the error. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.disksnapshotdelete -------------------------------------------------------------------------------- - **Description**: Deletes a disk snapshot - **Parameters** +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=======================================================================================================================================================================================+ | IN | String | The session string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Disk ID of the disk we want to delete. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | ID of the snapshot to be deleted. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The ID of the snapshot deleted/ The error string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | ID of the Image that caused the error. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.disksnapshotrevert -------------------------------------------------------------------------------- - **Description**: Reverts disk state to a previously taken snapshot - **Parameters** +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=======================================================================================================================================================================================+ | IN | String | The session string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Disk ID of the disk to revert its state. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Snapshot ID to revert the disk state to. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The snapshot ID used / The error string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.disksnapshotrename -------------------------------------------------------------------------------- - **Description**: Renames a disk snapshot - **Parameters** +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=======================================================================================================================================================================================+ | IN | String | The session string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | VM ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Disk ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | Snapshot ID. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | New snapshot name. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.attach -------------------------------------------------------------------------------- - **Description**: Attaches a new disk to the virtual machine - **Parameters** +------+------------+---------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+=========================================================================================================+ | IN | String | The session string. | +------+------------+---------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------------------------------------------------------------------+ | IN | String | A string containing a single DISK vector attribute. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+---------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------------------------------------------------------------------+ Sample DISK vector attribute: .. code-block:: none DISK=[IMAGE_ID=42, TYPE=RBD, DEV_PREFIX=vd, SIZE=123456, TARGET=vdc] one.vm.detach -------------------------------------------------------------------------------- - **Description**: Detaches a disk from a virtual machine - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | Int | The disk ID. | +------+------------+---------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------+ one.vm.diskresize -------------------------------------------------------------------------------- - **Description**: Resizes a disk of a virtual machine - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | Int | The disk ID. | +------+------------+---------------------------------------------+ | IN | String | The new size string. | +------+------------+---------------------------------------------+ | 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 Image that caused the error. | +------+------------+---------------------------------------------+ one.vm.attachnic -------------------------------------------------------------------------------- - **Description**: Attaches a new network interface to the virtual machine - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+========================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | String | A string containing a single NIC vector attribute. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+--------------------------------------------------------------------------------------------------------+ | 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 that caused the error. | +------+------------+--------------------------------------------------------------------------------------------------------+ one.vm.detachnic -------------------------------------------------------------------------------- - **Description**: Detaches a network interface from a virtual machine - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | Int | The nic ID. | +------+------------+---------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------+ .. _api_onevm_updatenic: one.vm.updatenic -------------------------------------------------------------------------------- - **Description**: Updates (appends) a NIC attributes - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+========================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The nic ID. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | String | A string containing updated attributes for the NIC. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | Update type: **0**: Replace the whole NIC. **1**: Merge new NIC with the existing one. | +------+------------+--------------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+--------------------------------------------------------------------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+--------------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+--------------------------------------------------------------------------------------------------------+ one.vm.attachsg -------------------------------------------------------------------------------- - **Description**: Attaches a security group to a network interface of a VM, if the VM is running it updates the associated rules. - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+========================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The Virtual Machine ID. | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The NIC ID | +------+------------+--------------------------------------------------------------------------------------------------------+ | IN | Int | The Security Group ID, which should be added to the NIC | +------+------------+--------------------------------------------------------------------------------------------------------+ | 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 that caused the error. | +------+------------+--------------------------------------------------------------------------------------------------------+ one.vm.detachsg -------------------------------------------------------------------------------- - **Description**: Detaches a security group from a network interface of a VM, if the VM is running it removes the associated rules. - **Parameters** +------+------------+--------------------------------------------------+ | Type | Data Type | Description | +======+============+==================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------+ | IN | Int | The NIC ID. | +------+------------+--------------------------------------------------+ | 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 that caused the error. | +------+------------+--------------------------------------------------+ one.vm.chmod -------------------------------------------------------------------------------- - **Description**: Changes the permission bits of a virtual machine. - **Parameters** +------+------------+-----------------------------------------------------+ | Type | Data Type | Description | +======+============+=====================================================+ | IN | String | The session string. | +------+------------+-----------------------------------------------------+ | IN | Int | The object ID. | +------+------------+-----------------------------------------------------+ | IN | Int | USER USE bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | USER MANAGE bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | USER ADMIN bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | GROUP USE bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | GROUP MANAGE bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | GROUP ADMIN bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | OTHER USE bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | OTHER MANAGE bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | IN | Int | OTHER ADMIN bit. If set to -1, it will not change. | +------+------------+-----------------------------------------------------+ | 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.vm.chown -------------------------------------------------------------------------------- - **Description**: Changes the ownership of a virtual machine. - **Parameters** +------+------------+------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+========================================================================+ | IN | String | The session string. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The User ID of the new owner. If set to -1, the owner is not changed. | +------+------------+------------------------------------------------------------------------+ | IN | Int | The Group ID of the new group. If set to -1, the group is not changed. | +------+------------+------------------------------------------------------------------------+ | 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.vm.rename -------------------------------------------------------------------------------- - **Description**: Renames a virtual machine - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | String | The new name. | +------+------------+---------------------------------------------+ | 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 object that caused the error. | +------+------------+---------------------------------------------+ one.vm.snapshotcreate -------------------------------------------------------------------------------- - **Description**: Creates a new virtual machine snapshot - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | String | The new snapshot name. It can be empty. | +------+------------+---------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------+ | OUT | Int/String | The new snapshot ID / The error string. | +------+------------+---------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------+ one.vm.snapshotrevert -------------------------------------------------------------------------------- - **Description**: Reverts a virtual machine to a snapshot - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | Int | The snapshot ID. | +------+------------+---------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------+ one.vm.snapshotdelete -------------------------------------------------------------------------------- - **Description**: Deletes a virtual machine snapshot - **Parameters** +------+------------+---------------------------------------------+ | Type | Data Type | Description | +======+============+=============================================+ | IN | String | The session string. | +------+------------+---------------------------------------------+ | IN | Int | The object ID. | +------+------------+---------------------------------------------+ | IN | Int | The snapshot ID. | +------+------------+---------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+---------------------------------------------+ | OUT | Int/String | The VM ID / The error string. | +------+------------+---------------------------------------------+ | OUT | Int | Error code. | +------+------------+---------------------------------------------+ one.vm.resize -------------------------------------------------------------------------------- - **Description**: Changes the capacity of the virtual machine - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+======================================================================================================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | String | Template containing the new capacity elements CPU, VCPU, MEMORY. If one of them is not present, or its value is 0, it will not be resized. | +------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | IN | Boolean | true to enforce the Host capacity is not overcommitted. This parameter is only acknoledged for users in the oneadmin group, Host capacity will be always enforced for regular users. | +------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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 / Host that caused the error. | +------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ one.vm.update -------------------------------------------------------------------------------- - **Description**: Replaces the **user template** contents. - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+==================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | String | The new user template contents. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Int | Update type: **0**: Replace the whole template. **1**: Merge new template with the existing one. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Boolean | true or false whenever is successful or not | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int/String | The resource ID / The error string. | +------+------------+--------------------------------------------------------------------------------------------------+ | OUT | Int | Error code. | +------+------------+--------------------------------------------------------------------------------------------------+ .. _api_onevmmupdateconf: one.vm.updateconf -------------------------------------------------------------------------------- - **Description**: Updates (appends) a set of supported configuration attributes in the VM template - **Parameters** +------+------------+--------------------------------------------------------------------------------------------------+ | Type | Data Type | Description | +======+============+==================================================================================================+ | IN | String | The session string. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Int | The object ID. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | String | The new template contents. Syntax can be the usual ``attribute=value`` or XML. | +------+------------+--------------------------------------------------------------------------------------------------+ | IN | Int | Update type: **0**: Replace the whole template. **1**: Merge new template with the existing one. | +------+------------+--------------------------------------------------------------------------------------------------+ | 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 Virtual Machine that caused the error. | +------+------------+--------------------------------------------------------------------------------------------------+ The supported attributes are: +--------------------+--------------------------------------------------------------------------------+ | Attribute | Sub-attributes | +====================+================================================================================+ | ``OS`` | ``ARCH``, ``MACHINE``, ``KERNEL``, ``INITRD``, ``BOOTLOADER``, ``BOOT``, | | | ``KERNEL_CMD``, ``ROOT``, ``SD_DISK_BUS``, ``UUID``, ``FIRMWARE`` | +--------------------+--------------------------------------------------------------------------------+ | ``CPU_MODEL`` | ``MODEL`` | +--------------------+--------------------------------------------------------------------------------+ | ``FEATURES`` | ``ACPI``, ``PAE``, ``APIC``, ``LOCALTIME``, ``HYPERV``, ``GUEST_AGENT``, | | | ``VIRTIO_SCSI_QUEUES``, ``VIRTIO_BLK_QUEUES``, ``IOTHREADS`` | +--------------------+--------------------------------------------------------------------------------+ | ``INPUT`` | ``TYPE``, ``BUS`` | +--------------------+--------------------------------------------------------------------------------+ | ``GRAPHICS`` | ``TYPE``, ``LISTEN``, ``PASSWD``, ``KEYMAP``, ``COMMAND`` | +--------------------+--------------------------------------------------------------------------------+ | ``VIDEO`` | ``TYPE``, ``IOMMU``, ``ATS``, ``VRAM``, ``RESOLUTION`` | +--------------------+--------------------------------------------------------------------------------+ | ``RAW`` | ``DATA``, ``DATA_VMX``, ``TYPE``, ``VALIDATE`` | +--------------------+--------------------------------------------------------------------------------+ | ``CONTEXT`` | Any value, except ``ETH*``. **Variable substitution will be made** | +--------------------+--------------------------------------------------------------------------------+ | ``BACKUP_CONFIG`` | ``FS_FREEZE``, ``KEEP_LAST``, ``BACKUP_VOLATILE``, ``MODE``, ``INCREMENT_MODE``| +--------------------+--------------------------------------------------------------------------------+ .. note:: Visit the :ref:`Virtual Machine Template reference