workloads
Creates, updates, deletes, gets or lists a workloads
resource.
Overview
Name | workloads |
Type | Resource |
Id | google.apphub.workloads |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The resource name of the Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}" |
attributes | object | Optional. Consumer provided attributes. (id: Attributes) |
createTime | string (google-datetime) | Output only. Create time. |
description | string | Optional. User-defined description of a Workload. Can have a maximum length of 2048 characters. |
discoveredWorkload | string | Required. Immutable. The resource name of the original discovered workload. |
displayName | string | Optional. User-defined name for the Workload. Can have a maximum length of 63 characters. |
state | string | Output only. Workload state. |
uid | string | Output only. A universally unique identifier (UUID) for the Workload in the UUID4 format. |
updateTime | string (google-datetime) | Output only. Update time. |
workloadProperties | object | Output only. Properties of an underlying compute resource represented by the Workload. These are immutable. (id: WorkloadProperties) |
workloadReference | object | Output only. Reference of an underlying compute resource represented by the Workload. These are immutable. (id: WorkloadReference) |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The resource name of the Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}" |
attributes | object | Optional. Consumer provided attributes. (id: Attributes) |
createTime | string (google-datetime) | Output only. Create time. |
description | string | Optional. User-defined description of a Workload. Can have a maximum length of 2048 characters. |
discoveredWorkload | string | Required. Immutable. The resource name of the original discovered workload. |
displayName | string | Optional. User-defined name for the Workload. Can have a maximum length of 63 characters. |
state | string | Output only. Workload state. |
uid | string | Output only. A universally unique identifier (UUID) for the Workload in the UUID4 format. |
updateTime | string (google-datetime) | Output only. Update time. |
workloadProperties | object | Output only. Properties of an underlying compute resource represented by the Workload. These are immutable. (id: WorkloadProperties) |
workloadReference | object | Output 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , applicationsId , workloadsId | Gets a Workload in an Application. | |
list | select | projectsId , locationsId , applicationsId | pageSize , pageToken , filter , orderBy | Lists Workloads in an Application. |
create | insert | projectsId , locationsId , applicationsId | workloadId , requestId | Creates a Workload in an Application. |
patch | update | projectsId , locationsId , applicationsId , workloadsId | updateMask , requestId | Updates a Workload in an Application. |
delete | delete | projectsId , locationsId , applicationsId , workloadsId | requestId | Deletes 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.
Name | Datatype | Description |
---|---|---|
applicationsId | string | |
locationsId | string | |
projectsId | string | |
workloadsId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) | |
workloadId | string |
SELECT
examples
- get
- list
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;
Lists Workloads 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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: workloads
props:
- name: projectsId
value: string
description: Required parameter for the workloads resource.
- name: locationsId
value: string
description: Required parameter for the workloads resource.
- name: applicationsId
value: string
description: Required parameter for the workloads resource.
- name: name
value: string
description: >
Identifier. The resource name of the Workload. Format: `"projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}"`
- name: displayName
value: string
description: >
Optional. User-defined name for the Workload. Can have a maximum length of 63 characters.
- name: description
value: string
description: >
Optional. User-defined description of a Workload. Can have a maximum length of 2048 characters.
- name: discoveredWorkload
value: string
description: >
Required. Immutable. The resource name of the original discovered workload.
- name: attributes
value: object
description: >
Optional. Consumer provided attributes.
- name: workloadId
value: string
- name: requestId
value: string
UPDATE
examples
- patch
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
- delete
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 }}';