workloads
Creates, updates, deletes, gets or lists a workloads
resource.
Overview
Name | workloads |
Type | Resource |
Id | google.apphub.workloads |
Fields
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}" |
description | string | Optional. User-defined description of a Workload. Can have a maximum length of 2048 characters. |
attributes | object | Consumer provided attributes. |
createTime | string | Output only. Create time. |
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 | Output only. Update time. |
workloadProperties | object | Properties of an underlying compute resource represented by the Workload. |
workloadReference | object | Reference of an underlying compute resource represented by the Workload. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | applicationsId, locationsId, projectsId, workloadsId | Gets a Workload in an Application. |
list | SELECT | applicationsId, locationsId, projectsId | Lists Workloads in an Application. |
create | INSERT | applicationsId, locationsId, projectsId | Creates a Workload in an Application. |
delete | DELETE | applicationsId, locationsId, projectsId, workloadsId | Deletes a Workload from an Application. |
patch | UPDATE | applicationsId, locationsId, projectsId, workloadsId | Updates a Workload in an Application. |
SELECT
examples
Lists Workloads in an Application.
SELECT
name,
description,
attributes,
createTime,
discoveredWorkload,
displayName,
state,
uid,
updateTime,
workloadProperties,
workloadReference
FROM google.apphub.workloads
WHERE applicationsId = '{{ applicationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new workloads
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.apphub.workloads (
applicationsId,
locationsId,
projectsId,
name,
displayName,
description,
discoveredWorkload,
attributes
)
SELECT
'{{ applicationsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ discoveredWorkload }}',
'{{ attributes }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: displayName
value: string
- name: description
value: string
- name: workloadReference
value:
- name: uri
value: string
- name: workloadProperties
value:
- name: gcpProject
value: string
- name: location
value: string
- name: zone
value: string
- name: discoveredWorkload
value: string
- name: attributes
value:
- name: criticality
value:
- name: type
value: string
- name: environment
value:
- name: type
value: string
- name: developerOwners
value:
- - name: displayName
value: string
- name: email
value: string
- name: operatorOwners
value:
- - name: displayName
value: string
- name: email
value: string
- name: businessOwners
value:
- - name: displayName
value: string
- name: email
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: uid
value: string
- name: state
value: string
UPDATE
example
Updates a workloads
resource.
/*+ update */
UPDATE google.apphub.workloads
SET
name = '{{ name }}',
displayName = '{{ displayName }}',
description = '{{ description }}',
discoveredWorkload = '{{ discoveredWorkload }}',
attributes = '{{ attributes }}'
WHERE
applicationsId = '{{ applicationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND workloadsId = '{{ workloadsId }}';
DELETE
example
Deletes the specified workloads
resource.
/*+ delete */
DELETE FROM google.apphub.workloads
WHERE applicationsId = '{{ applicationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND workloadsId = '{{ workloadsId }}';