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:

Successful response

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.
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.
restart_web_serverexecprojectsId, locationsId, environmentsIdRestart Airflow web server.
execute_airflow_commandexecprojectsId, locationsId, environmentsIdExecutes Airflow CLI command.
stop_airflow_commandexecprojectsId, locationsId, environmentsIdStops Airflow CLI command execution.
poll_airflow_commandexecprojectsId, locationsId, environmentsIdPolls Airflow CLI command execution and fetches logs.
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.
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.
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.
database_failoverexecprojectsId, locationsId, environmentsIdTriggers database failover (only for highly resilient environments).

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__name,
data__config,
data__uuid,
data__state,
data__createTime,
data__updateTime,
data__labels,
data__storageConfig,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ config }}',
'{{ uuid }}',
'{{ state }}',
'{{ createTime }}',
'{{ updateTime }}',
'{{ labels }}',
'{{ storageConfig }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update an environment.

UPDATE google.composer.environments
SET
data__name = '{{ name }}',
data__config = '{{ config }}',
data__uuid = '{{ uuid }}',
data__state = '{{ state }}',
data__createTime = '{{ createTime }}',
data__updateTime = '{{ updateTime }}',
data__labels = '{{ labels }}',
data__storageConfig = '{{ storageConfig }}'
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

Restart Airflow web server.

EXEC google.composer.environments.restart_web_server 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@environmentsId='{{ environmentsId }}' --required;