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: l1
projectstring · min: 1 · max: 128Required

Project is the project identifier.

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

Workspace identifier

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

Account is the internal customer account ID.

Example: gg
Responses
200

OK response.

application/json
currentWorkspaceYamlstringRequired

Current workspace YAML

Example: Fugiat laboriosam vitae.
reconcilableWorkspaceYamlstringRequired

Workspace YAML after applying changes from the template

Example: Ad tenetur autem.
requiresReconciliationbooleanRequired

Indicates if the workspace needs template-based reconciliation

Example: true
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: gg
Accept: */*
{
  "currentWorkspaceYaml": "Mollitia dolorem omnis.",
  "reconcilableWorkspaceYaml": "Dolores repellendus.",
  "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: h
projectstring · min: 1 · max: 128Required

Project is the project identifier.

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

Account is the internal customer account ID.

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

Template identifier

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

Template version

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

Workspace identifier

Example: 1ld
Responses
201

Created response.

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

Account identifier.

Example: l
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

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

Organization identifier.

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

Project identifier.

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

Template identifier.

Example: n
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: bvq
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

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

{
  "template_id": "3",
  "version": "12",
  "workspace_id": "5kc"
}
{
  "account": "jkh",
  "created_at": 1627590400,
  "org": "g",
  "project": "kn",
  "template_id": "wc",
  "updated_at": 1627686800,
  "version": "it",
  "workspace_id": "2d"
}

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: x
projectstring · min: 1 · max: 128Required

Project is the project identifier.

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

Template identifier to filter workspaces

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

Account is the internal customer account ID.

Example: y
Responses
200

OK response.

application/json

List of workspaces associated with the template ID

accountstring · min: 1 · max: 128Required

Account identifier.

Example: m
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

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

Organization identifier.

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

Project identifier.

Example: 8y
template_idstring · min: 1 · max: 128Required

Template identifier.

Example: a5z
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: 14e
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

Example: h
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: y
Accept: */*
[
  {
    "account": "kn",
    "created_at": 1627590400,
    "org": "4e",
    "project": "bjr",
    "template_id": "qr4",
    "updated_at": 1627686800,
    "version": "8h",
    "workspace_id": "6p"
  },
  {
    "account": "kn",
    "created_at": 1627590400,
    "org": "4e",
    "project": "bjr",
    "template_id": "qr4",
    "updated_at": 1627686800,
    "version": "8h",
    "workspace_id": "6p"
  }
]

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: 1
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: 4b
template_idstring · min: 1 · max: 128Required

Template identifier

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

Workspace identifier

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

Account is the internal customer account ID.

Example: 53d
Body
versionstring · min: 1 · max: 64Required

New template version

Example: qiq
Responses
200

OK response.

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

Account identifier.

Example: 9
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

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

Organization identifier.

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

Project identifier.

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

Template identifier.

Example: ev
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: ck
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

Example: tl
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: 53d
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "version": "k"
}
{
  "account": "57",
  "created_at": 1627590400,
  "org": "jeb",
  "project": "z",
  "template_id": "24",
  "updated_at": 1627686800,
  "version": "0ts",
  "workspace_id": "c"
}

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: pfr
projectstring · min: 1 · max: 128Required

Project is the project identifier.

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

Template identifier

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

Workspace identifier

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

Account is the internal customer account ID.

Example: 2
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: 2
Accept: */*

No content

Last updated

Was this helpful?