deployments
Creates, updates, deletes, gets or lists a deployments resource.
Overview
| Name | deployments |
| Type | Resource |
| Id | google.apihub.deployments |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The name of the deployment. Format: projects/{project}/locations/{location}/deployments/{deployment} |
apiVersions | array | Output only. The API versions linked to this deployment. Note: A particular deployment could be linked to multiple different API versions (of same or different APIs). |
attributes | object | Optional. The list of user defined attributes associated with the deployment resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource. |
createTime | string (google-datetime) | Output only. The time at which the deployment was created. |
deploymentType | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
description | string | Optional. The description of the deployment. |
displayName | string | Required. The display name of the deployment. |
documentation | object | Optional. The documentation of the deployment. (id: GoogleCloudApihubV1Documentation) |
endpoints | array | Required. The endpoints at which this deployment resource is listening for API requests. This could be a list of complete URIs, hostnames or an IP addresses. |
environment | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
managementUrl | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
resourceUri | string | Required. The resource URI identifies the deployment within its gateway. For Apigee gateways, its recommended to use the format: organizations/{org}/environments/{env}/apis/{api}. For ex: if a proxy with name orders is deployed in staging environment of cymbal organization, the resource URI would be: organizations/cymbal/environments/staging/apis/orders. |
slo | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
sourceEnvironment | string | Optional. The environment at source for the deployment. For example: prod, dev, staging, etc. |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the deployment. |
sourceProject | string | Optional. The project to which the deployment belongs. For Google Cloud gateways, this will refer to the project identifier. For others like Edge/OPDK, this will refer to the org identifier. |
sourceUri | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
updateTime | string (google-datetime) | Output only. The time at which the deployment was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The name of the deployment. Format: projects/{project}/locations/{location}/deployments/{deployment} |
apiVersions | array | Output only. The API versions linked to this deployment. Note: A particular deployment could be linked to multiple different API versions (of same or different APIs). |
attributes | object | Optional. The list of user defined attributes associated with the deployment resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource. |
createTime | string (google-datetime) | Output only. The time at which the deployment was created. |
deploymentType | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
description | string | Optional. The description of the deployment. |
displayName | string | Required. The display name of the deployment. |
documentation | object | Optional. The documentation of the deployment. (id: GoogleCloudApihubV1Documentation) |
endpoints | array | Required. The endpoints at which this deployment resource is listening for API requests. This could be a list of complete URIs, hostnames or an IP addresses. |
environment | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
managementUrl | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
resourceUri | string | Required. The resource URI identifies the deployment within its gateway. For Apigee gateways, its recommended to use the format: organizations/{org}/environments/{env}/apis/{api}. For ex: if a proxy with name orders is deployed in staging environment of cymbal organization, the resource URI would be: organizations/cymbal/environments/staging/apis/orders. |
slo | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
sourceEnvironment | string | Optional. The environment at source for the deployment. For example: prod, dev, staging, etc. |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the deployment. |
sourceProject | string | Optional. The project to which the deployment belongs. For Google Cloud gateways, this will refer to the project identifier. For others like Edge/OPDK, this will refer to the org identifier. |
sourceUri | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
updateTime | string (google-datetime) | Output only. The time at which the deployment was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, deploymentsId | Get details about a deployment and the API versions linked to it. | |
list | select | projectsId, locationsId | pageToken, filter, pageSize | List deployment resources in the API hub. |
create | insert | projectsId, locationsId | deploymentId | Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions. |
patch | update | projectsId, locationsId, deploymentsId | updateMask | Update a deployment resource in the API hub. The following fields in the deployment resource can be updated: * display_name * description * documentation * deployment_type * resource_uri * endpoints * slo * environment * attributes * source_project * source_environment * management_url * source_uri The update_mask should be used to specify the fields being updated. |
delete | delete | projectsId, locationsId, deploymentsId | Delete a deployment resource in the API hub. |
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 |
|---|---|---|
deploymentsId | string | |
locationsId | string | |
projectsId | string | |
deploymentId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
Get details about a deployment and the API versions linked to it.
SELECT
name,
apiVersions,
attributes,
createTime,
deploymentType,
description,
displayName,
documentation,
endpoints,
environment,
managementUrl,
resourceUri,
slo,
sourceEnvironment,
sourceMetadata,
sourceProject,
sourceUri,
updateTime
FROM google.apihub.deployments
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND deploymentsId = '{{ deploymentsId }}' -- required
;
List deployment resources in the API hub.
SELECT
name,
apiVersions,
attributes,
createTime,
deploymentType,
description,
displayName,
documentation,
endpoints,
environment,
managementUrl,
resourceUri,
slo,
sourceEnvironment,
sourceMetadata,
sourceProject,
sourceUri,
updateTime
FROM google.apihub.deployments
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- create
- Manifest
Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.
INSERT INTO google.apihub.deployments (
data__sourceUri,
data__environment,
data__resourceUri,
data__managementUrl,
data__name,
data__description,
data__documentation,
data__endpoints,
data__sourceEnvironment,
data__slo,
data__displayName,
data__deploymentType,
data__sourceProject,
data__attributes,
projectsId,
locationsId,
deploymentId
)
SELECT
'{{ sourceUri }}',
'{{ environment }}',
'{{ resourceUri }}',
'{{ managementUrl }}',
'{{ name }}',
'{{ description }}',
'{{ documentation }}',
'{{ endpoints }}',
'{{ sourceEnvironment }}',
'{{ slo }}',
'{{ displayName }}',
'{{ deploymentType }}',
'{{ sourceProject }}',
'{{ attributes }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ deploymentId }}'
RETURNING
name,
apiVersions,
attributes,
createTime,
deploymentType,
description,
displayName,
documentation,
endpoints,
environment,
managementUrl,
resourceUri,
slo,
sourceEnvironment,
sourceMetadata,
sourceProject,
sourceUri,
updateTime
;
# Description fields are for documentation purposes
- name: deployments
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the deployments resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the deployments resource.
- name: sourceUri
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: environment
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: resourceUri
value: "{{ resourceUri }}"
description: |
Required. The resource URI identifies the deployment within its gateway. For Apigee gateways, its recommended to use the format: organizations/{org}/environments/{env}/apis/{api}. For ex: if a proxy with name `orders` is deployed in `staging` environment of `cymbal` organization, the resource URI would be: `organizations/cymbal/environments/staging/apis/orders`.
- name: managementUrl
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: name
value: "{{ name }}"
description: |
Identifier. The name of the deployment. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
- name: description
value: "{{ description }}"
description: |
Optional. The description of the deployment.
- name: documentation
description: |
Optional. The documentation of the deployment.
value:
externalUri: "{{ externalUri }}"
- name: endpoints
value:
- "{{ endpoints }}"
description: |
Required. The endpoints at which this deployment resource is listening for API requests. This could be a list of complete URIs, hostnames or an IP addresses.
- name: sourceEnvironment
value: "{{ sourceEnvironment }}"
description: |
Optional. The environment at source for the deployment. For example: prod, dev, staging, etc.
- name: slo
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: displayName
value: "{{ displayName }}"
description: |
Required. The display name of the deployment.
- name: deploymentType
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: sourceProject
value: "{{ sourceProject }}"
description: |
Optional. The project to which the deployment belongs. For Google Cloud gateways, this will refer to the project identifier. For others like Edge/OPDK, this will refer to the org identifier.
- name: attributes
value: "{{ attributes }}"
description: |
Optional. The list of user defined attributes associated with the deployment resource. The key is the attribute name. It will be of the format: `projects/{project}/locations/{location}/attributes/{attribute}`. The value is the attribute values associated with the resource.
- name: deploymentId
value: "{{ deploymentId }}"
UPDATE examples
- patch
Update a deployment resource in the API hub. The following fields in the deployment resource can be updated: * display_name * description * documentation * deployment_type * resource_uri * endpoints * slo * environment * attributes * source_project * source_environment * management_url * source_uri The update_mask should be used to specify the fields being updated.
UPDATE google.apihub.deployments
SET
data__sourceUri = '{{ sourceUri }}',
data__environment = '{{ environment }}',
data__resourceUri = '{{ resourceUri }}',
data__managementUrl = '{{ managementUrl }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__documentation = '{{ documentation }}',
data__endpoints = '{{ endpoints }}',
data__sourceEnvironment = '{{ sourceEnvironment }}',
data__slo = '{{ slo }}',
data__displayName = '{{ displayName }}',
data__deploymentType = '{{ deploymentType }}',
data__sourceProject = '{{ sourceProject }}',
data__attributes = '{{ attributes }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND deploymentsId = '{{ deploymentsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
apiVersions,
attributes,
createTime,
deploymentType,
description,
displayName,
documentation,
endpoints,
environment,
managementUrl,
resourceUri,
slo,
sourceEnvironment,
sourceMetadata,
sourceProject,
sourceUri,
updateTime;
DELETE examples
- delete
Delete a deployment resource in the API hub.
DELETE FROM google.apihub.deployments
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND deploymentsId = '{{ deploymentsId }}' --required
;