Modules

GET /terraform/repositories

Get the list of terraform repositories.

Response JSON Object:
 

Example response:

{
  "repositories": {}
}
PUT /terraform/repositories

Update all the terraform repositories.

GET /terraform/repository/{repositoryID}

Get the body of a terraform repository

Parameters:
  • repositoryID – The name of a terraform repository. Must be a valid folder name and all lowercase.
Request JSON Object:
 
Response JSON Object:
 

Example query:

{}

Example response:

{
  "repository": {}
}
POST /terraform/repository/{repositoryID}

Set the URL for terraform repository and update it.

Parameters:
  • repositoryID – The name of a terraform repository. Must be a valid folder name and all lowercase.
Request JSON Object:
 
Response JSON Object:
 

Example query:

{}

Example response:

{
  "repository": {}
}
PUT /terraform/repository/{repositoryID}

If a body is given, update the definition of the repository. In all case, update the repository.

Parameters:
  • repositoryID – The name of a terraform repository. Must be a valid folder name and all lowercase.
Request JSON Object:
 
Response JSON Object:
 

Example query:

{}

Example response:

{
  "repository": {}
}
DELETE /terraform/repository/{repositoryID}

Remove a terraform repository

Parameters:
  • repositoryID – The name of a terraform repository. Must be a valid folder name and all lowercase.
Response JSON Object:
 

Example response:

{
  "repository": {}
}
GET /terraform/modules

Get the list of modules available. Only valid modules are return.

Response JSON Object:
 
  • modules[] (object) – A list of Terraform modules.
  • modules[].repository (string) – The Terraform repository containing this module.
  • modules[].path (string) – The relative path from the bastion root modules of this module.
  • modules[].variable[key].type (string) – The type of the variable.
  • modules[].variable[key].description (string) – A description of the variable.
  • modules[].variable[key].default – A default value for the variable.. Type can be any of string,array,object,null.
  • modules[].output[key].value – The value of the output.. Type can be any of string,array,object,null.
  • modules[].output[key].description (string) – A description of the output
  • modules[].output[key].sensitive (boolean) – If the output value is sensitive
  • modules[].output[key].depends_on[] (string) – Explicit dependencies of the output value.

Example response:

{
  "modules": [
    {
      "variable": {},
      "output": {}
    }
  ]
}
GET /terraform/modules/{prefix}

Get the list of modules available under the prefix provide. Only valid modules are return.

Parameters:
  • prefix – The prefix to filter with. Only module inside this prefix are returns. Folder which partially match aren’t included.
Response JSON Object:
 
  • modules[] (object) – A list of Terraform modules.
  • modules[].repository (string) – The Terraform repository containing this module.
  • modules[].path (string) – The relative path from the bastion root modules of this module.
  • modules[].variable[key].type (string) – The type of the variable.
  • modules[].variable[key].description (string) – A description of the variable.
  • modules[].variable[key].default – A default value for the variable.. Type can be any of string,array,object,null.
  • modules[].output[key].value – The value of the output.. Type can be any of string,array,object,null.
  • modules[].output[key].description (string) – A description of the output
  • modules[].output[key].sensitive (boolean) – If the output value is sensitive
  • modules[].output[key].depends_on[] (string) – Explicit dependencies of the output value.

Example response:

{
  "modules": [
    {
      "variable": {},
      "output": {}
    }
  ]
}
GET /terraform/module/{module}

Get the description of a Terraform module.

Parameters:
  • module – The relative path of a module.
Response JSON Object:
 
  • module.repository (string) – The Terraform repository containing this module.
  • module.path (string) – The relative path from the bastion root modules of this module.
  • module.variable[key].type (string) – The type of the variable.
  • module.variable[key].description (string) – A description of the variable.
  • module.variable[key].default – A default value for the variable.. Type can be any of string,array,object,null.
  • module.output[key].value – The value of the output.. Type can be any of string,array,object,null.
  • module.output[key].description (string) – A description of the output
  • module.output[key].sensitive (boolean) – If the output value is sensitive
  • module.output[key].depends_on[] (string) – Explicit dependencies of the output value.

Example response:

{
  "module": {
    "variable": {},
    "output": {}
  }
}

Terraform

GET /terraform/instances

Get the terraform instances

Response JSON Object:
 
  • [] (object) –
  • [].instanceID (string) –
  • [].modulePath (string) –
  • [].destination (string) –
  • [].bastionID (string) –
  • [].clusterID (string) –
  • [].serverIPs (string) –

Example response:

[
  {}
]
GET /terraform/instance/{instanceID}

Get the terraform instances

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • instanceID (string) –
  • modulePath (string) –
  • destination (string) –
  • bastionID (string) –
  • clusterID (string) –
  • serverIPs (string) –

Example response:

{}
GET /terraform/instance/{instanceID}/status

