Skip to main content

environments

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

Overview​

Nameenvironments
TypeResource
Idgoogle.composer.environments

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The 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.
configobjectOptional. Configuration parameters for this environment. (id: EnvironmentConfig)
createTimestring (google-datetime)Output 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. (STATE_UNSPECIFIED, CREATING, RUNNING, UPDATING, DELETING, ERROR)
storageConfigobjectOptional. Storage configuration for this environment. (id: StorageConfig)
updateTimestring (google-datetime)Output 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​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, environmentsIdGet an existing environment.
listselectprojectsId, locationsIdpageSize, pageTokenList environments.
createinsertprojectsId, locationsIdCreate a new environment.
patchupdateprojectsId, locationsId, environmentsIdupdateMaskUpdate an environment.
deletedeleteprojectsId, locationsId, environmentsIdDelete an environment.
check_upgradeexecprojectsId, locationsId, environmentsIdCheck if an upgrade operation on the environment will succeed. In case of problems detailed info can be found in the returned Operation.
database_failoverexecprojectsId, locationsId, environmentsIdTriggers database failover (only for highly resilient environments).
execute_airflow_commandexecprojectsId, locationsId, environmentsIdExecutes Airflow CLI command.
load_snapshotexecprojectsId, locationsId, environmentsIdLoads 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_commandexecprojectsId, locationsId, environmentsIdPolls Airflow CLI command execution and fetches logs.
restart_web_serverexecprojectsId, locationsId, environmentsIdRestart Airflow web server.
save_snapshotexecprojectsId, locationsId, environmentsIdCreates 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_commandexecprojectsId, locationsId, environmentsIdStops Airflow CLI command execution.

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
environmentsIdstring
locationsIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples​

Get an existing environment.

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

INSERT examples​

Create a new environment.

INSERT INTO google.composer.environments (
data__config,
data__createTime,
data__labels,
data__name,
data__state,
data__storageConfig,
data__updateTime,
data__uuid,
projectsId,
locationsId
)
SELECT
'{{ config }}',
'{{ createTime }}',
'{{ labels }}',
'{{ name }}',
'{{ state }}',
'{{ storageConfig }}',
'{{ updateTime }}',
'{{ uuid }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples​

Update an environment.

UPDATE google.composer.environments
SET
data__config = '{{ config }}',
data__createTime = '{{ createTime }}',
data__labels = '{{ labels }}',
data__name = '{{ name }}',
data__state = '{{ state }}',
data__storageConfig = '{{ storageConfig }}',
data__updateTime = '{{ updateTime }}',
data__uuid = '{{ uuid }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND environmentsId = '{{ environmentsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples​

Delete an environment.

DELETE FROM google.composer.environments
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND environmentsId = '{{ environmentsId }}' --required
;

Lifecycle Methods​

Check if an upgrade operation on the environment will succeed. In case of problems detailed info can be found in the returned Operation.

EXEC google.composer.environments.check_upgrade
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@environmentsId='{{ environmentsId }}' --required
@@json=
'{
"imageVersion": "{{ imageVersion }}"
}'
;