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
Successful response
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 GCP 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. |
Successful response
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 GCP 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 | filter , pageSize , pageToken | 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 filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
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__name,
data__displayName,
data__description,
data__documentation,
data__deploymentType,
data__resourceUri,
data__endpoints,
data__slo,
data__environment,
data__attributes,
data__managementUrl,
data__sourceUri,
data__sourceProject,
data__sourceEnvironment,
projectsId,
locationsId,
deploymentId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ documentation }}',
'{{ deploymentType }}',
'{{ resourceUri }}',
'{{ endpoints }}',
'{{ slo }}',
'{{ environment }}',
'{{ attributes }}',
'{{ managementUrl }}',
'{{ sourceUri }}',
'{{ sourceProject }}',
'{{ sourceEnvironment }}',
'{{ 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: string
description: Required parameter for the deployments resource.
- name: locationsId
value: string
description: Required parameter for the deployments resource.
- name: name
value: string
description: >
Identifier. The name of the deployment. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
- name: displayName
value: string
description: >
Required. The display name of the deployment.
- name: description
value: string
description: >
Optional. The description of the deployment.
- name: documentation
value: object
description: >
Optional. The documentation of the deployment.
- name: deploymentType
value: object
description: >
The attribute values associated with resource.
- name: resourceUri
value: string
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: endpoints
value: array
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: slo
value: object
description: >
The attribute values associated with resource.
- name: environment
value: object
description: >
The attribute values associated with resource.
- name: attributes
value: object
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: managementUrl
value: object
description: >
The attribute values associated with resource.
- name: sourceUri
value: object
description: >
The attribute values associated with resource.
- name: sourceProject
value: string
description: >
Optional. The project to which the deployment belongs. For GCP gateways, this will refer to the project identifier. For others like Edge/OPDK, this will refer to the org identifier.
- name: sourceEnvironment
value: string
description: >
Optional. The environment at source for the deployment. For example: prod, dev, staging, etc.
- name: deploymentId
value: string
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__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__documentation = '{{ documentation }}',
data__deploymentType = '{{ deploymentType }}',
data__resourceUri = '{{ resourceUri }}',
data__endpoints = '{{ endpoints }}',
data__slo = '{{ slo }}',
data__environment = '{{ environment }}',
data__attributes = '{{ attributes }}',
data__managementUrl = '{{ managementUrl }}',
data__sourceUri = '{{ sourceUri }}',
data__sourceProject = '{{ sourceProject }}',
data__sourceEnvironment = '{{ sourceEnvironment }}'
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;