Variables

This endpoint is used to create, update, search or delete variables information inside a Terrakube workspace.

Entity fields:

Path
Type
Description

data.type

string

Should be "variable"

data.attributes.key

string

Unique variable name

data.attributes.value

string

Key value

data.attributes.sensitive

boolean

To hide the value when the output is sensitive

data.attributes.hcl

boolean

Terraform HCL variable type

data.attributes.category

string

Variable type could be TERRAFORM or ENV (Environment Variable)

data.attributes.description

string

Free text

Example:

{
  "data": {
    "type": "variable",
    "attributes": {
      "key": "tag_name",
      "value": "HolaMundo",
      "sensitive": false,
      "hcl": false,
      "category": "TERRAFORM",
      "description": "Azure RG Tag"
    }
  }
}

Supported Operations

get

Returns an instance of type variable

Path parameters
workspaceIdanyRequired

workspace Identifier

variableIdanyRequired

variable Identifier

Query parameters
Responses
get
GET /api/v1/workspace/{workspaceId}/variable/{variableId} HTTP/1.1
Host: 
Accept: */*
200

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "category": "TERRAFORM",
      "description": "text",
      "hcl": true,
      "key": "text",
      "sensitive": true,
      "value": "text"
    },
    "relationships": {
      "workspace": {
        "id": "text",
        "type": "workspace"
      }
    }
  },
  "included": [
    {
      "attributes": {},
      "id": "text",
      "relationships": {},
      "type": "text"
    }
  ]
}
post

Creates an item of type variable and adds it to variable

Path parameters
workspaceIdanyRequired

workspace Identifier

Body
Responses
post
POST /api/v1/workspace/{workspaceId}/variable HTTP/1.1
Host: 
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 214

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "category": "TERRAFORM",
      "description": "text",
      "hcl": true,
      "key": "text",
      "sensitive": true,
      "value": "text"
    },
    "relationships": {
      "workspace": {
        "id": "text",
        "type": "workspace"
      }
    }
  }
}
201

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "category": "TERRAFORM",
      "description": "text",
      "hcl": true,
      "key": "text",
      "sensitive": true,
      "value": "text"
    },
    "relationships": {
      "workspace": {
        "id": "text",
        "type": "workspace"
      }
    }
  }
}
delete

Deletes an instance of type vcs

Path parameters
workspaceIdanyRequired

workspace Identifier

vcsIdanyRequired

vcs Identifier

Responses
delete
DELETE /api/v1/workspace/{workspaceId}/vcs/{vcsId} HTTP/1.1
Host: 
Accept: */*
204

Successful response

No content

patch

Modifies an instance of type vcs

Path parameters
workspaceIdanyRequired

workspace Identifier

vcsIdanyRequired

vcs Identifier

Body
Responses
patch
PATCH /api/v1/workspace/{workspaceId}/vcs/{vcsId} HTTP/1.1
Host: 
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 235

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "accessToken": "text",
      "clientId": "text",
      "clientSecret": "text",
      "description": "text",
      "name": "text",
      "vcsType": "GITHUB"
    },
    "relationships": {
      "organization": {
        "id": "text",
        "type": "organization"
      }
    }
  }
}
204

Successful response

No content

For a complete list of organization operation please visit the OpenAPI specification

Was this helpful?