environments
Creates, updates, deletes, gets or lists an environments
resource.
Overview
Name | environments |
Type | Resource |
Id | google.apigee.environments |
Fields
The following fields are returned by SELECT
queries:
- organizations_environments_get
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Required. Name of the environment. Values must match the regular expression ^[.\\p{Alnum}-_]{1,255}$ |
apiProxyType | string | Optional. API Proxy type supported by the environment. The type can be set when creating the Environment and cannot be changed. |
clientIpResolutionConfig | object | Optional. The algorithm to resolve IP. This will affect Analytics, API Security, and other features that use the client ip. To remove a client ip resolution config, update the field to an empty value. Example: '{ "clientIpResolutionConfig" = {} }' For more information, see: https://cloud.google.com/apigee/docs/api-platform/system-administration/client-ip-resolution. (id: GoogleCloudApigeeV1EnvironmentClientIPResolutionConfig) |
createdAt | string (int64) | Output only. Creation time of this environment as milliseconds since epoch. |
deploymentType | string | Optional. Deployment type supported by the environment. The deployment type can be set when creating the environment and cannot be changed. When you enable archive deployment, you will be prevented from performing a subset of actions within the environment, including: * Managing the deployment of API proxy or shared flow revisions * Creating, updating, or deleting resource files * Creating, updating, or deleting target servers |
description | string | Optional. Description of the environment. |
displayName | string | Optional. Display name for this environment. |
forwardProxyUri | string | Optional. URI of the forward proxy to be applied to the runtime instances in this environment. Must be in the format of {scheme}://{hostname}:{port}. Note that the only supported scheme is "http". The port must be supplied. To remove a forward proxy setting, update the field to an empty value. Note: At this time, PUT operations to add forwardProxyUri to an existing environment fail if the environment has nodeConfig set up. To successfully add the forwardProxyUri setting in this case, include the NodeConfig details with the request. |
hasAttachedFlowHooks | boolean | |
lastModifiedAt | string (int64) | Output only. Last modification time of this environment as milliseconds since epoch. |
nodeConfig | object | Optional. NodeConfig of the environment. (id: GoogleCloudApigeeV1NodeConfig) |
properties | object | Optional. Key-value pairs that may be used for customizing the environment. (id: GoogleCloudApigeeV1Properties) |
state | string | Output only. State of the environment. Values other than ACTIVE means the resource is not ready to use. |
type | string | Optional. EnvironmentType selected for the environment. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
organizations_environments_get | select | organizationsId , environmentsId | Gets environment details. | |
organizations_security_profiles_environments_create | insert | organizationsId , securityProfilesId | CreateSecurityProfileEnvironmentAssociation creates profile environment association i.e. attaches environment to security profile. | |
organizations_environments_create | insert | organizationsId | name | Creates an environment in an organization. |
organizations_environments_update_environment | update | organizationsId , environmentsId | Updates an existing environment. When updating properties, you must pass all existing properties to the API, even if they are not being changed. If you omit properties from the payload, the properties are removed. To get the current list of properties for the environment, use the Get Environment API. Note: Both PUT and POST methods are supported for updating an existing environment. | |
organizations_environments_update | replace | organizationsId , environmentsId | Updates an existing environment. When updating properties, you must pass all existing properties to the API, even if they are not being changed. If you omit properties from the payload, the properties are removed. To get the current list of properties for the environment, use the Get Environment API. Note: Both PUT and POST methods are supported for updating an existing environment. | |
organizations_security_profiles_environments_delete | delete | organizationsId , securityProfilesId , environmentsId | DeleteSecurityProfileEnvironmentAssociation removes profile environment association i.e. detaches environment from security profile. | |
organizations_environments_delete | delete | organizationsId , environmentsId | Deletes an environment from an organization. Warning: You must delete all key value maps and key value entries before you delete an environment. Otherwise, if you re-create the environment the key value map entry operations will encounter encryption/decryption discrepancies. | |
organizations_environments_modify_environment | exec | organizationsId , environmentsId | updateMask | Updates properties for an Apigee environment with patch semantics using a field mask. Note: Not supported for Apigee hybrid. |
organizations_environments_subscribe | exec | organizationsId , environmentsId | Creates a subscription for the environment's Pub/Sub topic. The server will assign a random name for this subscription. The "name" and "push_config" must not be specified. | |
organizations_environments_unsubscribe | exec | organizationsId , environmentsId | Deletes a subscription for the environment's Pub/Sub topic. | |
organizations_security_profiles_environments_compute_environment_scores | exec | organizationsId , securityProfilesId , environmentsId | ComputeEnvironmentScores calculates scores for requested time range for the specified security profile and environment. |
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.
Name | Datatype | Description |
---|---|---|
environmentsId | string | |
organizationsId | string | |
securityProfilesId | string | |
name | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- organizations_environments_get
Gets environment details.
SELECT
name,
apiProxyType,
clientIpResolutionConfig,
createdAt,
deploymentType,
description,
displayName,
forwardProxyUri,
hasAttachedFlowHooks,
lastModifiedAt,
nodeConfig,
properties,
state,
type
FROM google.apigee.environments
WHERE organizationsId = '{{ organizationsId }}' -- required
AND environmentsId = '{{ environmentsId }}' -- required;
INSERT
examples
- organizations_security_profiles_environments_create
- organizations_environments_create
- Manifest
CreateSecurityProfileEnvironmentAssociation creates profile environment association i.e. attaches environment to security profile.
INSERT INTO google.apigee.environments (
data__name,
data__securityProfileRevisionId,
organizationsId,
securityProfilesId
)
SELECT
'{{ name }}',
'{{ securityProfileRevisionId }}',
'{{ organizationsId }}',
'{{ securityProfilesId }}'
RETURNING
name,
attachTime,
securityProfileRevisionId
;
Creates an environment in an organization.
INSERT INTO google.apigee.environments (
data__name,
data__description,
data__properties,
data__displayName,
data__deploymentType,
data__apiProxyType,
data__nodeConfig,
data__forwardProxyUri,
data__type,
data__hasAttachedFlowHooks,
data__clientIpResolutionConfig,
organizationsId,
name
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ properties }}',
'{{ displayName }}',
'{{ deploymentType }}',
'{{ apiProxyType }}',
'{{ nodeConfig }}',
'{{ forwardProxyUri }}',
'{{ type }}',
{{ hasAttachedFlowHooks }},
'{{ clientIpResolutionConfig }}',
'{{ organizationsId }}',
'{{ name }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: environments
props:
- name: organizationsId
value: string
description: Required parameter for the environments resource.
- name: securityProfilesId
value: string
description: Required parameter for the environments resource.
- name: name
value: string
description: >
Required. Name of the environment. Values must match the regular expression `^[.\\p{Alnum}-_]{1,255}$`
- name: securityProfileRevisionId
value: string
description: >
DEPRECATED: DO NOT USE Revision ID of the security profile.
- name: description
value: string
description: >
Optional. Description of the environment.
- name: properties
value: object
description: >
Optional. Key-value pairs that may be used for customizing the environment.
- name: displayName
value: string
description: >
Optional. Display name for this environment.
- name: deploymentType
value: string
description: >
Optional. Deployment type supported by the environment. The deployment type can be set when creating the environment and cannot be changed. When you enable archive deployment, you will be **prevented from performing** a [subset of actions](https://cloud.google.com/apigee/docs/api-platform/local-development/overview#prevented-actions) within the environment, including: * Managing the deployment of API proxy or shared flow revisions * Creating, updating, or deleting resource files * Creating, updating, or deleting target servers
valid_values: ['DEPLOYMENT_TYPE_UNSPECIFIED', 'PROXY', 'ARCHIVE']
- name: apiProxyType
value: string
description: >
Optional. API Proxy type supported by the environment. The type can be set when creating the Environment and cannot be changed.
valid_values: ['API_PROXY_TYPE_UNSPECIFIED', 'PROGRAMMABLE', 'CONFIGURABLE']
- name: nodeConfig
value: object
description: >
Optional. NodeConfig of the environment.
- name: forwardProxyUri
value: string
description: >
Optional. URI of the forward proxy to be applied to the runtime instances in this environment. Must be in the format of {scheme}://{hostname}:{port}. Note that the only supported scheme is "http". The port must be supplied. To remove a forward proxy setting, update the field to an empty value. Note: At this time, PUT operations to add forwardProxyUri to an existing environment fail if the environment has nodeConfig set up. To successfully add the forwardProxyUri setting in this case, include the NodeConfig details with the request.
- name: type
value: string
description: >
Optional. EnvironmentType selected for the environment.
valid_values: ['ENVIRONMENT_TYPE_UNSPECIFIED', 'BASE', 'INTERMEDIATE', 'COMPREHENSIVE']
- name: hasAttachedFlowHooks
value: boolean
- name: clientIpResolutionConfig
value: object
description: >
Optional. The algorithm to resolve IP. This will affect Analytics, API Security, and other features that use the client ip. To remove a client ip resolution config, update the field to an empty value. Example: '{ "clientIpResolutionConfig" = {} }' For more information, see: https://cloud.google.com/apigee/docs/api-platform/system-administration/client-ip-resolution.
- name: name
value: string
UPDATE
examples
- organizations_environments_update_environment
Updates an existing environment. When updating properties, you must pass all existing properties to the API, even if they are not being changed. If you omit properties from the payload, the properties are removed. To get the current list of properties for the environment, use the Get Environment API. Note: Both PUT
and POST
methods are supported for updating an existing environment.
UPDATE google.apigee.environments
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__properties = '{{ properties }}',
data__displayName = '{{ displayName }}',
data__deploymentType = '{{ deploymentType }}',
data__apiProxyType = '{{ apiProxyType }}',
data__nodeConfig = '{{ nodeConfig }}',
data__forwardProxyUri = '{{ forwardProxyUri }}',
data__type = '{{ type }}',
data__hasAttachedFlowHooks = {{ hasAttachedFlowHooks }},
data__clientIpResolutionConfig = '{{ clientIpResolutionConfig }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND environmentsId = '{{ environmentsId }}' --required
RETURNING
name,
apiProxyType,
clientIpResolutionConfig,
createdAt,
deploymentType,
description,
displayName,
forwardProxyUri,
hasAttachedFlowHooks,
lastModifiedAt,
nodeConfig,
properties,
state,
type;
REPLACE
examples
- organizations_environments_update
Updates an existing environment. When updating properties, you must pass all existing properties to the API, even if they are not being changed. If you omit properties from the payload, the properties are removed. To get the current list of properties for the environment, use the Get Environment API. Note: Both PUT
and POST
methods are supported for updating an existing environment.
REPLACE google.apigee.environments
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__properties = '{{ properties }}',
data__displayName = '{{ displayName }}',
data__deploymentType = '{{ deploymentType }}',
data__apiProxyType = '{{ apiProxyType }}',
data__nodeConfig = '{{ nodeConfig }}',
data__forwardProxyUri = '{{ forwardProxyUri }}',
data__type = '{{ type }}',
data__hasAttachedFlowHooks = {{ hasAttachedFlowHooks }},
data__clientIpResolutionConfig = '{{ clientIpResolutionConfig }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND environmentsId = '{{ environmentsId }}' --required
RETURNING
name,
apiProxyType,
clientIpResolutionConfig,
createdAt,
deploymentType,
description,
displayName,
forwardProxyUri,
hasAttachedFlowHooks,
lastModifiedAt,
nodeConfig,
properties,
state,
type;
DELETE
examples
- organizations_security_profiles_environments_delete
- organizations_environments_delete
DeleteSecurityProfileEnvironmentAssociation removes profile environment association i.e. detaches environment from security profile.
DELETE FROM google.apigee.environments
WHERE organizationsId = '{{ organizationsId }}' --required
AND securityProfilesId = '{{ securityProfilesId }}' --required
AND environmentsId = '{{ environmentsId }}' --required;
Deletes an environment from an organization. Warning: You must delete all key value maps and key value entries before you delete an environment. Otherwise, if you re-create the environment the key value map entry operations will encounter encryption/decryption discrepancies.
DELETE FROM google.apigee.environments
WHERE organizationsId = '{{ organizationsId }}' --required
AND environmentsId = '{{ environmentsId }}' --required;
Lifecycle Methods
- organizations_environments_modify_environment
- organizations_environments_subscribe
- organizations_environments_unsubscribe
- organizations_security_profiles_environments_compute_environment_scores
Updates properties for an Apigee environment with patch semantics using a field mask. Note: Not supported for Apigee hybrid.
EXEC google.apigee.environments.organizations_environments_modify_environment
@organizationsId='{{ organizationsId }}' --required,
@environmentsId='{{ environmentsId }}' --required,
@updateMask='{{ updateMask }}'
@@json=
'{
"name": "{{ name }}",
"description": "{{ description }}",
"properties": "{{ properties }}",
"displayName": "{{ displayName }}",
"deploymentType": "{{ deploymentType }}",
"apiProxyType": "{{ apiProxyType }}",
"nodeConfig": "{{ nodeConfig }}",
"forwardProxyUri": "{{ forwardProxyUri }}",
"type": "{{ type }}",
"hasAttachedFlowHooks": {{ hasAttachedFlowHooks }},
"clientIpResolutionConfig": "{{ clientIpResolutionConfig }}"
}';
Creates a subscription for the environment's Pub/Sub topic. The server will assign a random name for this subscription. The "name" and "push_config" must not be specified.
EXEC google.apigee.environments.organizations_environments_subscribe
@organizationsId='{{ organizationsId }}' --required,
@environmentsId='{{ environmentsId }}' --required;
Deletes a subscription for the environment's Pub/Sub topic.
EXEC google.apigee.environments.organizations_environments_unsubscribe
@organizationsId='{{ organizationsId }}' --required,
@environmentsId='{{ environmentsId }}' --required
@@json=
'{
"name": "{{ name }}"
}';
ComputeEnvironmentScores calculates scores for requested time range for the specified security profile and environment.
EXEC google.apigee.environments.organizations_security_profiles_environments_compute_environment_scores
@organizationsId='{{ organizationsId }}' --required,
@securityProfilesId='{{ securityProfilesId }}' --required,
@environmentsId='{{ environmentsId }}' --required
@@json=
'{
"timeRange": "{{ timeRange }}",
"filters": "{{ filters }}",
"pageSize": {{ pageSize }},
"pageToken": "{{ pageToken }}"
}';