Skip to content

Environment management

MarilizaC edited this page Jun 26, 2018 · 10 revisions

Multiple environments can be erected, destroyed and modified on a peer

REST API

  1. Authenticate: POST /login ( x-www-form-urlencoded params)

    username and password

  2. Create environment: POST /rest/v1/environments

    Form parameter topology:

    {
      "name": "my-awesome-environment",
      "sshKey": "place-your-ssh-key-here",
      "nodes": [
          {
            "hostname": "my-awesome-container",
            "quota": {
            "containerSize": "TINY"
          },
            "templateId": "place-template-id-here",
            "resourceHostId": "place-rh-id-here",
            "peerId": "place-peer-id-here" 
          }
       ]
    }
    

    simplified version for local peer only (local peer and management host are used by default, template is looked up by name among verified templates only, container size by default is TINY):

    {
      "name": "my-awesome-environment",
      "nodes": [
          {
            "hostname": "my-awesome-container",
            "templateName": "ubuntu16"
          }
       ]
    }
    
  3. Modify environment by adding 1 container to existing environment:
    PUT /rest/v1/environments/{environment-id}

    Form parameter topology:

    {
      "nodes": [
          {
            "hostname": "my-awesome-container",
            "templateName": "ubuntu16"
          }
       ]
    }
    
  4. List environments: GET /rest/v1/environments/

  5. Destroy environment: DELETE /rest/v1/environments/{environment-id}

  6. Destroy container: DELETE /rest/v1/environments/containers/{container-id}

Clone this wiki locally