X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/27d75ee0bede8bc19a6a96a0fb86b26ce9c07e97..4d765a1719a735ebc224af254315647010a1368c:/doc/rapi.rst?ds=sidebyside diff --git a/doc/rapi.rst b/doc/rapi.rst index ec5fa5c..c206a63 100644 --- a/doc/rapi.rst +++ b/doc/rapi.rst @@ -91,6 +91,13 @@ Example:: # write access) superuser {HA1}ec018ffe72b8e75bb4d508ed5b6d079c read,write +When using the RAPI, username and password can be sent to the server +by using the standard HTTP basic access authentication. This means that +for accessing the protected URL ``https://cluster.example.com/resource``, +the address ``https://username:password@cluster.example.com/resource`` should +be used instead. +Alternatively, the appropriate parameter of your HTTP client +(such as ``-u`` for ``curl``) can be used. .. [#pwhash] Using the MD5 hash of username, realm and password is described in :rfc:`2617` ("HTTP Authentication"), sections 3.2.2.2 @@ -221,8 +228,7 @@ The instance policy specification is a dict with the following fields: .. pyassert:: - constants.IPOLICY_ALL_KEYS == set([constants.ISPECS_MIN, - constants.ISPECS_MAX, + constants.IPOLICY_ALL_KEYS == set([constants.ISPECS_MINMAX, constants.ISPECS_STD, constants.IPOLICY_DTS, constants.IPOLICY_VCPU_RATIO, @@ -244,24 +250,30 @@ The instance policy specification is a dict with the following fields: .. |ispec-std| replace:: :pyeval:`constants.ISPECS_STD` -|ispec-min|, |ispec-max|, |ispec-std| - A sub- `dict` with the following fields, which sets the limit and standard - values of the instances: - - :pyeval:`constants.ISPEC_MEM_SIZE` - The size in MiB of the memory used - :pyeval:`constants.ISPEC_DISK_SIZE` - The size in MiB of the disk used - :pyeval:`constants.ISPEC_DISK_COUNT` - The numbers of disks used - :pyeval:`constants.ISPEC_CPU_COUNT` - The numbers of cpus used - :pyeval:`constants.ISPEC_NIC_COUNT` - The numbers of nics used - :pyeval:`constants.ISPEC_SPINDLE_USE` - The numbers of virtual disk spindles used by this instance. They are - not real in the sense of actual HDD spindles, but useful for - accounting the spindle usage on the residing node +:pyeval:`constants.ISPECS_MINMAX` + A list of dictionaries, each with the following two fields: + + |ispec-min|, |ispec-max| + A sub- `dict` with the following fields, which sets the limit of the + instances: + + :pyeval:`constants.ISPEC_MEM_SIZE` + The size in MiB of the memory used + :pyeval:`constants.ISPEC_DISK_SIZE` + The size in MiB of the disk used + :pyeval:`constants.ISPEC_DISK_COUNT` + The numbers of disks used + :pyeval:`constants.ISPEC_CPU_COUNT` + The numbers of cpus used + :pyeval:`constants.ISPEC_NIC_COUNT` + The numbers of nics used + :pyeval:`constants.ISPEC_SPINDLE_USE` + The numbers of virtual disk spindles used by this instance. They + are not real in the sense of actual HDD spindles, but useful for + accounting the spindle usage on the residing node +|ispec-std| + A sub- `dict` with the same fields as |ispec-min| and |ispec-max| above, + which sets the standard values of the instances. :pyeval:`constants.IPOLICY_DTS` A `list` of disk templates allowed for instances using this policy :pyeval:`constants.IPOLICY_VCPU_RATIO` @@ -285,14 +297,19 @@ Shell .. highlight:: shell-example -Using wget:: +Using ``wget``:: $ wget -q -O - https://%CLUSTERNAME%:5080/2/info -or curl:: +or ``curl``:: $ curl https://%CLUSTERNAME%:5080/2/info +Note: with ``curl``, the request method (GET, POST, PUT) can be specified +using the ``-X`` command line option, and the username/password can be +specified with the ``-u`` option. In case of POST requests with a body, the +Content-Type can be set to JSON (as per the Protocol_ section) using the +parameter ``-H "Content-Type: application/json"``. Python ++++++ @@ -2094,15 +2111,15 @@ Manages storage units on the node. .. pyassert:: - constants.VALID_STORAGE_TYPES == set([constants.ST_FILE, - constants.ST_LVM_PV, - constants.ST_LVM_VG]) + constants.STS_REPORT == set([constants.ST_FILE, + constants.ST_LVM_PV, + constants.ST_LVM_VG]) Requests a list of storage units on a node. Requires the parameters -``storage_type`` (one of :pyeval:`constants.ST_FILE`, -:pyeval:`constants.ST_LVM_PV` or :pyeval:`constants.ST_LVM_VG`) and -``output_fields``. The result will be a job id, using which the result -can be retrieved. +``storage_type`` for storage types that support space reporting +(one of :pyeval:`constants.ST_FILE`, :pyeval:`constants.ST_LVM_PV` +or :pyeval:`constants.ST_LVM_VG`) and ``output_fields``. The result +will be a job id, using which the result can be retrieved. .. _rapi-res-nodes-node_name-storage-modify: