Workspace

This endpoint is used to create, update, search or delete workspace information inside 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

get

Returns an instance of type workspace

Path parameters
organizationIdanyRequired

organization Identifier

workspaceIdanyRequired

workspace Identifier

Query parameters
Responses
200
Successful response
application/vnd.api+json
get
GET /api/v1/organization/{organizationId}/workspace/{workspaceId} HTTP/1.1
Host: 
Accept: */*
200

Successful response

{
  "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"
    }
  ]
}
post

Creates an item of type workspace and adds it to workspace

Path parameters
organizationIdanyRequired

organization Identifier

Body
Responses
201
Successful response
application/vnd.api+json
post
POST /api/v1/organization/{organizationId}/workspace HTTP/1.1
Host: 
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 268

{
  "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"
      }
    }
  }
}
201

Successful response

{
  "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"
      }
    }
  }
}
delete

Deletes an instance of type workspace

Path parameters
organizationIdanyRequired

organization Identifier

workspaceIdanyRequired

workspace Identifier

Responses
204
Successful response
delete
DELETE /api/v1/organization/{organizationId}/workspace/{workspaceId} HTTP/1.1
Host: 
Accept: */*
204

Successful response

No content

patch

Modifies an instance of type workspace

Path parameters
organizationIdanyRequired

organization Identifier

workspaceIdanyRequired

workspace Identifier

Body
Responses
204
Successful response
patch
PATCH /api/v1/organization/{organizationId}/workspace/{workspaceId} HTTP/1.1
Host: 
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 268

{
  "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"
      }
    }
  }
}
204

Successful response

No content

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

Was this helpful?