Skip to main content

policy_orchestrators

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

Overview

Namepolicy_orchestrators
TypeResource
Idgoogle.osconfig.policy_orchestrators

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Identifier. In form of * organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id} * folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id} * projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}
actionstringRequired. Action to be done by the orchestrator in projects/{project_id}/zones/{zone_id} locations defined by the orchestration_scope. Allowed values: - UPSERT - Orchestrator will create or update target resources. - DELETE - Orchestrator will delete target resources, if they exist
createTimestring (google-datetime)Output only. Timestamp when the policy orchestrator resource was created.
descriptionstringOptional. Freeform text describing the purpose of the resource.
etagstringOutput only. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
labelsobjectOptional. Labels as key value pairs
orchestratedResourceobjectRequired. Resource to be orchestrated by the policy orchestrator. (id: GoogleCloudOsconfigV2__OrchestratedResource)
orchestrationScopeobjectOptional. Defines scope for the orchestration, in context of the enclosing PolicyOrchestrator resource. Scope is expanded into a list of pairs, in which the rollout action will take place. Expansion starts with a Folder resource parenting the PolicyOrchestrator resource: - All the descendant projects are listed. - List of project is cross joined with a list of all available zones. - Resulting list of pairs is filtered according to the selectors. (id: GoogleCloudOsconfigV2__OrchestrationScope)
orchestrationStateobjectOutput only. State of the orchestration. (id: GoogleCloudOsconfigV2_PolicyOrchestrator_OrchestrationState)
reconcilingbooleanOutput only. Set to true, if the there are ongoing changes being applied by the orchestrator.
statestringOptional. State of the orchestrator. Can be updated to change orchestrator behaviour. Allowed values: - ACTIVE - orchestrator is actively looking for actions to be taken. - STOPPED - orchestrator won't make any changes. Note: There might be more states added in the future. We use string here instead of an enum, to avoid the need of propagating new states to all the client code.
updateTimestring (google-datetime)Output only. Timestamp when the policy orchestrator resource was last modified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, policyOrchestratorsIdRetrieves an existing policy orchestrator, parented by a project.
listselectprojectsIdorderBy, pageSize, pageToken, filterLists the policy orchestrators under the given parent project resource.
createinsertprojectsIdpolicyOrchestratorId, requestIdCreates a new policy orchestrator under the given project resource. name field of the given orchestrator are ignored and instead replaced by a product of parent and policy_orchestrator_id. Orchestrator state field might be only set to ACTIVE, STOPPED or omitted (in which case, the created resource will be in ACTIVE state anyway).
patchupdateprojectsId, policyOrchestratorsIdupdateMaskUpdates an existing policy orchestrator, parented by a project.
deletedeleteprojectsId, policyOrchestratorsIdetag, requestIdDeletes an existing policy orchestrator resource, parented by a project.

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
policyOrchestratorsIdstring
projectsIdstring
etagstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
policyOrchestratorIdstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Retrieves an existing policy orchestrator, parented by a project.

SELECT
name,
action,
createTime,
description,
etag,
labels,
orchestratedResource,
orchestrationScope,
orchestrationState,
reconciling,
state,
updateTime
FROM google.osconfig.policy_orchestrators
WHERE projectsId = '{{ projectsId }}' -- required
AND policyOrchestratorsId = '{{ policyOrchestratorsId }}' -- required
;

INSERT examples

Creates a new policy orchestrator under the given project resource. name field of the given orchestrator are ignored and instead replaced by a product of parent and policy_orchestrator_id. Orchestrator state field might be only set to ACTIVE, STOPPED or omitted (in which case, the created resource will be in ACTIVE state anyway).

INSERT INTO google.osconfig.policy_orchestrators (
data__orchestratedResource,
data__labels,
data__description,
data__action,
data__state,
data__name,
data__orchestrationScope,
projectsId,
policyOrchestratorId,
requestId
)
SELECT
'{{ orchestratedResource }}',
'{{ labels }}',
'{{ description }}',
'{{ action }}',
'{{ state }}',
'{{ name }}',
'{{ orchestrationScope }}',
'{{ projectsId }}',
'{{ policyOrchestratorId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an existing policy orchestrator, parented by a project.

UPDATE google.osconfig.policy_orchestrators
SET
data__orchestratedResource = '{{ orchestratedResource }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__action = '{{ action }}',
data__state = '{{ state }}',
data__name = '{{ name }}',
data__orchestrationScope = '{{ orchestrationScope }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND policyOrchestratorsId = '{{ policyOrchestratorsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an existing policy orchestrator resource, parented by a project.

DELETE FROM google.osconfig.policy_orchestrators
WHERE projectsId = '{{ projectsId }}' --required
AND policyOrchestratorsId = '{{ policyOrchestratorsId }}' --required
AND etag = '{{ etag }}'
AND requestId = '{{ requestId }}'
;