Skip to main content

environments

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

Overview

Nameenvironments
TypeResource
Idgoogle.composer.environments

Fields

NameDatatypeDescription
namestringThe resource name of the environment, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}" EnvironmentId must start with a lowercase letter followed by up to 63 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
configobjectConfiguration information for an environment.
createTimestringOutput only. The time at which this environment was created.
labelsobjectOptional. User-defined labels for this environment. The labels map can contain no more than 64 entries. Entries of the labels map are UTF8 strings that comply with the following restrictions: Keys must conform to regexp: \p{Ll}\p{Lo}{0,62} Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} * Both keys and values are additionally constrained to be <= 128 bytes in size.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
statestringThe current state of the environment.
storageConfigobjectThe configuration for data storage in the environment.
updateTimestringOutput only. The time at which this environment was last modified.
uuidstringOutput only. The UUID (Universally Unique IDentifier) associated with this environment. This value is generated when the environment is created.

Methods

NameAccessible byRequired ParamsDescription
getSELECTenvironmentsId, locationsId, projectsIdGet an existing environment.
listSELECTlocationsId, projectsIdList environments.
createINSERTlocationsId, projectsIdCreate a new environment.
deleteDELETEenvironmentsId, locationsId, projectsIdDelete an environment.
patchUPDATEenvironmentsId, locationsId, projectsIdUpdate an environment.
check_upgradeEXECenvironmentsId, locationsId, projectsIdCheck if an upgrade operation on the environment will succeed. In case of problems detailed info can be found in the returned Operation.
database_failoverEXECenvironmentsId, locationsId, projectsIdTriggers database failover (only for highly resilient environments).
execute_airflow_commandEXECenvironmentsId, locationsId, projectsIdExecutes Airflow CLI command.
load_snapshotEXECenvironmentsId, locationsId, projectsIdLoads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.
poll_airflow_commandEXECenvironmentsId, locationsId, projectsIdPolls Airflow CLI command execution and fetches logs.
save_snapshotEXECenvironmentsId, locationsId, projectsIdCreates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.
stop_airflow_commandEXECenvironmentsId, locationsId, projectsIdStops Airflow CLI command execution.

SELECT examples

List environments.

SELECT
name,
config,
createTime,
labels,
satisfiesPzi,
satisfiesPzs,
state,
storageConfig,
updateTime,
uuid
FROM google.composer.environments
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new environments resource.

/*+ create */
INSERT INTO google.composer.environments (
locationsId,
projectsId,
name,
config,
uuid,
state,
labels,
storageConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ config }}',
'{{ uuid }}',
'{{ state }}',
'{{ labels }}',
'{{ storageConfig }}'
;

UPDATE example

Updates a environments resource.

/*+ update */
UPDATE google.composer.environments
SET
name = '{{ name }}',
config = '{{ config }}',
uuid = '{{ uuid }}',
state = '{{ state }}',
labels = '{{ labels }}',
storageConfig = '{{ storageConfig }}'
WHERE
environmentsId = '{{ environmentsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified environments resource.

/*+ delete */
DELETE FROM google.composer.environments
WHERE environmentsId = '{{ environmentsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';