For the complete documentation index, see llms.txt. This page is also available as Markdown.

Workspace Templates

Workspace Templates Service handles the API for managing template associations with workspaces.

Retrieve workspace-template reconciliation diff

get

Get the differences between the current workspace YAML and what it will look like when reconciled with the template

Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: 69q
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: k
workspace_idstring · min: 1 · max: 128Required

Workspace identifier

Example: 4
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: t4
Responses
200

OK response.

application/json
currentWorkspaceYamlstringRequired

Current workspace YAML

Example: Dolorem natus quisquam in quam corporis libero.
reconcilableWorkspaceYamlstringRequired

Workspace YAML after applying changes from the template

Example: Nemo natus voluptatum iure est veniam ipsum.
requiresReconciliationbooleanRequired

Indicates if the workspace needs template-based reconciliation

Example: false
get/api/orgs/{org}/projects/{project}/workspace/template/{workspace_id}/yaml-diff
GET /api/orgs/{org}/projects/{project}/workspace/template/{workspace_id}/yaml-diff HTTP/1.1
Host: localhost:80
Harness-Account: t4
Accept: */*
{
  "currentWorkspaceYaml": "Inventore incidunt asperiores quisquam.",
  "reconcilableWorkspaceYaml": "Possimus quo.",
  "requiresReconciliation": false
}

Create workspace template

post

Add a workspace-template combination to the table.

Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: y8
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: uo
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: c
Body
template_idstring · min: 1 · max: 128Required

Template identifier

Example: nzf
versionstring · min: 1 · max: 64Required

Template version

Example: 496
workspace_idstring · min: 1 · max: 128Required

Workspace identifier

Example: f
Responses
201

Created response.

application/json
accountstring · min: 1 · max: 128Required

Account identifier.

Example: 4il
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

Example: 1627590400
orgstring · min: 1 · max: 128Required

Organization identifier.

Example: lu
projectstring · min: 1 · max: 128Required

Project identifier.

Example: 5p
template_idstring · min: 1 · max: 128Required

Template identifier.

Example: 5
updated_atinteger · int64Required

Timestamp when the workspace-template association was last updated.

Example: 1627686800
versionstring · min: 1 · max: 32Optional

Template version associated with the workspace.

Example: a
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

Example: 0
post/api/orgs/{org}/projects/{project}/workspace/templates
POST /api/orgs/{org}/projects/{project}/workspace/templates HTTP/1.1
Host: localhost:80
Harness-Account: c
Content-Type: application/json
Accept: */*
Content-Length: 55

{
  "template_id": "hb",
  "version": "1",
  "workspace_id": "e2x"
}
{
  "account": "c",
  "created_at": 1627590400,
  "org": "ku5",
  "project": "m5s",
  "template_id": "9x9",
  "updated_at": 1627686800,
  "version": "n",
  "workspace_id": "w78"
}

List workspaces by template id

get

Get all workspaces associated with a specific template ID for a given scope.

Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: h6
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: t
template_idstring · min: 1 · max: 128Required

Template identifier to filter workspaces

Example: t8b
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: v
Responses
200

OK response.

application/json

List of workspaces associated with the template ID

accountstring · min: 1 · max: 128Required

Account identifier.

Example: y
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

Example: 1627590400
orgstring · min: 1 · max: 128Required

Organization identifier.

Example: m
projectstring · min: 1 · max: 128Required

Project identifier.

Example: xzy
template_idstring · min: 1 · max: 128Required

Template identifier.

Example: sds
updated_atinteger · int64Required

Timestamp when the workspace-template association was last updated.

Example: 1627686800
versionstring · min: 1 · max: 32Optional

Template version associated with the workspace.

Example: y
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

Example: x
get/api/orgs/{org}/projects/{project}/workspace/templates/{template_id}
GET /api/orgs/{org}/projects/{project}/workspace/templates/{template_id} HTTP/1.1
Host: localhost:80
Harness-Account: v
Accept: */*
[
  {
    "account": "w",
    "created_at": 1627590400,
    "org": "e8d",
    "project": "04",
    "template_id": "6",
    "updated_at": 1627686800,
    "version": "qw",
    "workspace_id": "owm"
  },
  {
    "account": "w",
    "created_at": 1627590400,
    "org": "e8d",
    "project": "04",
    "template_id": "6",
    "updated_at": 1627686800,
    "version": "qw",
    "workspace_id": "owm"
  }
]

Update workspace template

put

Update a workspace template combo to change its version.

Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: az
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: 6z
template_idstring · min: 1 · max: 128Required

Template identifier

Example: r
workspace_idstring · min: 1 · max: 128Required

Workspace identifier

Example: j
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: xn6
Body
versionstring · min: 1 · max: 64Required

New template version

Example: cz
Responses
200

OK response.

application/json
accountstring · min: 1 · max: 128Required

Account identifier.

Example: io
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

Example: 1627590400
orgstring · min: 1 · max: 128Required

Organization identifier.

Example: sd
projectstring · min: 1 · max: 128Required

Project identifier.

Example: fc
template_idstring · min: 1 · max: 128Required

Template identifier.

Example: f
updated_atinteger · int64Required

Timestamp when the workspace-template association was last updated.

Example: 1627686800
versionstring · min: 1 · max: 32Optional

Template version associated with the workspace.

Example: ai
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

Example: n
put/api/orgs/{org}/projects/{project}/workspace/templates/{template_id}/{workspace_id}
PUT /api/orgs/{org}/projects/{project}/workspace/templates/{template_id}/{workspace_id} HTTP/1.1
Host: localhost:80
Harness-Account: xn6
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "version": "2d"
}
{
  "account": "lr4",
  "created_at": 1627590400,
  "org": "fjp",
  "project": "7pr",
  "template_id": "c7",
  "updated_at": 1627686800,
  "version": "x",
  "workspace_id": "04"
}

Delete workspace template

delete

Remove the association between a template and a workspace.

Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: jx
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: p
template_idstring · min: 1 · max: 128Required

Template identifier

Example: a
workspace_idstring · min: 1 · max: 128Required

Workspace identifier

Example: gl0
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: ld
Responses
204

No Content response.

No content

delete/api/orgs/{org}/projects/{project}/workspace/templates/{template_id}/{workspace_id}
DELETE /api/orgs/{org}/projects/{project}/workspace/templates/{template_id}/{workspace_id} HTTP/1.1
Host: localhost:80
Harness-Account: ld
Accept: */*

No content

Last updated

Was this helpful?