Workspace Templates
Workspace Templates Service handles the API for managing template associations with workspaces.
Apply the given template version's config onto the workspace, pin that version, and persist both atomically.
Org is the organisation identifier.
7Project is the project identifier.
oWorkspace identifier
zAccount is the internal customer account ID.
weSwitch a version-pinned workspace to tracking stable: apply the stable template and clear the pin. When true, version is ignored.
falseTemplate version to fetch, apply, and pin. Omit to re-apply the version the workspace already tracks (its pin, or stable when it tracks stable).
1OK response.
True when the workspace configuration was persisted.
falseThe pinned template version that was applied.
Quis est soluta.Workspace the template was applied to.
Ut velit.BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
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."
}Get the differences between the current workspace YAML and what it will look like when reconciled with the template
Org is the organisation identifier.
qcProject is the project identifier.
2y0Workspace identifier
5Template version to diff against instead of the workspace's pinned version.
o5Preview switching a version-pinned workspace to tracking stable: diff against the stable template instead of the pin. When true, version is ignored.
falseAccount is the internal customer account ID.
cr7OK response.
Current workspace YAML
Voluptatem doloremque iure rerum sit architecto.Workspace YAML after applying changes from the template
Atque perspiciatis et possimus impedit aliquam est.Indicates if the workspace needs template-based reconciliation
trueBadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
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
}Add a workspace-template combination to the table.
Org is the organisation identifier.
clProject is the project identifier.
j6Account is the internal customer account ID.
9Template identifier
dkwTemplate version
tWorkspace identifier
gwCreated response.
Account identifier.
pTimestamp when the workspace-template association was created.
1627590400Organization identifier.
b76Project identifier.
tq8Template identifier.
5jTimestamp when the workspace-template association was last updated.
1627686800Template version associated with the workspace.
7aWorkspace identifier.
hvvBadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
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"
}Get all workspaces associated with a specific template ID for a given scope.
Org is the organisation identifier.
4Project is the project identifier.
tTemplate identifier to filter workspaces
kjAccount is the internal customer account ID.
joOK response.
List of workspaces associated with the template ID
Account identifier.
9x9Timestamp when the workspace-template association was created.
1627590400Organization identifier.
25Project identifier.
0Template identifier.
safTimestamp when the workspace-template association was last updated.
1627686800Template version associated with the workspace.
amqWorkspace identifier.
av8BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
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 a workspace template combo to change its version.
Org is the organisation identifier.
tProject is the project identifier.
kiTemplate identifier
2mWorkspace identifier
c6Account is the internal customer account ID.
ocNew template version
2OK response.
Account identifier.
tTimestamp when the workspace-template association was created.
1627590400Organization identifier.
urProject identifier.
bTemplate identifier.
iTimestamp when the workspace-template association was last updated.
1627686800Template version associated with the workspace.
oWorkspace identifier.
hm2BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
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"
}Remove the association between a template and a workspace.
Org is the organisation identifier.
rProject is the project identifier.
o79Template identifier
bkWorkspace identifier
mAccount is the internal customer account ID.
bbNo Content response.
No content
BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
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?