REST API: Provisioners

REST Overview | Tenants | Provisioners | Providers | Hardware Types | Image Types | Services | Cluster Template | Importing & Exporting | Clusters | Plugins | Metrics

Using the Superadmin REST API, you can get information about provisioners in the system.

Get a Provisioner

The superadmin is able to get a specific provisioner by its id. The provisioner contains the host and port it is running on, capacity information, and the number of workers assigned and running for each tenant for the provisioner.

To get a provisioner, make a GET HTTP request to URI:

/provisioners/{id}

HTTP Responses

Status Code Description
200 (OK) Successful
404 (NOT FOUND) Provisioner for the given id not found

Example

$ curl -X GET
       -H 'Coopr-UserID:admin'
       -H 'Coopr-TenantID:superadmin'
       -H 'Coopr-ApiKey:<apikey>'
       http://<server>:<port>/<version>/provisioners/p1
$ {
      "id": "p1",
      "host": "host1",
      "port": 58025,
      "capacityTotal": 10,
      "capacityFree": 2,
      "assignments": {
          "tenantX": 5,
          "tenantY": 2,
          "tenantZ": 1
      },
      "usage": {
          "tenantY": 2,
          "tenantZ": 1
      }
  }

List All Provisioners

The superadmin is able to get the list of all provisioners registered with the server. Each provisioner contains the host and port they are running on, capacity information, and the number of workers assigned and running for each tenant for the provisioner.

To list all the provisioners, make a GET HTTP request to URI:

/provisioners

HTTP Responses

Status Code Description
200 (OK) Successful
400 (BAD REQUEST) If the resource uri is specified incorrectly.

Example

$ curl -X GET
       -H 'Coopr-UserID:admin'
       -H 'Coopr-TenantID:superadmin'
       -H 'Coopr-ApiKey:<apikey>'
       http://<server>:<port>/<version>/provisioners
$ [
      {
          "id": "p1",
          "host": "host1",
          "port": 58025,
          "capacityTotal": 10,
          "capacityFree": 2,
          "assignments": {
              "tenantX": 5,
              "tenantY": 2,
              "tenantZ": 1
          },
          "usage": {
              "tenantY": 2,
              "tenantZ": 1
          }
      },
      {
          "id": "p2",
          "host": "host2",
          "port": 58025,
          "capacityTotal": 10,
          "capacityFree": 2,
          "assignments": {
              "tenantX": 5,
              "tenantY": 3
          },
          "usage": {
              "tenantX": 5,
              "tenantY": 3,
          }
      }
   ]