Bastion API for Backends

Bastion API documentation for backends

Backends

GET /backends

Get the list of backends

Response JSON Object
  • [key].id (string) – The backend ID.

  • [key].type (string) – The backend type.

  • [key].config[key].id (string) – The variable ID.

  • [key].config[key].editable (boolean) – If the variable is editable of not.

  • [key].config[key].asArgument (boolean) – If the variable is passed as argument to Terraform or in a configuration file.

  • [key].config[key].protected (boolean) – If the variable is shown as a password in the GUI.

  • [key].config[key].value (string) – The variable value.

Example response:

{
  "default": {
    "id": "default",
    "type": "consul",
    "config": {
      "address": {
        "id": "address",
        "editable": false,
        "asArgument": false,
        "protected": false,
        "value": "127.0.0.1:8500"
      },
      "path": {
        "id": "path",
        "editable": false,
        "asArgument": false,
        "protected": false,
        "value": "bastion/terraform/states/{{.clusterID}}/{{.clusterUUID}}/tfstate"
      }
    }
  }
}
GET /backend/{backendID}

Get a backend

Parameters
  • backendID – The backend ID

Response JSON Object
  • id (string) – The backend ID.

  • type (string) – The backend type.

  • config[key].id (string) – The variable ID.

  • config[key].editable (boolean) – If the variable is editable of not.

  • config[key].asArgument (boolean) – If the variable is passed as argument to Terraform or in a configuration file.

  • config[key].protected (boolean) – If the variable is shown as a password in the GUI.

  • config[key].value (string) – The variable value.

Example response:

{
  "id": "default",
  "type": "consul",
  "config": {
    "address": {
      "id": "address",
      "editable": false,
      "asArgument": false,
      "protected": false,
      "value": "127.0.0.1:8500"
    },
    "path": {
      "id": "path",
      "editable": false,
      "asArgument": false,
      "protected": false,
      "value": "bastion/terraform/states/{{.clusterID}}/{{.clusterUUID}}/tfstate"
    }
  }
}
POST /backend/{backendID}

Create a backend.

Parameters
  • backendID – The backend ID

Request JSON Object
  • id (string) – The backend ID.

  • type (string) – The backend type.

  • config[key].id (string) – The variable ID.

  • config[key].editable (boolean) – If the variable is editable of not.

  • config[key].asArgument (boolean) – If the variable is passed as argument to Terraform or in a configuration file.

  • config[key].protected (boolean) – If the variable is shown as a password in the GUI.

  • config[key].value (string) – The variable value.

Example query:

{
  "id": "default",
  "type": "consul",
  "config": {
    "address": {
      "id": "address",
      "editable": false,
      "asArgument": false,
      "protected": false,
      "value": "127.0.0.1:8500"
    },
    "path": {
      "id": "path",
      "editable": false,
      "asArgument": false,
      "protected": false,
      "value": "bastion/terraform/states/{{.clusterID}}/{{.clusterUUID}}/tfstate"
    }
  }
}
PUT /backend/{backendID}

Update a backend.

Parameters
  • backendID – The backend ID

Request JSON Object
  • id (string) – The backend ID.

  • type (string) – The backend type.

  • config[key].id (string) – The variable ID.

  • config[key].editable (boolean) – If the variable is editable of not.

  • config[key].asArgument (boolean) – If the variable is passed as argument to Terraform or in a configuration file.

  • config[key].protected (boolean) – If the variable is shown as a password in the GUI.

  • config[key].value (string) – The variable value.

Example query:

{
  "id": "default",
  "type": "consul",
  "config": {
    "address": {
      "id": "address",
      "editable": false,
      "asArgument": false,
      "protected": false,
      "value": "127.0.0.1:8500"
    },
    "path": {
      "id": "path",
      "editable": false,
      "asArgument": false,
      "protected": false,
      "value": "bastion/terraform/states/{{.clusterID}}/{{.clusterUUID}}/tfstate"
    }
  }
}
DELETE /backend/{backendID}

Delete a backend

Parameters
  • backendID – The backend ID