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.

Apply workspace template

post

Apply the given template version's config onto the workspace, pin that version, and persist both atomically.

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

Org is the organisation identifier.

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

Project is the project identifier.

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

Workspace identifier

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

Account is the internal customer account ID.

Example: we
Body
track_stablebooleanOptional

Switch a version-pinned workspace to tracking stable: apply the stable template and clear the pin. When true, version is ignored.

Example: false
versionstring · min: 1 · max: 64Optional

Template version to fetch, apply, and pin. Omit to re-apply the version the workspace already tracks (its pin, or stable when it tracks stable).

Example: 1
Responses
200

OK response.

application/json
appliedbooleanRequired

True when the workspace configuration was persisted.

Example: false
applied_versionstringOptional

The pinned template version that was applied.

Example: Quis est soluta.
workspace_idstringRequired

Workspace the template was applied to.

Example: Ut velit.
post/api/orgs/{org}/projects/{project}/workspace/template/{workspace_id}/apply
POST /api/orgs/{org}/projects/{project}/workspace/template/{workspace_id}/apply HTTP/1.1
Host: localhost:80
Harness-Account: we
Content-Type: application/json
Accept: */*
Content-Length: 36

{
  "track_stable": true,
  "version": "wb"
}
{
  "applied": false,
  "applied_version": "Quo est praesentium impedit corrupti.",
  "workspace_id": "Sit quod odio porro."
}

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

Project is the project identifier.

Example: 2y0
workspace_idstring · min: 1 · max: 128Required

Workspace identifier

Example: 5
Query parameters
versionstring · min: 1 · max: 64Optional

Template version to diff against instead of the workspace's pinned version.

Example: o5
track_stablebooleanOptional

Preview switching a version-pinned workspace to tracking stable: diff against the stable template instead of the pin. When true, version is ignored.

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

Account is the internal customer account ID.

Example: cr7
Responses
200

OK response.

application/json
currentWorkspaceYamlstringRequired

Current workspace YAML

Example: Voluptatem doloremque iure rerum sit architecto.
reconcilableWorkspaceYamlstringRequired

Workspace YAML after applying changes from the template

Example: Atque perspiciatis et possimus impedit aliquam est.
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: cr7
Accept: */*
{
  "currentWorkspaceYaml": "Dolor nesciunt optio saepe sapiente.",
  "reconcilableWorkspaceYaml": "Consectetur fugiat fuga.",
  "requiresReconciliation": true
}

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

Project is the project identifier.

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

Account is the internal customer account ID.

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

Template identifier

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

Template version

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

Workspace identifier

Example: gw
Responses
201

Created response.

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

Account identifier.

Example: p
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

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

Organization identifier.

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

Project identifier.

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

Template identifier.

Example: 5j
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: 7a
workspace_idstring · min: 1 · max: 128Required

Workspace identifier.

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

{
  "template_id": "hn",
  "version": "0",
  "workspace_id": "pxt"
}
{
  "account": "0se",
  "created_at": 1627590400,
  "org": "cpp",
  "project": "k",
  "template_id": "nuy",
  "updated_at": 1627686800,
  "version": "1ra",
  "workspace_id": "16"
}

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

Project is the project identifier.

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

Template identifier to filter workspaces

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

Account is the internal customer account ID.

Example: jo
Responses
200

OK response.

application/json

List of workspaces associated with the template ID

accountstring · min: 1 · max: 128Required

Account identifier.

Example: 9x9
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

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

Organization identifier.

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

Project identifier.

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

Template identifier.

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

Workspace identifier.

Example: av8
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: jo
Accept: */*
[
  {
    "account": "85z",
    "created_at": 1627590400,
    "org": "k",
    "project": "a4",
    "template_id": "oo",
    "updated_at": 1627686800,
    "version": "t",
    "workspace_id": "utq"
  },
  {
    "account": "85z",
    "created_at": 1627590400,
    "org": "k",
    "project": "a4",
    "template_id": "oo",
    "updated_at": 1627686800,
    "version": "t",
    "workspace_id": "utq"
  },
  {
    "account": "85z",
    "created_at": 1627590400,
    "org": "k",
    "project": "a4",
    "template_id": "oo",
    "updated_at": 1627686800,
    "version": "t",
    "workspace_id": "utq"
  }
]

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

Project is the project identifier.

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

Template identifier

Example: 2m
workspace_idstring · min: 1 · max: 128Required

Workspace identifier

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

Account is the internal customer account ID.

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

New template version

Example: 2
Responses
200

OK response.

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

Account identifier.

Example: t
created_atinteger · int64Required

Timestamp when the workspace-template association was created.

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

Organization identifier.

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

Project identifier.

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

Template identifier.

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

Workspace identifier.

Example: hm2
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: oc
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "version": "1"
}
{
  "account": "pru",
  "created_at": 1627590400,
  "org": "a",
  "project": "i2",
  "template_id": "h5",
  "updated_at": 1627686800,
  "version": "vm",
  "workspace_id": "mdm"
}

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

Project is the project identifier.

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

Template identifier

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

Workspace identifier

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

Account is the internal customer account ID.

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

No content

Last updated

Was this helpful?