Get the status of the instance.

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • status (string) –

    The status of the cluster

    • VOID: The cluster doesn’t exist.
    • EMPTY: The cluster is not initialized.
    • DOWN: The cluster has no resource instanciated.
    • UP: The cluter has some resources instanciated.
    • BUSY: The cluster is currently running a command.
    • ERROR: An error occured during the retrieval of the status.
    • INVALID: The current status is unknown or invalid.

Example response:

{}
GET /instance/{instanceID}/tfvars/default

Get the default terraform variables.

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • [key] – . Type can be any of boolean,integer,number,object,string,null.

Example response:

{}
GET /terraform/instance/{instanceID}/tfvars

Get the terraform variables. This is the content of the terraform.tfvars file.

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • [key] – . Type can be any of boolean,integer,number,object,string,null.

Example response:

{}
POST /terraform/instance/{instanceID}/tfvars

Set the terraform variables. This is the content of the terraform.tfvars file.

Parameters:
  • instanceID – The instance ID. An opaque string.
Request JSON Object:
 
  • [key] – . Type can be any of boolean,integer,number,object,string,null.

Example query:

{}
POST /terraform/instance/{instanceID}/get

Execute the terraform get command

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • data (string) –

Example response:

{}
POST /terraform/instance/{instanceID}/importmodule

Import a module to terraform

Parameters:
  • instanceID – The instance ID. An opaque string.
Query Parameters:
 
  • force – Force the operation even if the cluster is in error state.
Request JSON Object:
 
  • modulePath (string) – The module path
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example query:

{}

Example response:

{}
POST /terraform/instance/{instanceID}/init

Execute the terraform init command

Parameters:
  • instanceID – The instance ID. An opaque string.
Query Parameters:
 
  • force – Force the operation even if the cluster is in error state.
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example response:

{}
POST /terraform/instance/{instanceID}/plan

Execute the terraform plan command

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example response:

{}
POST /terraform/instance/{instanceID}/refresh

Execute the terraform refresh command

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example response:

{}
POST /terraform/instance/{instanceID}/apply

Execute the terraform apply command

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example response:

{}
POST /terraform/instance/{instanceID}/destroy

Execute the terraform destroy command

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example response:

{}
POST /terraform/instance/{instanceID}/output

Execute the terraform output command

Parameters:
  • instanceID – The instance ID. An opaque string.
Response JSON Object:
 
  • sensitive (boolean) –
  • type (string) –
  • value (undefined) –

Example response:

{}
GET /instance/{instanceID}/content/{contentID}

Get the content of a {contentID}.tf.json file

Parameters:
  • instanceID – The instance ID. An opaque string.
  • contentID – The content ID. An opaque string.
Response JSON Object:
 
  • [key] – . Type can be any of boolean,integer,number,object,string,null.

Example response:

{}
POST /instance/{instanceID}/content/{contentID}

Set the content of a {contentID}.tf.json file

Parameters:
  • instanceID – The instance ID. An opaque string.
  • contentID – The content ID. An opaque string.
Request JSON Object:
 
  • [key] – . Type can be any of boolean,integer,number,object,string,null.

Example query:

{}
DELETE /instance/{instanceID}/content/{contentID}

Delete a {contentID}.tf.json file

Parameters:
  • instanceID – The instance ID. An opaque string.
  • contentID – The content ID. An opaque string.

Commands

GET /terraform/instance/{instanceID}/commands

Get the commands

Parameters:
  • instanceID – The instance ID. An opaque string.
Query Parameters:
 
  • current – If true, only return executing commands
Response JSON Object:
 
  • [] (object) –
  • [].data (string) –
  • [].instanceID (string) –
  • [].category (string) –
  • [].command (string) –
  • [].args (string) –
  • [].error (string) –
  • [].start (string) –
  • [].end (string) –

Example response:

[
  {}
]
GET /terraform/instance/{instanceID}/command/{commandID}

Get the command data

Parameters:
  • instanceID – The instance ID. An opaque string.
  • commandID – The command ID. An opaque string.
Response JSON Object:
 
  • data (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • args (string) –
  • error (string) –
  • start (string) –
  • end (string) –

Example response:

{}
GET /terraform/instance/{instanceID}/log/{commandID}

Get a command log

Parameters:
  • instanceID – The instance ID. An opaque string.
  • commandID – The command ID. An opaque string.
Query Parameters:
 
  • origin – Either start or end
  • offset – The offset to the origin
  • size – The max size of the return value
Response JSON Object:
 
  • offset (integer) –
  • data (string) –
  • isDone (boolean) –

Example response:

{}
GET /instance/{instanceID}/terminate/{commandID}

Terminate a command

Parameters:
  • instanceID – The instance ID. An opaque string.
  • commandID – The command ID. An opaque string.
GET /instance/{instanceID}/kill/{commandID}

Kill a command

Parameters:
  • instanceID – The instance ID. An opaque string.
  • commandID – The command ID. An opaque string.