Skip to main content

deployments

Creates, updates, deletes, gets or lists a deployments resource.

Overview

Namedeployments
TypeResource
Idgoogle.apihub.deployments

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The name of the deployment. Format: projects/{project}/locations/{location}/deployments/{deployment}
apiVersionsarrayOutput 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).
attributesobjectOptional. 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.
createTimestring (google-datetime)Output only. The time at which the deployment was created.
deploymentTypeobjectThe attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues)
descriptionstringOptional. The description of the deployment.
displayNamestringRequired. The display name of the deployment.
documentationobjectOptional. The documentation of the deployment. (id: GoogleCloudApihubV1Documentation)
endpointsarrayRequired. 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.
environmentobjectThe attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues)
managementUrlobjectThe attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues)
resourceUristringRequired. 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.
sloobjectThe attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues)
sourceEnvironmentstringOptional. The environment at source for the deployment. For example: prod, dev, staging, etc.
sourceMetadataarrayOutput only. The list of sources and metadata from the sources of the deployment.
sourceProjectstringOptional. 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.
sourceUriobjectThe attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues)
updateTimestring (google-datetime)Output only. The time at which the deployment was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, deploymentsIdGet details about a deployment and the API versions linked to it.
listselectprojectsId, locationsIdfilter, pageSize, pageTokenList deployment resources in the API hub.
createinsertprojectsId, locationsIddeploymentIdCreate a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.
patchupdateprojectsId, locationsId, deploymentsIdupdateMaskUpdate 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.
deletedeleteprojectsId, locationsId, deploymentsIdDelete 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.

NameDatatypeDescription
deploymentsIdstring
locationsIdstring
projectsIdstring
deploymentIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

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;

INSERT examples

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
;

UPDATE examples

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 a deployment resource in the API hub.

DELETE FROM google.apihub.deployments
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND deploymentsId = '{{ deploymentsId }}' --required;