Skip to main content

workloads

Creates, updates, deletes, gets or lists a workloads resource.

Overview

Nameworkloads
TypeResource
Idgoogle.apphub.workloads

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}"
attributesobjectOptional. Consumer provided attributes. (id: Attributes)
createTimestring (google-datetime)Output only. Create time.
descriptionstringOptional. User-defined description of a Workload. Can have a maximum length of 2048 characters.
discoveredWorkloadstringRequired. Immutable. The resource name of the original discovered workload.
displayNamestringOptional. User-defined name for the Workload. Can have a maximum length of 63 characters.
statestringOutput only. Workload state.
uidstringOutput only. A universally unique identifier (UUID) for the Workload in the UUID4 format.
updateTimestring (google-datetime)Output only. Update time.
workloadPropertiesobjectOutput only. Properties of an underlying compute resource represented by the Workload. These are immutable. (id: WorkloadProperties)
workloadReferenceobjectOutput only. Reference of an underlying compute resource represented by the Workload. These are immutable. (id: WorkloadReference)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, applicationsId, workloadsIdGets a Workload in an Application.
listselectprojectsId, locationsId, applicationsIdpageSize, pageToken, filter, orderByLists Workloads in an Application.
createinsertprojectsId, locationsId, applicationsIdworkloadId, requestIdCreates a Workload in an Application.
patchupdateprojectsId, locationsId, applicationsId, workloadsIdupdateMask, requestIdUpdates a Workload in an Application.
deletedeleteprojectsId, locationsId, applicationsId, workloadsIdrequestIdDeletes a Workload from an Application.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
applicationsIdstring
locationsIdstring
projectsIdstring
workloadsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)
workloadIdstring

SELECT examples

Gets a Workload in an Application.

SELECT
name,
attributes,
createTime,
description,
discoveredWorkload,
displayName,
state,
uid,
updateTime,
workloadProperties,
workloadReference
FROM google.apphub.workloads
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND applicationsId = '{{ applicationsId }}' -- required
AND workloadsId = '{{ workloadsId }}' -- required;

INSERT examples

Creates a Workload in an Application.

INSERT INTO google.apphub.workloads (
data__name,
data__displayName,
data__description,
data__discoveredWorkload,
data__attributes,
projectsId,
locationsId,
applicationsId,
workloadId,
requestId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ discoveredWorkload }}',
'{{ attributes }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ applicationsId }}',
'{{ workloadId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a Workload in an Application.

UPDATE google.apphub.workloads
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__discoveredWorkload = '{{ discoveredWorkload }}',
data__attributes = '{{ attributes }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND applicationsId = '{{ applicationsId }}' --required
AND workloadsId = '{{ workloadsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a Workload from an Application.

DELETE FROM google.apphub.workloads
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND applicationsId = '{{ applicationsId }}' --required
AND workloadsId = '{{ workloadsId }}' --required
AND requestId = '{{ requestId }}';