Workspace

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

To use this endpoint you should have "manageWorkspace" access at team level and a Terrakube organization

Entity fields:

Path
Type
Description

data.type

string

Should be "workspace"

data.attributes.name

string

Unique workspace for an Terrakube organization

data.attributes.branch

boolean

Git branch to be used

data.attributes.source

boolean

Git repository to be used

data.attributes.terraformVersion

boolean

Terraform version to run the workspace

data.relationships.vcs.data.type

string

Should be "vcs" (OPTIONAL)

data.relationships.vcs.data.type

string

Should be the VCS Connection Id (OPTIONAL)

Example:

{
    "data": {
        "type": "workspace",
        "attributes": {
            "branch": "main",
            "name": "Terrakube Workspace",
            "source": "https://github.com/AzBuilder/terraform-sample-repository.git",
            "terraformVersion": "0.15.0"
        },
        "relationships": {
            "vcs": {
                "data": {
                    "type": "vcs",
                    "id": "{{vcsIdGitHub}}"
                }
            }
        }
    }
}

Supported Operations

Returns an instance of type workspace

get

/organization/{organizationId}/workspace/{workspaceId}

Path parameters
organizationIdstringrequired

organization Identifier

workspaceIdstringrequired

workspace Identifier

Query parameters
fields[workspace]string · enum[]

Selects the set of workspace fields that should be returned in the result.

includestring · enum[]

Selects the set of relationships that should be expanded as a compound document in the result.

Responses
curl -L \
  --url '/api/v1/organization/{organizationId}/workspace/{workspaceId}'
{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "branch": "text",
      "name": "text",
      "source": "text",
      "terraformVersion": "text"
    },
    "relationships": {
      "job": {
        "id": "text",
        "type": "job"
      },
      "organization": {
        "id": "text",
        "type": "organization"
      },
      "variable": {
        "id": "text",
        "type": "variable"
      }
    }
  },
  "included": [
    {
      "attributes": {},
      "id": "text",
      "relationships": {},
      "type": "text"
    }
  ]
}

Creates an item of type workspace and adds it to workspace

post

/organization/{organizationId}/workspace

Path parameters
organizationIdstringrequired

organization Identifier

Body
dataobject
Responses
curl -L \
  --request POST \
  --url '/api/v1/organization/{organizationId}/workspace' \
  --header 'Content-Type: application/vnd.api+json'
{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "branch": "text",
      "name": "text",
      "source": "text",
      "terraformVersion": "text"
    },
    "relationships": {
      "job": {
        "id": "text",
        "type": "job"
      },
      "organization": {
        "id": "text",
        "type": "organization"
      },
      "variable": {
        "id": "text",
        "type": "variable"
      }
    }
  }
}

Deletes an instance of type workspace

delete

/organization/{organizationId}/workspace/{workspaceId}

Path parameters
organizationIdstringrequired

organization Identifier

workspaceIdstringrequired

workspace Identifier

Responses
curl -L \
  --request DELETE \
  --url '/api/v1/organization/{organizationId}/workspace/{workspaceId}'

No body

Modifies an instance of type workspace

patch

/organization/{organizationId}/workspace/{workspaceId}

Path parameters
organizationIdstringrequired

organization Identifier

workspaceIdstringrequired

workspace Identifier

Body
dataobject
Responses
curl -L \
  --request PATCH \
  --url '/api/v1/organization/{organizationId}/workspace/{workspaceId}' \
  --header 'Content-Type: application/vnd.api+json'

No body

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

Last updated