Bastion API for Clusters

Bastion API documentation for clusters

Clusters

GET /bastion/clusters

Get the list of clusters

Response JSON Object:
 
  • [] (object) –
  • [].id (string) – The cluster ID.
  • [].instanceID (string) – The Terraform instance ID.
  • [].source (string) – The Terraform source location.
  • [].static.isStatic (boolean) – If the cluster is static or not
  • [].static.output[key] (undefined) –
  • [].category (string) – The cluster category.

Example response:

[
  {
    "id": "myCluster",
    "instanceID": "myCluster",
    "category": "cluster",
    "static": {
      "isStatic": true,
      "output": {
        "server_public_ips": {
          "type": "list",
          "value": [
            "127.0.0.1"
          ]
        }
      }
    }
  }
]
GET /bastion/cluster/{clusterID}

Get a cluster

Parameters:
  • clusterID – The cluster ID
Response JSON Object:
 
  • id (string) – The cluster ID.
  • instanceID (string) – The Terraform instance ID.
  • source (string) – The Terraform source location.
  • static.isStatic (boolean) – If the cluster is static or not
  • static.output[key] (undefined) –
  • category (string) – The cluster category.

Example response:

{
  "id": "myCluster",
  "instanceID": "myCluster",
  "category": "cluster",
  "static": {
    "isStatic": true,
    "output": {
      "server_public_ips": {
        "type": "list",
        "value": [
          "127.0.0.1"
        ]
      }
    }
  }
}
POST /bastion/cluster/{clusterID}

Create a cluster. This operation will create a terraform instance.

Parameters:
  • clusterID – The cluster ID
Query Parameters:
 
  • fromCluster – The cluster ID you want this new cluster to be cloned from.
Request JSON Object:
 
  • id (string) – The backend ID.
  • variables[key] (string) –
  • category (string) – The cluster category.
  • static.isStatic (boolean) – If the cluster is static or not
  • static.output[key] (undefined) –

Example query:

{
  "id": "",
  "variables": {},
  "category": "",
  "static": {
    "isStatic": true,
    "output": {
      "server_public_ips": {
        "type": "list",
        "value": [
          "127.0.0.1"
        ]
      }
    }
  }
}
DELETE /bastion/cluster/{clusterID}

Delete a cluster. This operation will be rejected if the terraform instance is not destroyed

Parameters:
  • clusterID – The cluster ID
Query Parameters:
 
  • force – Force the delete operation

Images

GET /bastion/cluster/{clusterID}/images

Get the images

Parameters:
  • clusterID – The cluster ID
Response JSON Object:
 
  • [key].id (string) –
  • [key].tag (string) –
  • [key].archfmt (string) –
  • [key].url (string) –
  • [key].dirty (boolean) –

Example response:

{
  "itemA": {
    "id": "",
    "tag": "",
    "archfmt": "",
    "url": "",
    "dirty": false
  }
}
POST /bastion/cluster/{clusterID}/images

Set the images

Parameters:
  • clusterID – The cluster ID
Request JSON Object:
 
  • [key].id (string) –
  • [key].tag (string) –
  • [key].archfmt (string) –
  • [key].url (string) –
  • [key].dirty (boolean) –

Example query:

{
  "itemA": {
    "id": "",
    "tag": "",
    "archfmt": "",
    "url": "",
    "dirty": false
  }
}
DELETE /bastion/cluster/{clusterID}/images

Delete all images

Parameters:
  • clusterID – The cluster ID
DELETE /bastion/cluster/{clusterID}/image/{imageID}

Delete an image

Parameters:
  • clusterID – The cluster ID
  • imageID – The image ID

Setup Jobs

A setup job will be started on the cluster when doing a POST /bastion/cluster/{clusterID}/setup. This is the case for the Hashi-UI job.

GET /bastion/cluster/{clusterID}/setup_jobs

Get the setup jobs.

Parameters:
  • clusterID – The cluster ID
Response JSON Object:
 
  • [key].id (string) – The unique ID of the setup job.
  • [key].template (string) – The template used to create the job.

Example response:

{
  "itemA": {
    "id": "",
    "template": ""
  }
}
POST /bastion/cluster/{clusterID}/setup_jobs

Set the setup jobs

Parameters:
  • clusterID – The cluster ID
Request JSON Object:
 
  • [key].id (string) – The unique ID of the setup job.
  • [key].template (string) – The template used to create the job.

Example query:

{
  "itemA": {
    "id": "",
    "template": ""
  }
}
DELETE /bastion/cluster/{clusterID}/setup_jobs

Delete all setup jobs

Parameters:
  • clusterID – The cluster ID

Setup

POST /bastion/cluster/{clusterID}/setup

Start the setup jobs

Parameters:
  • clusterID – The cluster ID
POST /bastion/cluster/{clusterID}/clean

Stop the setup jobs and clean consul config

Parameters:
  • clusterID – The cluster ID

Services

GET /bastion/cluster/{clusterID}/services/{service}

Get service addresses

Parameters:
  • clusterID – The cluster ID
  • service – The service ID
Response JSON Object:
 
  • [] (string) –

Example response:

[
  "[::1]:20222"
]