diff --git a/docs/manuals/api.md b/docs/manuals/api.md index a3e44031..478ef4ea 100644 --- a/docs/manuals/api.md +++ b/docs/manuals/api.md @@ -256,719 +256,6 @@ The path to the SSL certificate file for the API to use. The path to the SSL private key file for the API to use. -## Primary Client API endpoint documentation - -### General endpoints - -#### `/api/v1` - * Methods: `GET` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON `message` containing the API description with HTTP return code 209. Useful for determining if the API is listening and responding properly. - -#### `/api/v1/auth/login` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return an HTTP login form accepting a token to authorize a Flask session. - -###### `POST` - * Mandatory values: `token` - * Optional values: N/A - -Compare the specified `token` to the database and authorize a Flask session. - -#### `/api/v1/auth/logout` - * Methods: `GET`, `POST` - -###### `GET`/`POST` - * Mandatory values: N/A - * Optional values: N/A - -Deactivate the current Flask session for the active token. - -### Node endpoints - -These endpoints manage PVC node state and operation. - -#### `/api/v1/node` - * Methods: `GET` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all cluster nodes. If `limit` is specified, return a JSON document containing information about cluster nodes with names matching `limit` as fuzzy regex. - -#### `/api/v1/node/` - * Methods: `GET` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about ``. The output is identical to `/api/v1/node?limit=` without fuzzy regex matching. - -**NOTE:** Nodes are created automatically during daemon startup; they cannot be created by the client tools. - -#### `/api/v1/node//daemon-state` - * Methods: `GET` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return the daemon state of ``. - -#### `/api/v1/node//coordinator-state` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return the coordinator state of ``. - -###### `POST` - * Mandatory values: `coordinator-state` - * Optional values: N/A - -Set node `` into the specified coordinator state. Attempting to re-set an existing state has no effect. - -Valid `coordinator-state` values are: `primary`, `secondary`. - -#### `/api/v1/node//domain-state` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return the domain state of ``. - -###### `POST` - * Mandatory values: `domain-state` - * Optional values: N/A - -Set node `` to the specified domain state. Attempting to re-set an existing state has effect only if a previous state change did not complete fully, as this triggers a fresh change of state. - -Valid `coordinator-state` values are: `flush`, `ready`. - -### VM endpoints - -These endpoints manage PVC virtual machine (VM) state and operation. - -**NOTE:** The `` variable in all VM endpoints can be either a `name` or a `uuid`. UUIDs are used internally by PVC to track and identify VMs, but are not human-readable, so the clients treat both as equally valid and will automatically determine the `uuid` for any given `name`. - -#### `/api/v1/vm` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all cluster VMs. If `limit` is specified, return a JSON document containing information about VMs with names matching `limit` as fuzzy regex. - -###### `POST` - * Mandatory values: `xml` - * Optional values: `node`, `limit`, `selector`, `autostart` - -Define a new VM with Libvirt XML configuration `xml` (either single-line or human-readable multi-line). - -If `node` is specified and is valid, the VM will be assigned to `node` instead of automatically determining the target node. If `node` is specified and not valid, auto-selection occurs instead. - -If `limit` is speficied, the node will not be allowed to run on nodes not specified in the limit. - -The `limit` value must be a comma-separated list of nodes; invalid nodes are ignored. - -If `selector` is specified and no specific and valid `node` is specified, the automatic node determination will use `selector` to determine the optimal node instead of the default for the cluster. This value is stored as PVC metadata for this VM and is used in subsequent migrate (including node flush) and fence recovery operations. - -Valid `selector` values are: `mem`: the node with the least allocated VM memory; `vcpus`: the node with the least allocated VM vCPUs; `load`: the node with the least current load average; `vms`: the node with the least number of provisioned VMs. - -If `autostart` is specified, the VM will be set to autostart on the next node unflush/ready operation of the home node. This metadata value is reset to False by the node daemon on each successful use. - -**NOTE:** The `POST` operation assumes that the VM resources (i.e. disks, operating system, etc.) are already created. This is equivalent to the `pvc vm define` command in the PVC CLI client. *[todo v0.6]* Creating a new VM using the provisioner uses the `POST /api/vm/` endpoint instead. - -#### `/api/v1/vm/` - * Methods: `GET`, `POST`, `PUT`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about ``. The output is identical to `GET /api/v1/vm?limit=` without fuzzy regex matching. - -###### `POST` - * Mandatory values: At least one of optional values must be specified - * Optional values: `limit`, `selector`, `autostart`/`no-autostart` - -Update the PVC metadata of `` with the specified values. - -If `limit` is speficied, the node will not be allowed to run on nodes not specified in the limit. - -The `limit` value must be a comma-separated list of nodes; invalid nodes are ignored. - -If `selector` is specified and no specific and valid `node` is specified, the automatic node determination will use `selector` to determine the optimal node instead of the default for the cluster. This value is stored as PVC metadata for this VM and is used in subsequent migrate (including node flush) and fence recovery operations. - -Valid `selector` values are: `mem`: the node with the least allocated VM memory; `vcpus`: the node with the least allocated VM vCPUs; `load`: the node with the least current load average; `vms`: the node with the least number of provisioned VMs. - -If `autostart` is specified, the VM will be set to autostart on the next node unflush/ready operation of the home node. This metadata value is reset to False by the node daemon on each successful use. - -If `no-autostart` is specified, an existing autostart will be disabled if applicable. - -###### `PUT` - * Mandatory values: `xml` - * Optional values: `restart` - -Replace the existing Libvirt XML definition for `` with the specified Libvirt XML configuration `xml` (either single-line or human-readable multi-line). - -If `restart` is specified, the cluster will automatically `restart` the VM with the new configuration; if not, the administrator must do so manually. - -###### `DELETE` - * Mandatory values: N/A - * Optional values: `delete_disks` - -Forcibly stop and undefine ``. - -If `delete_disks` is specified, also remove all Ceph storage volumes for the VM. - -#### `/api/v1/vm//state` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return the state of ``. - -###### `POST` - * Mandatory values: `state` - * Optional values: N/A - -Set `` to the specified state. Attempting to re-set an existing state has no effect. - -Valid `state` values are: `start`, `shutdown`, `stop`, `restart` - -**NOTE:** The `shutdown` state will attempt to gracefully shutdown the VM with a 90s timeout, after which it will forcibly `stop` the VM. - -#### `/api/v1/vm//node` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return the current host node, and last host node if applicable, for ``. - -###### `POST` - * Mandatory values: `action` - * Optional values: `node`, `selector`, `permanent`, `force` - -Change the current host node for `` by `action`, using live migration if possible, and using `shutdown` then `start` if not. `action` must be either `migrate` or `unmigrate`. - -If `node` is specified and is valid, the VM will be assigned to `node` instead of automatically determining the target node. If `node` is specified and not valid, auto-selection occurs instead. - -If `selector` is specified and no specific and valid `node` is specified, the automatic node determination will use `selector` to determine the optimal node instead of the default for the cluster. - -Valid `selector` values are: `mem`: the node with the least allocated VM memory; `vcpus`: the node with the least allocated VM vCPUs; `load`: the node with the least current load average; `vms`: the node with the least number of provisioned VMs. - -If `permanent` is specified, the PVC system will not track the previous node and the VM will not be considered migrated. This is equivalent to the `pvc vm move` CLI command. - -If `force` is specified, and the VM has been previously migrated, force through a new migration to the selected target and do not update the previous node value. - -#### `/api/v1/vm//locks` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Not yet implemented and not planned. Return the list of RBD locks for the VM. - -###### `POST` - * Mandatory values: N/A - * Optional values: N/A - -Clear all RBD locks for volumes attached to ``. - -### Network endpoints - -These endpoints manage PVC client virtual network state and operation. - -#### `/api/v1/network` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all cluster networks. If `limit` is specified, return a JSON document containing information about cluster networks with descriptions matching `limit` as fuzzy regex. - -###### `POST` - * Mandatory values: `vni`, `description`, `nettype` - * Optional values: `domain`, `ip4_network`, `ip4_gateway`, `ip6_network`, `ip6_gateway`, `dhcp4`, `dhcp4_start`, `dhcp4_end` - -Add a new virtual network to the cluster. `vni` must be a valid VNI, either a vLAN ID (for `bridged` networks) or a VXLAN ID (or `managed` networks). `description` must be a whitespace-free description of the network. - -`nettype` must be one of the following network types: - -* `bridged` for unmanaged, vLAN-based bridged networks. All additional optional values are ignored by this type - -* `managed` for PVC-managed, VXLAN-based networks. - -`domain` specifies a DNS domain for hosts in the network. DNS is aggregated and provided for all networks on the primary coordinator node. - -`ip4_network` specifies a CIDR-formatted IPv4 netblock, usually RFC1918, for the network. - -`ip4_gateway` specifies an IP address from the `ip4_network` for the primary coordinator node to provide gateway services to the network. If `ip4_network` is specified but `ip4_gateway` is not specified or is invalid, return a failure. - -`ip6_network` specifies a CIDR-formatted IPv6 netblock for the network. - -`ip6_gateway` specifies an IP address from the `ip6_network` for the primary coordinator node to provide gateway services to the network. If `ip6_network` is specified but `ip6_gateway` is not specified or is invalid, default to `::1`. - -`dhcp4` specifies that DHCPv4 should be used for the IPv4 network. - -`dhcp4_start` specifies an IP address for the start of the DHCPv4 IP pool. If `dhcp4` is specified but `dhcp4_start` is not specified or is invalid, return a failure. - -`dhcp4_end` specifies an IP address for the end of the DHCPv4 IP pool. If `dhcp4` is specified but `dhcp4_end` is not specified or is invalid, return a failure. - -#### `/api/v1/network/` - * Methods: `GET`, `PUT`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about the virtual network ``. The output is identical to `/api/v1/network?limit=` without fuzzy regex matching. - -###### `PUT` - * Mandatory values: N/A - * Optional values: `domain`, `ip4_network`, `ip4_gateway`, `ip6_network`, `ip6_gateway`, `dhcp4`, `dhcp4_start`, `dhcp4_end` - -Modify the options of an existing virtual network ``. - -All values are optional and are identical to the values for `add`. Only those values specified will be updated. - -###### `DELETE` - -Remove a virtual network ``. - -#### `/api/v1/network//lease` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit`, `static` - -Return a JSON document containing information about all active DHCP leases in virtual network ``. - -If `limit` is specified, return a JSON document containing information about all active DHCP leases with MAC addresses matching `limit` as fuzzy regex. - -If `static` is specified, only return static DHCP leases. - -###### `POST` - * Mandatory values: `macaddress`, `ipaddress` - * Optional values: `hostname` - -Add a new static DHCP lease for MAC address `` in virtual network ``. - -`ipaddress` must be a valid IP address in the specified `` IPv4 netblock, and ideally outside of the DHCPv4 range. - -`hostname` specifies a static hostname hint for the lease. - -#### `/api/v1/network//dhcp/` - * Methods: `GET`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about DHCP lease with MAC address `` in virtual network ``. The output is identical to `/api/v1/network//dhcp?limit=` without fuzzy regex matching. - -###### `DELETE` - * Mandatory values: N/A - * Optional values: N/A - -Remove a static DHCP lease for MAC address ` in virtual network ``. - -#### `/api/v1/network//acl` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit`, `direction` - -Return a JSON document containing information about all active NFTables ACLs in virtual network ``. - -If `limit` is specified, return a JSON document containing information about all active NFTables ACLs with descriptions matching `limit` as fuzzy regex. - -If `direction` is specified and is one of `in` or `out`, return a JSON document listing all active NFTables ACLs in the specified direction only. If `direction` is invalid, return a failure. - -###### `POST` - * Mandatory values: `description`, `direction`, `rule` - * Optional values: `order` - -Add a new NFTables ACL with `description` in virtual network ``. - -`direction` must be one of `in` or `out`. - -`rule` must be a valid NFTables rule string. PVC does no special replacements or variables beyond what NFTables itself is capable of. For per-host ACLs, it is usually advisable to use a static DHCP lease as well to control the VM's IP address. - -`order` specifies the order of the rule in the current chain. If not specified, the rule will be placed at the end of the rule chain. - -#### `/api/v1/network//acl/` - * Methods: `GET`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about NFTables ACL with description `` in virtual network ``. The output is identical to `/api/v1/network//acl?limit=` without fuzzy regex matching. - -If `` is not valid, return an empty JSON document. - -###### `DELETE` - * Mandatory values: `direction` - * Optional values: N/A - -Remove an NFTables ACL with description `` in direction `direction` from virtual network ``. - -### Storage (Ceph) endpoints - -These endpoints manage PVC Ceph storage cluster state and operation. This section has the added prefix `/storage`, to allow the future addition of other storage subsystems. - -**NOTE:** Unlike the other API endpoints, Ceph endpoints will wait until the command completes successfully before returning. This is a safety measure to prevent the critical storage subsystem from going out-of-sync with the PVC Zookeeper database; the cluster objects are only created after the storage subsystem commands complete. Because of this, *be careful with HTTP timeouts when running Ceph commands via the API*. 30s or longer may be required for some commands, especially OSD addition or removal. - -#### `/api/v1/storage/ceph` - * Methods: `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about the current Ceph cluster status. The JSON element `ceph_data` contains the raw output of a `ceph status` command. - -#### `/api/v1/storage/ceph/status` - * Methods: `GET` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -This endpoint is an alias for `/api/v1/storage/ceph`. - -#### `/api/v1/storage/ceph/df` - * Methods: `GET` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about the current Ceph cluster utilization. The JSON element `ceph_data` contains the raw output of a `rados df` command. - -#### `/api/v1/storage/ceph/cluster-option` - * Methods: `POST` - -###### `POST` - * Mandatory values: `action`, `option` - * Optional values: N/A - -Perform `action` to a global Ceph OSD `option` on the storage cluster. `action` must be either `set` or `unset`. `option` must be a valid option to the `ceph osd set/unset` commands, e.g. `noout` or `noscrub`. - -#### `/api/v1/storage/ceph/osd` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all Ceph OSDs in the storage cluster. If `limit` is specified, return a JSON document containing information about all Ceph OSDs with names matching `limit` as fuzzy regex. - -###### `POST` - * Mandatory values: `node`, `device`, `weight` - * Optional values: N/A - -Add a new Ceph OSD to PVC node ``. `device` must be a valid block device on the specified ``, e.g. `/dev/sdb`. `weight` must be a valid Ceph OSD weight, usually `1.0` if all OSD disks are the same size. - -#### `/api/v1/storage/ceph/osd/` - * Methods: `GET`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about Ceph OSD with ID `` in the storage cluster. Unlike other similar endpoints, this is **NOT** equivalent to any limit within the list, since that limit is based off names rather than just the ID. - -###### `DELETE` - * Mandatory values: `yes_i_really_mean_it` - * Optional values: N/A - -Remove a Ceph OSD device with ID `` from the storage cluster. - -**NOTE:** This is a command with potentially dangerous unintended consequences that should not be scripted. To acknowledge the danger, the `yes_i_really_mean_it` must be set or the endpoint will return a failure. - -**WARNING:** Removing an OSD without first setting it `out` (and letting it flush) triggers an unclean PG recovery. This could potentially cause data loss if other OSDs were to fail or be removed. OSDs should not normally be removed except in the case of failed OSDs during replacement or during a replacement with a larger disk. For more information please see the Ceph documentation. - -#### `/api/v1/storage/ceph/osd//state` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return the state state of OSD ``. - -###### `POST` - * Mandatory values: `state` - * Optional values: N/A - -Set a Ceph OSD device with ID `` to `state`. `state` must be either `in` or `out`. - -#### `/api/v1/storage/ceph/pool` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all Ceph RBD pools in the storage cluster. If `limit` is specified, return a JSON document containing information about all Ceph RBD pools with names matching `limit` as fuzzy regex. - -###### `POST` - * Mandatory values: `pool`, `pgs` - * Optional values: N/A - -Add a new Ceph RBD pool `` to the storage cluster. `pgs` must be a valid number of Placement Groups for the pool, taking into account the number of OSDs and the replication of the pool (`copies=3`). `256` is a safe and sane number of PGs for 3 nodes and 2 disks per node. This value can be grown later via `ceph` commands as required. - -#### `/api/v1/storage/ceph/pool/` - * Methods: `GET`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about Ceph RBD pool ``. The output is identical to `/api/v1/storage/ceph/pool?limit=` without fuzzy regex matching. - -###### `DELETE` - * Mandatory values: `yes_i_really_mean_it` - * Optional values: N/A - -Remove a Ceph RBD pool `` from the storage cluster. - -**NOTE:** This is a command with potentially dangerous unintended consequences that should not be scripted. To acknowledge the danger, the `yes_i_really_mean_it` must be set or the endpoint will return a failure. - -**WARNING:** Removing an RBD pool will delete all data on that pool, including all Ceph RBD volumes on the pool. Do not run this command lightly and without ensuring the pool is safely removable first. - -#### `/api/v1/storage/ceph/volume` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `pool`, `limit` - -Return a JSON document containing information about all Ceph RBD volumes in the storage cluster. If `pool` is specified, return a JSON document containing information about all Ceph RBD volumes in Ceph RBD pool `pool`. If `limit` is specified, return a JSON document containing information about all Ceph RBD volumes with names matching `limit` as fuzzy regex. - -###### `POST` - * Mandatory values: `volume`, `pool` - * Optional values: `size`, `source_volume` - -Add a new Ceph RBD volume `` to Ceph RBD pool ``. - -If `source_volume` is specified, clone the specified source volume into the new volume; when using this option, `size` is ignored. - -The value for `size` is mandatory if not cloning from a `source_volume`, and must be a valid storage size, in bytes or a single-character metric prefix of bytes, e.g. `1073741824` (1GB), `4096M`, or `20G`. PVC uses multiples of 1024 (MiB, GiB, etc.) consistently. - -#### `/api/v1/storage/ceph/volume//` - * Methods: `GET`, `PUT`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about Ceph RBD volume `` in Ceph RBD pool ``. The output is identical to `/api/v1/storage/ceph/volume?pool=&limit=` without fuzzy regex matching. - -###### `PUT` - * Mandatory values: N/A - * Optional values: `name`, `size` - -Change the configuration of the volume ``. If `name` is specified, rename the volume to the specified name. If `size` is specified, resize the volume to the specified size (see `POST /api/v1/storage/ceph/volume` for restrictions). - -**NOTE:** Only one change operation (either `name` or `size`) may be completed in one operation. - -###### `DELETE` - * Mandatory values: N/A - * Optional values: N/A - -Remove a Ceph RBD volume `` from Ceph RBD pool ``. - -#### `/api/v1/storage/ceph/volume/snapshot` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `pool`, `volume`, `limit` - -Return a JSON document containing information about all Ceph RBD volume snapshots in the storage cluster. If `pool` is specified, return a JSON document containing information about all Ceph RBD volume snapshots in Ceph RBD pool `pool`. If `volume` is specified, return a JSON document containing information about all Ceph RBD volume snapshots of Ceph RBD volume `volume`. If `limit` is specified, return a JSON document containing information about all Ceph RBD volume snapshots with names matching `limit` as fuzzy regex. - -The various limit options can be combined freely, e.g. one can specify a `volume` without `pool`, which would match all snapshots of the named volume(s) regardless of pool, or a `pool` and `limit` without a `volume`, which would match all named snapshots on any volume in `pool`. - -###### `POST` - * Mandatory values: `snapshot`, `volume`, `pool` - * Optional values: N/A - -Add a new Ceph RBD volume snapshot `snapshot` of Ceph RBD volume `volume` on Ceph RBD pool `pool`. - -#### `/api/v1/storage/ceph/volume/snapshot///` - * Methods: `GET`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about Ceph RBD volume snapshot `` of Ceph RBD volume `` in Ceph RBD pool ``. The output is identical to `/api/v1/storage/ceph/volume?pool=&volume=&limit=` without fuzzy regex matching. - -###### `DELETE` - * Mandatory values: N/A - * Optional values: N/A - -Remove a Ceph RBD volume snapshot `` of Ceph RBD volume `` on Ceph RBD pool ``. - -## Provisioner API endpoint documentation - -### General endpoints - -#### `/api/v1/provisioner/template` - * Methods: `GET` - -###### `GET` - * Manadatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all available templates. If `limit` is specified, return a JSON document containing information about any templates with names matching`limit` as a fuzzy regex; `^` or `$` can be used for force exact start/end matches. - -### System Template endpoints - -These endpoints manage PVC system templates. - -#### `/api/v1/provisioner/template/system` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all available system templates. If `limit` is specified, return a JSON document containing information about any system templates with names matching`limit` as a fuzzy regex; `^` or `$` can be used for force exact start/end matches. - -###### `POST` - * Mandatory values: `name`, `vcpus`, `vram`, `serial`, `vnc` - * Optional values: `vnc_bind`, `node_limit`, `node_selector`, `start_with_node` - -Add a new system template `name` with `vcpus` vCPUs, `vram` MB of RAM, and with `serial` and/or `vnc` enabled (`true`) or disabled (`false`). - -If `vnc=true`, the `vnc_bind` option specifies which IP address(es) for VNC to listen on. Common values would include `127.0.0.1` (the default), `0.0.0.0` for all interfaces, or a specific IP such as the cluster upstream floating IP address. - -If `node_limit` is specified and is a valid list of PVC nodes in CSV format, the PVC VM metadata to limit the VM to the specified nodes will be set. - -If `node_selector` is specified, the PVC VM metadata to specify the node selector for the VM will be set. Valid `node_selector` values are: `mem`: the node with the least allocated VM memory; `vcpus`: the node with the least allocated VM vCPUs; `load`: the node with the least current load average; `vms`: the node with the least number of provisioned VMs. - -If `start_with_node` is specified, the PVC VM metadata to specify the autostart-with-node will be set for the first boot. This is most useful if the VM will not be started by default and is set to run on a stopped or flushed node. - -#### `/api/v1/provisioner/template/system/` - * Methods: `GET`, `POST`, `PUT`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about system template ``. The output is identical to `/api/v1/provisioner/template/system?limit=` without fuzzy regex matching. - -###### `POST` - * Mandatory values: `vcpus`, `vram`, `serial`, `vnc` - * Optional values: `vnc_bind`, `node_limit`, `node_selector`, `start_with_node` - -Add a new system template `name` with `vcpus` vCPUs, `vram` MB of RAM, and with `serial` and/or `vnc` enabled (`true`) or disabled (`false`). - -If `vnc=true`, the `vnc_bind` option specifies which IP address(es) for VNC to listen on. Common values would include `127.0.0.1` (the default), `0.0.0.0` for all interfaces, or a specific IP such as the cluster upstream floating IP address. - -If `node_limit` is specified and is a valid list of PVC nodes in CSV format, the PVC VM metadata to limit the VM to the specified nodes will be set. - -If `node_selector` is specified, the PVC VM metadata to specify the node selector for the VM will be set. Valid `node_selector` values are: `mem`: the node with the least allocated VM memory; `vcpus`: the node with the least allocated VM vCPUs; `load`: the node with the least current load average; `vms`: the node with the least number of provisioned VMs. - -If `start_with_node` is specified, the PVC VM metadata to specify the autostart-with-node will be set for the first boot. This is most useful if the VM will not be started by default and is set to run on a stopped or flushed node. - -###### `PUT` - * Mandatory values: N/A - * Optional values: `vcpus`, `vram`, `serial`, `vnc`, `vnc_bind`, `node_limit`, `node_selector`, `start_with_node` - -Modify an existing system template `name` by updating the specified value(s). - -###### `DELETE` - * Mandatory values: N/A - * Optional values: N/A - -Delete the system template `name`. Note that you cannot delete a template which is a member of a profile; it must first be removed from the profile, or the profile deleted. - -### Network Template endpoints - -These endpoints manage PVC network templates. - -#### `/api/v1/provisioner/template/network` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: `limit` - -Return a JSON document containing information about all available network templates. If `limit` is specified, return a JSON document containing information about any network templates with names matching`limit` as a fuzzy regex; `^` or `$` can be used for force exact start/end matches. - -###### `POST` - * Mandatory values: - * Optional values: - -Add a new network template `name`. - -#### `/api/v1/provisioner/template/network/` - * Methods: `GET`, `POST`, `DELETE` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about network template ``. The output is identical to `/api/v1/provisioner/template/network?limit=` without fuzzy regex matching. - -###### `POST` - * Mandatory values: - * Optional values: - -Add a new network template `name`. - -###### `DELETE` - * Mandatory values: N/A - * Optional values: N/A - -Delete the network template `name`. Note that you cannot delete a template which is a member of a profile; it must first be removed from the profile, or the profile deleted. - -#### `/api/v1/provisioner/template/network//net` - * Methods: `GET`, `POST` - -###### `GET` - * Mandatory values: N/A - * Optional values: N/A - -Return a JSON document containing information about network template ``. The output is identical to `/api/v1/provisioner/template/network?limit=` without fuzzy regex matching. - -###### `POST` - * Mandatory values: - * Optional values: - -Add a new network template `name`. - -###### `DELETE` - * Mandatory values: N/A - * Optional values: N/A - -Delete the network template `name`. Note that you cannot delete a template which is a member of a profile; it must first be removed from the profile, or the profile deleted. +## API Endpoint Documentation +The full API endpoint and schema documentation [can be found here](/manuals/swagger.html). diff --git a/docs/manuals/swagger.html b/docs/manuals/swagger.html new file mode 100644 index 00000000..7b7b7ebf --- /dev/null +++ b/docs/manuals/swagger.html @@ -0,0 +1,13 @@ + + + + PVC Client API Documentation + + + + + + + + + diff --git a/docs/manuals/swagger.json b/docs/manuals/swagger.json new file mode 100644 index 00000000..ba67fc02 --- /dev/null +++ b/docs/manuals/swagger.json @@ -0,0 +1,4750 @@ +{ + "definitions": { + "API-Version": { + "properties": { + "message": { + "description": "A text message", + "example": "PVC API version 1", + "type": "string" + } + }, + "type": "object" + }, + "Message": { + "properties": { + "message": { + "description": "A text message", + "type": "string" + } + }, + "type": "object" + }, + "NodeCoordinatorState": { + "properties": { + "coordinator_state": { + "description": "The current coordinator state", + "type": "string" + }, + "name": { + "description": "The name of the node", + "type": "string" + } + }, + "type": "object" + }, + "NodeDaemonState": { + "properties": { + "daemon_state": { + "description": "The current daemon state", + "type": "string" + }, + "name": { + "description": "The name of the node", + "type": "string" + } + }, + "type": "object" + }, + "NodeDomainState": { + "properties": { + "domain_state": { + "description": "The current domain state", + "type": "string" + }, + "name": { + "description": "The name of the node", + "type": "string" + } + }, + "type": "object" + }, + "VMMetadata": { + "properties": { + "name": { + "description": "The name of the VM", + "type": "string" + }, + "node_autostart": { + "description": "Whether to autostart the VM when its node returns to ready domain state", + "type": "string" + }, + "node_limit": { + "description": "The node(s) the VM is permitted to be assigned to", + "items": { + "type": "string" + }, + "type": "array" + }, + "node_selector": { + "description": "The selector used to determine candidate nodes during migration", + "type": "string" + } + }, + "type": "object" + }, + "VMNode": { + "properties": { + "last_node": { + "description": "The last node the VM was assigned to before migrating", + "type": "string" + }, + "name": { + "description": "The name of the VM", + "type": "string" + }, + "node": { + "description": "The node the VM is currently assigned to", + "type": "string" + } + }, + "type": "object" + }, + "VMState": { + "properties": { + "name": { + "description": "The name of the VM", + "type": "string" + }, + "state": { + "description": "The current state of the VM", + "type": "string" + } + }, + "type": "object" + }, + "acl": { + "properties": { + "description": { + "description": "The description of the rule", + "type": "string" + }, + "direction": { + "description": "The direction the rule applies in", + "type": "string" + }, + "order": { + "description": "The order of the rule in the chain", + "type": "integer" + }, + "rule": { + "description": "The NFT-format rule string", + "type": "string" + } + }, + "type": "object" + }, + "all-templates": { + "properties": { + "network-templates": { + "items": { + "$ref": "#/definitions/network-template" + }, + "type": "array" + }, + "storage-templates": { + "items": { + "$ref": "#/definitions/storage-template" + }, + "type": "array" + }, + "system-templates": { + "items": { + "$ref": "#/definitions/system-template" + }, + "type": "array" + }, + "userdata-templates": { + "items": { + "$ref": "#/definitions/userdata-template" + }, + "type": "array" + } + }, + "type": "object" + }, + "lease": { + "properties": { + "hostname": { + "description": "The (short) hostname of the lease", + "type": "string" + }, + "ip4_address": { + "description": "The IPv4 address of the lease", + "type": "string" + }, + "mac_address": { + "description": "The MAC address of the lease", + "type": "string" + }, + "timestamp": { + "description": "The UNIX timestamp of the lease creation", + "type": "integer" + } + }, + "type": "object" + }, + "network": { + "properties": { + "description": { + "description": "The description of the network", + "type": "string" + }, + "domain": { + "description": "The DNS domain of the network (\"managed\" networks only)", + "type": "string" + }, + "ip4": { + "description": "The IPv4 details of the network (\"managed\" networks only)", + "properties": { + "dhcp_end": { + "description": "The IPv4 DHCP pool end address", + "type": "string" + }, + "dhcp_flag": { + "description": "Whether DHCP is enabled", + "type": "boolean" + }, + "dhcp_start": { + "description": "The IPv4 DHCP pool start address", + "type": "string" + }, + "gateway": { + "description": "The IPv4 default gateway address", + "type": "string" + }, + "network": { + "description": "The IPv4 network subnet in CIDR format", + "type": "string" + } + }, + "type": "object" + }, + "ip6": { + "description": "The IPv6 details of the network (\"managed\" networks only)", + "properties": { + "dhcp_flag": { + "description": "Whether DHCPv6 is enabled", + "type": "boolean" + }, + "gateway": { + "description": "The IPv6 default gateway address", + "type": "string" + }, + "network": { + "description": "The IPv6 network subnet in CIDR format", + "type": "string" + } + }, + "type": "object" + }, + "name_servers": { + "description": "The configured DNS nameservers of the network for NS records (\"managed\" networks only)", + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "description": "The type of network", + "enum": [ + "managed", + "bridged" + ], + "type": "string" + }, + "vni": { + "description": "The VNI of the network", + "type": "integer" + } + }, + "type": "object" + }, + "network-template": { + "properties": { + "id": { + "description": "Internal provisioner template ID", + "type": "integer" + }, + "mac_template": { + "description": "MAC address template for VM", + "type": "string" + }, + "name": { + "description": "Template name", + "type": "string" + }, + "networks": { + "items": { + "$ref": "#/definitions/network-template-net" + }, + "type": "array" + } + }, + "type": "object" + }, + "network-template-net": { + "properties": { + "id": { + "description": "Internal provisioner template ID", + "type": "integer" + }, + "network_template": { + "description": "Internal provisioner network template ID", + "type": "integer" + }, + "vni": { + "description": "PVC network VNI", + "type": "integer" + } + }, + "type": "object" + }, + "node": { + "properties": { + "arch": { + "description": "The architecture of the CPU", + "type": "string" + }, + "coordinator_state": { + "description": "The current coordinator state", + "type": "string" + }, + "cpu_count": { + "description": "The number of available CPU cores", + "type": "integer" + }, + "daemon_state": { + "description": "The current daemon state", + "type": "string" + }, + "domain_state": { + "description": "The current domain (VM) state", + "type": "string" + }, + "domains_count": { + "description": "The number of running domains (VMs)", + "type": "integer" + }, + "kernel": { + "desription": "The running kernel version from uname", + "type": "string" + }, + "load": { + "description": "The current 5-minute CPU load", + "format": "float", + "type": "number" + }, + "memory": { + "properties": { + "allocated": { + "description": "The total amount of RAM allocated to domains in MB", + "type": "integer" + }, + "free": { + "description": "The total free RAM on the node in MB", + "type": "integer" + }, + "total": { + "description": "The total amount of node RAM in MB", + "type": "integer" + }, + "used": { + "description": "The total used RAM on the node in MB", + "type": "integer" + } + }, + "type": "object" + }, + "name": { + "description": "The name of the node", + "type": "string" + }, + "os": { + "description": "The current operating system type", + "type": "string" + }, + "running_domains": { + "description": "The list of running domains (VMs) by UUID", + "type": "string" + }, + "vcpu": { + "properties": { + "allocated": { + "description": "The total number of allocated vCPU cores", + "type": "integer" + }, + "total": { + "description": "The total number of real CPU cores available", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "pool": { + "properties": { + "name": { + "description": "The name of the pool", + "type": "string" + }, + "stats": { + "properties": { + "free_bytes": { + "description": "The total free space (in bytes)", + "type": "integer" + }, + "id": { + "description": "The Ceph pool ID", + "type": "integer" + }, + "num_object_clones": { + "description": "The total number of cloned Ceph objects", + "type": "integer" + }, + "num_object_copies": { + "description": "The total number of Ceph objects after replication", + "type": "integer" + }, + "num_objects": { + "description": "The number of Ceph objects before replication", + "type": "integer" + }, + "num_objects_degraded": { + "description": "The total number of degraded Ceph objects", + "type": "integer" + }, + "num_objects_missing_on_primary": { + "description": "The total number of missing-on-primary Ceph objects", + "type": "integer" + }, + "num_objects_unfound": { + "description": "The total number of unfound Ceph objects", + "type": "integer" + }, + "read_bytes": { + "description": "The total read bytes on the pool (pool-lifetime)", + "type": "integer" + }, + "read_ops": { + "description": "The total read operations on the pool (pool-lifetime)", + "type": "integer" + }, + "used_bytes": { + "description": "The total used space (in bytes)", + "type": "integer" + }, + "used_percent": { + "description": "The ratio of used space to free space", + "type": "number" + }, + "write_bytes": { + "description": "The total write bytes on the pool (pool-lifetime)", + "type": "integer" + }, + "write_ops": { + "description": "The total write operations on the pool (pool-lifetime)", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "profile": { + "properties": { + "arguments": { + "items": { + "description": "Script install() function keyword arguments in \"arg=data\" format", + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "Internal provisioner profile ID", + "type": "integer" + }, + "name": { + "description": "Profile name", + "type": "string" + }, + "network_template": { + "description": "Network template name", + "type": "string" + }, + "script": { + "description": "Script name", + "type": "string" + }, + "storage_template": { + "description": "Storage template name", + "type": "string" + }, + "system_template": { + "description": "System template name", + "type": "string" + }, + "userdata_template": { + "description": "Userdata template name", + "type": "string" + } + }, + "type": "object" + }, + "script": { + "properties": { + "id": { + "description": "Internal provisioner script ID", + "type": "integer" + }, + "name": { + "description": "Script name", + "type": "string" + }, + "script": { + "description": "Raw Python script document", + "type": "string" + } + }, + "type": "object" + }, + "snapshot": { + "properties": { + "pool": { + "description": "The name of the pool", + "type": "string" + }, + "snapshot": { + "description": "The name of the snapshot", + "type": "string" + }, + "volume": { + "description": "The name of the volume", + "type": "string" + } + }, + "type": "object" + }, + "storage-template": { + "properties": { + "disks": { + "items": { + "$ref": "#/definitions/storage-template-disk" + }, + "type": "array" + }, + "id": { + "description": "Internal provisioner template ID", + "type": "integer" + }, + "name": { + "description": "Template name", + "type": "string" + } + }, + "type": "object" + }, + "storage-template-disk": { + "properties": { + "disk_id": { + "description": "Disk identifier", + "type": "string" + }, + "disk_size_gb": { + "description": "Disk size in GB", + "type": "string" + }, + "filesystem": { + "description": "Filesystem for disk", + "type": "string" + }, + "filesystem_args": { + "items": { + "description": "Filesystem mkfs arguments", + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "Internal provisioner disk ID", + "type": "integer" + }, + "mountpoint": { + "description": "In-VM mountpoint for disk", + "type": "string" + }, + "pool": { + "description": "Ceph storage pool for disk", + "type": "string" + }, + "storage_template": { + "description": "Internal provisioner storage template ID", + "type": "integer" + } + }, + "type": "object" + }, + "system-template": { + "properties": { + "id": { + "description": "Internal provisioner template ID", + "type": "integer" + }, + "name": { + "description": "Template name", + "type": "string" + }, + "node_autostart": { + "description": "Whether to start VM with node ready state (one-time)", + "type": "boolean" + }, + "node_limit": { + "description": "CSV list of node(s) to limit VM assignment to", + "type": "string" + }, + "node_selector": { + "description": "Selector to use for VM node assignment on migration/move", + "type": "string" + }, + "serial": { + "description": "Whether to enable serial console for VM", + "type": "boolean" + }, + "vcpu_count": { + "description": "vCPU count for VM", + "type": "integer" + }, + "vnc": { + "description": "Whether to enable VNC console for VM", + "type": "boolean" + }, + "vnc_bind": { + "description": "VNC bind address when VNC console is enabled", + "type": "string" + }, + "vram_mb": { + "description": "vRAM size in MB for VM", + "type": "integer" + } + }, + "type": "object" + }, + "userdata-template": { + "properties": { + "id": { + "description": "Internal provisioner template ID", + "type": "integer" + }, + "name": { + "description": "Template name", + "type": "string" + }, + "userdata": { + "description": "Raw userdata configuration document", + "type": "string" + } + }, + "type": "object" + }, + "vm": { + "properties": { + "arch": { + "description": "The architecture of the VM", + "type": "string" + }, + "console": { + "descritpion": "The serial console type of the VM", + "type": "string" + }, + "controllers": { + "description": "The device controllers attached to the VM", + "items": { + "properties": { + "model": { + "description": "The model of the controller", + "type": "string" + }, + "type": { + "description": "The type of the controller", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "description": { + "description": "The description of the VM", + "type": "string" + }, + "disks": { + "description": "The PVC storage volumes attached to the VM", + "items": { + "properties": { + "bus": { + "description": "The virtual bus of the volume in the VM", + "type": "string" + }, + "dev": { + "description": "The device ID of the volume in the VM", + "type": "string" + }, + "name": { + "description": "The full name of the volume in \"pool/volume\" format", + "type": "string" + }, + "type": { + "description": "The type of volume", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "emulator": { + "description": "The binary emulator of the VM", + "type": "string" + }, + "failed_reason": { + "description": "Information about why the VM failed to start", + "type": "string" + }, + "features": { + "description": "The available features of the VM", + "items": { + "type": "string" + }, + "type": "array" + }, + "last_node": { + "description": "The last node the VM was assigned to before migrating", + "type": "string" + }, + "machine": { + "description": "The QEMU machine type of the VM", + "type": "string" + }, + "memory": { + "description": "The assigned RAM of the VM in MB", + "type": "integer" + }, + "migrated": { + "description": "Whether the VM has been migrated, either \"no\" or \"from \"", + "type": "string" + }, + "name": { + "description": "The name of the VM", + "type": "string" + }, + "networks": { + "description": "The PVC networks attached to the VM", + "items": { + "properties": { + "mac": { + "description": "The MAC address of the VM network interface", + "type": "string" + }, + "model": { + "description": "The virtual network device model", + "type": "string" + }, + "source": { + "description": "The parent network bridge on the node", + "type": "string" + }, + "type": { + "description": "The PVC network type", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "node": { + "description": "The node the VM is currently assigned to", + "type": "string" + }, + "node_autostart": { + "description": "Whether to autostart the VM when its node returns to ready domain state", + "type": "boolean" + }, + "node_limit": { + "description": "The node(s) the VM is permitted to be assigned to", + "items": { + "type": "string" + }, + "type": "array" + }, + "node_selector": { + "description": "The selector used to determine candidate nodes during migration", + "type": "string" + }, + "profile": { + "description": "The provisioner profile used to create the VM", + "type": "string" + }, + "state": { + "description": "The current state of the VM", + "type": "string" + }, + "type": { + "description": "The type of the VM", + "type": "string" + }, + "uuid": { + "description": "The UUID of the VM", + "type": "string" + }, + "vcpu": { + "description": "The assigned vCPUs of the VM", + "type": "integer" + }, + "vcpu_topology": { + "description": "The topology of the assigned vCPUs in Sockets/Cores/Threads format", + "type": "string" + }, + "xml": { + "description": "The raw Libvirt XML definition of the VM", + "type": "string" + } + }, + "type": "object" + }, + "volume": { + "properties": { + "name": { + "description": "The name of the volume", + "type": "string" + }, + "pool": { + "description": "The name of the pool containing the volume", + "type": "string" + }, + "stats": { + "properties": { + "access_timestamp": { + "description": "The volume access timestamp", + "type": "string" + }, + "block_name_prefix": { + "description": "The Ceph-internal block name prefix", + "type": "string" + }, + "create_timestamp": { + "description": "The volume creation timestamp", + "type": "string" + }, + "features": { + "items": { + "description": "The Ceph RBD feature", + "type": "string" + }, + "type": "array" + }, + "flags": { + "items": { + "description": "The Ceph RBD volume flags", + "type": "string" + }, + "type": "array" + }, + "format": { + "description": "The Ceph RBD volume format", + "type": "integer" + }, + "id": { + "description": "The Ceph volume ID", + "type": "string" + }, + "modify_timestamp": { + "description": "The volume modification timestamp", + "type": "string" + }, + "name": { + "description": "The name of the volume", + "type": "string" + }, + "object_size": { + "description": "The size of each object in bytes", + "type": "integer" + }, + "objects": { + "description": "The number of Ceph objects making up the volume", + "type": "integer" + }, + "op_features": { + "items": { + "description": "The Ceph RBD operational features", + "type": "string" + }, + "type": "array" + }, + "order": { + "description": "The Ceph volume order ID", + "type": "integer" + }, + "size": { + "description": "The size of the volume (human-readable values)", + "type": "string" + }, + "snapshot_count": { + "description": "The number of snapshots of the volume", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "info": { + "title": "PVC Client and Provisioner API", + "version": "1.0" + }, + "paths": { + "/api/v1/": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/API-Version" + } + } + }, + "summary": "Return the PVC API version string", + "tags": [ + "root" + ] + } + }, + "/api/v1/initialize": { + "post": { + "description": "Note: Normally used only once during cluster bootstrap; checks for the existence of the \"/primary_node\" key before proceeding", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "302": { + "description": "Cluster already initialized" + } + }, + "summary": "Initialize a new PVC cluster", + "tags": [ + "root" + ] + } + }, + "/api/v1/login": { + "post": { + "description": "", + "parameters": [ + { + "in": "query", + "name": "token", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "302": { + "description": "Authentication disabled" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Log in to the PVC API with an authentication key", + "tags": [ + "root" + ] + } + }, + "/api/v1/logout": { + "post": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "302": { + "description": "Authentication disabled" + } + }, + "summary": "Log out of an existing PVC API session", + "tags": [ + "root" + ] + } + }, + "/api/v1/network": { + "get": { + "description": "", + "parameters": [ + { + "description": "A VNI or description search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/network" + }, + "type": "array" + } + } + }, + "summary": "Return a list of networks in the cluster", + "tags": [ + "network" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "The VNI of the network", + "in": "query", + "name": "vni", + "required": true, + "type": "integer" + }, + { + "description": "The description of the network", + "in": "query", + "name": "description", + "required": true, + "type": "string" + }, + { + "description": "The type of network", + "enum": [ + "managed", + "bridged" + ], + "in": "query", + "name": "nettype", + "required": true, + "type": "string" + }, + { + "description": "The DNS domain of the network (\"managed\" networks only)", + "in": "query", + "name": "domain", + "type": "string" + }, + { + "description": "The CSV list of DNS nameservers for network NS records (\"managed\" networks only)", + "in": "query", + "name": "name_servers", + "type": "string" + }, + { + "description": "The IPv4 network subnet of the network in CIDR format; IPv4 disabled if unspecified (\"managed\" networks only)", + "in": "query", + "name": "ip4_network", + "type": "string" + }, + { + "description": "The IPv4 default gateway address of the network (\"managed\" networks only)", + "in": "query", + "name": "ip4_gateway", + "type": "string" + }, + { + "description": "Whether to enable DHCPv4 for the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4", + "type": "boolean" + }, + { + "description": "The DHCPv4 pool start address of the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4_start", + "type": "string" + }, + { + "description": "The DHCPv4 pool end address of the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4_end", + "type": "string" + }, + { + "description": "The IPv6 network subnet of the network in CIDR format; IPv6 disabled if unspecified; DHCPv6 is always used in IPv6 managed networks (\"managed\" networks only)", + "in": "query", + "name": "ip6_network", + "type": "string" + }, + { + "description": "The IPv6 default gateway address of the network (\"managed\" networks only)", + "in": "query", + "name": "ip6_gateway", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new network", + "tags": [ + "network" + ] + } + }, + "/api/v1/network/{vni}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove network {vni}", + "tags": [ + "network" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/network" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about network {vni}", + "tags": [ + "network" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "The description of the network", + "in": "query", + "name": "description", + "required": true, + "type": "string" + }, + { + "description": "The type of network", + "enum": [ + "managed", + "bridged" + ], + "in": "query", + "name": "nettype", + "required": true, + "type": "string" + }, + { + "description": "The DNS domain of the network (\"managed\" networks only)", + "in": "query", + "name": "domain", + "type": "string" + }, + { + "description": "The CSV list of DNS nameservers for network NS records (\"managed\" networks only)", + "in": "query", + "name": "name_servers", + "type": "string" + }, + { + "description": "The IPv4 network subnet of the network in CIDR format; IPv4 disabled if unspecified (\"managed\" networks only)", + "in": "query", + "name": "ip4_network", + "type": "string" + }, + { + "description": "The IPv4 default gateway address of the network (\"managed\" networks only)", + "in": "query", + "name": "ip4_gateway", + "type": "string" + }, + { + "description": "Whether to enable DHCPv4 for the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4", + "type": "boolean" + }, + { + "description": "The DHCPv4 pool start address of the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4_start", + "type": "string" + }, + { + "description": "The DHCPv4 pool end address of the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4_end", + "type": "string" + }, + { + "description": "The IPv6 network subnet of the network in CIDR format; IPv6 disabled if unspecified; DHCPv6 is always used in IPv6 managed networks (\"managed\" networks only)", + "in": "query", + "name": "ip6_network", + "type": "string" + }, + { + "description": "The IPv6 default gateway address of the network (\"managed\" networks only)", + "in": "query", + "name": "ip6_gateway", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new network {vni}", + "tags": [ + "network" + ] + }, + "put": { + "description": "Note: A network's type cannot be changed; the network must be removed and recreated as the new type", + "parameters": [ + { + "description": "The description of the network", + "in": "query", + "name": "description", + "type": "string" + }, + { + "description": "The DNS domain of the network (\"managed\" networks only)", + "in": "query", + "name": "domain", + "type": "string" + }, + { + "description": "The CSV list of DNS nameservers for network NS records (\"managed\" networks only)", + "in": "query", + "name": "name_servers", + "type": "string" + }, + { + "description": "The IPv4 network subnet of the network in CIDR format; IPv4 disabled if unspecified (\"managed\" networks only)", + "in": "query", + "name": "ip4_network", + "type": "string" + }, + { + "description": "The IPv4 default gateway address of the network (\"managed\" networks only)", + "in": "query", + "name": "ip4_gateway", + "type": "string" + }, + { + "description": "Whether to enable DHCPv4 for the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4", + "type": "boolean" + }, + { + "description": "The DHCPv4 pool start address of the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4_start", + "type": "string" + }, + { + "description": "The DHCPv4 pool end address of the network (\"managed\" networks only)", + "in": "query", + "name": "dhcp4_end", + "type": "string" + }, + { + "description": "The IPv6 network subnet of the network in CIDR format; IPv6 disabled if unspecified; DHCPv6 is always used in IPv6 managed networks (\"managed\" networks only)", + "in": "query", + "name": "ip6_network", + "type": "string" + }, + { + "description": "The IPv6 default gateway address of the network (\"managed\" networks only)", + "in": "query", + "name": "ip6_gateway", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Update details of network {vni}", + "tags": [ + "network" + ] + } + }, + "/api/v1/network/{vni}/acl": { + "get": { + "description": "", + "parameters": [ + { + "description": "A description search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + }, + { + "description": "The direction of rules to display; both directions shown if unspecified", + "in": "query", + "name": "direction", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/acl" + }, + "type": "array" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return a list of ACLs in network {vni}", + "tags": [ + "network" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "A whitespace-free description/name for the ACL", + "in": "query", + "name": "description", + "required": true, + "type": "string" + }, + { + "description": "The direction of the ACL; defaults to \"in\" if unspecified", + "enum": [ + "in", + "out" + ], + "in": "query", + "name": "direction", + "required": false, + "type": "string" + }, + { + "description": "The order of the ACL in the chain; defaults to the end", + "in": "query", + "name": "order", + "type": "integer" + }, + { + "description": "The raw NFT firewall rule string", + "in": "query", + "name": "rule", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new ACL in network {vni}", + "tags": [ + "network" + ] + } + }, + "/api/v1/network/{vni}/acl/{description}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Delete ACL {description} in network {vni}", + "tags": [ + "network" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/acl" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about ACL {description} in network {vni}", + "tags": [ + "network" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "The direction of the ACL; defaults to \"in\" if unspecified", + "enum": [ + "in", + "out" + ], + "in": "query", + "name": "direction", + "required": false, + "type": "string" + }, + { + "description": "The order of the ACL in the chain; defaults to the end", + "in": "query", + "name": "order", + "type": "integer" + }, + { + "description": "The raw NFT firewall rule string", + "in": "query", + "name": "rule", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new ACL {description} in network {vni}", + "tags": [ + "network" + ] + } + }, + "/api/v1/network/{vni}/lease": { + "get": { + "description": "", + "parameters": [ + { + "description": "A MAC address search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + }, + { + "default": false, + "description": "Whether to show only static leases", + "in": "query", + "name": "static", + "required": false, + "type": "boolean" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/lease" + }, + "type": "array" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return a list of DHCP leases in network {vni}", + "tags": [ + "network" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "A MAC address for the lease", + "in": "query", + "name": "macaddress", + "required": false, + "type": "string" + }, + { + "description": "An IPv4 address for the lease", + "in": "query", + "name": "ipaddress", + "required": false, + "type": "string" + }, + { + "description": "An optional hostname for the lease", + "in": "query", + "name": "hostname", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new static DHCP lease in network {vni}", + "tags": [ + "network" + ] + } + }, + "/api/v1/network/{vni}/lease/{mac}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Delete static DHCP lease {mac}", + "tags": [ + "network" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/lease" + }, + "type": "array" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about DHCP lease {mac} in network {vni}", + "tags": [ + "network" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "A MAC address for the lease", + "in": "query", + "name": "macaddress", + "required": false, + "type": "string" + }, + { + "description": "An IPv4 address for the lease", + "in": "query", + "name": "ipaddress", + "required": false, + "type": "string" + }, + { + "description": "An optional hostname for the lease", + "in": "query", + "name": "hostname", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new static DHCP lease {mac} in network {vni}", + "tags": [ + "network" + ] + } + }, + "/api/v1/node": { + "get": { + "description": "", + "parameters": [ + { + "description": "A search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/node" + }, + "type": "array" + } + } + }, + "summary": "Return a list of nodes in the cluster", + "tags": [ + "node" + ] + } + }, + "/api/v1/node/{node}": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/node" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about {node}", + "tags": [ + "node" + ] + } + }, + "/api/v1/node/{node}/coordinator-state": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NodeCoordinatorState" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return the coordinator state of {node}", + "tags": [ + "node" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "The new coordinator state of the node", + "enum": [ + "primary", + "secondary" + ], + "in": "query", + "name": "action", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Set the coordinator state of {node}", + "tags": [ + "node" + ] + } + }, + "/api/v1/node/{node}/daemon-state": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NodeDaemonState" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return the daemon state of {node}", + "tags": [ + "node" + ] + } + }, + "/api/v1/node/{node}/domain-state": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NodeDomainState" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return the domain state of {node}", + "tags": [ + "node" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "The new domain state of the node", + "enum": [ + "flush", + "ready" + ], + "in": "query", + "name": "action", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Set the domain state of {node}", + "tags": [ + "node" + ] + } + }, + "/api/v1/provisioner/create": { + "post": { + "description": "Note: Starts a background job in the pvc-provisioner-worker Celery worker while returning a task ID; the task ID can be used to query the \"GET /provisioner/status/\" endpoint for the job status", + "parameters": [ + { + "description": "Virtual machine name", + "in": "query", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Profile name", + "in": "query", + "name": "profile", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "properties": { + "task_id": { + "description": "Task ID for the provisioner Celery worker", + "type": "string" + } + }, + "type": "object" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new virtual machine", + "tags": [ + "provisioner" + ] + } + }, + "/api/v1/provisioner/profile": { + "get": { + "description": "", + "parameters": [ + { + "description": "A profile name search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/profile" + }, + "type": "list" + } + } + }, + "summary": "Return a list of profiles", + "tags": [ + "provisioner" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Profile name", + "in": "query", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Script name", + "in": "query", + "name": "script", + "required": true, + "type": "string" + }, + { + "description": "System template name", + "in": "query", + "name": "system_template", + "required": true, + "type": "string" + }, + { + "description": "Network template name", + "in": "query", + "name": "network_template", + "required": true, + "type": "string" + }, + { + "description": "Storage template name", + "in": "query", + "name": "storage_template", + "required": true, + "type": "string" + }, + { + "description": "Userdata template name", + "in": "query", + "name": "userdata_template", + "required": true, + "type": "string" + }, + { + "description": "Script install() function keywork argument in \"arg=data\" format; may be specified multiple times to add multiple arguments", + "in": "query", + "name": "arg", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new profile", + "tags": [ + "provisioner" + ] + } + }, + "/api/v1/provisioner/profile/{profile}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove profile {profile}", + "tags": [ + "provisioner" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/profile" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about profile {profile}", + "tags": [ + "provisioner" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Script name", + "in": "query", + "name": "script", + "required": true, + "type": "string" + }, + { + "description": "System template name", + "in": "query", + "name": "system_template", + "required": true, + "type": "string" + }, + { + "description": "Network template name", + "in": "query", + "name": "network_template", + "required": true, + "type": "string" + }, + { + "description": "Storage template name", + "in": "query", + "name": "storage_template", + "required": true, + "type": "string" + }, + { + "description": "Userdata template name", + "in": "query", + "name": "userdata_template", + "required": true, + "type": "string" + }, + { + "description": "Script install() function keywork argument in \"arg=data\" format; may be specified multiple times to add multiple arguments", + "in": "query", + "name": "arg", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new profile {profile}", + "tags": [ + "provisioner" + ] + } + }, + "/api/v1/provisioner/script": { + "get": { + "description": "", + "parameters": [ + { + "description": "A script name search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/script" + }, + "type": "list" + } + } + }, + "summary": "Return a list of scripts", + "tags": [ + "provisioner" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Script name", + "in": "query", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Raw Python script document", + "in": "query", + "name": "data", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new script", + "tags": [ + "provisioner" + ] + } + }, + "/api/v1/provisioner/script/{script}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove script {script}", + "tags": [ + "provisioner" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/script" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about script {script}", + "tags": [ + "provisioner" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Raw Python script document", + "in": "query", + "name": "data", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new script {script}", + "tags": [ + "provisioner" + ] + }, + "put": { + "description": "", + "parameters": [ + { + "description": "Raw Python script document", + "in": "query", + "name": "data", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Update script {script}", + "tags": [ + "provisioner" + ] + } + }, + "/api/v1/provisioner/status/{task_id}": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "properties": { + "current": { + "description": "Current steps completed", + "type": "integer" + }, + "state": { + "description": "Current job state", + "type": "string" + }, + "status": { + "description": "Status details about job", + "type": "string" + }, + "total": { + "description": "Total number of steps", + "type": "integer" + } + }, + "type": "object" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "View status of a provisioner Celery worker job", + "tags": [ + "provisioner" + ] + } + }, + "/api/v1/provisioner/template": { + "get": { + "description": "", + "parameters": [ + { + "description": "A template name search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/all-templates" + } + } + }, + "summary": "Return a list of all templates", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/network": { + "get": { + "description": "", + "parameters": [ + { + "description": "A template name search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/network-template" + }, + "type": "list" + } + } + }, + "summary": "Return a list of network templates", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Template name", + "in": "query", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "MAC address template", + "in": "query", + "name": "mac_template", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new network template", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/network/{template}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove network template {template}", + "tags": [ + "provisioner / template" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/network-template" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about network template {template}", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "MAC address template", + "in": "query", + "name": "mac_template", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new network template {template}", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/network/{template}/net": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/network-template-net" + }, + "type": "list" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return a list of networks in network template {template}", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "PVC network VNI", + "in": "query", + "name": "vni", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new network in network template {template}", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/network/{template}/net/{vni}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove network {vni} from network template {template}", + "tags": [ + "provisioner / template" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/network-template-net" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about network {vni} in network template {template}", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new network {vni} in network template {template}", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/storage": { + "get": { + "description": "", + "parameters": [ + { + "description": "A template name search limit; fuzzy by default, use ^/$ to force exact matches", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/storage-template" + }, + "type": "list" + } + } + }, + "summary": "Return a list of storage templates", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Template name", + "in": "query", + "name": "name", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new storage template", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/storage/{template}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove storage template {template}", + "tags": [ + "provisioner / template" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/storage-template" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about storage template {template}", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new storage template {template}", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/storage/{template}/disk": { + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/storage-template-disk" + }, + "type": "list" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return a list of disks in network template {template}", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "", + "parameters": [ + { + "description": "Disk identifier in \"sdX\"/\"vdX\" format (e.g. \"sda\", \"vdb\", etc.)", + "in": "query", + "name": "disk_id", + "required": true, + "type": "string" + }, + { + "description": "ceph storage pool for disk", + "in": "query", + "name": "pool", + "required": true, + "type": "string" + }, + { + "description": "Disk size in GB", + "in": "query", + "name": "disk_size", + "required": true, + "type": "integer" + }, + { + "description": "Filesystem for disk", + "in": "query", + "name": "filesystem", + "required": false, + "type": "string" + }, + { + "description": "Filesystem mkfs argument in \"-X=foo\" format; may be specified multiple times to add multiple arguments", + "in": "query", + "name": "filesystem_arg", + "required": false, + "type": "string" + }, + { + "description": "In-VM mountpoint for disk", + "in": "query", + "name": "mountpoint", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Create a new disk in storage template {template}", + "tags": [ + "provisioner / template" + ] + } + }, + "/api/v1/provisioner/template/storage/{template}/disk/{disk_id}": { + "delete": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Message" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Remove disk {disk_id} from storage template {template}", + "tags": [ + "provisioner / template" + ] + }, + "get": { + "description": "", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/storage-template-disk" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return information about disk {disk_id} in storage template {template}", + "tags": [ + "provisioner / template" + ] + }, + "post": { + "description": "Alternative to \"POST /provisioner/template/storage/