Skip to main content

deployments

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

Overview

Namedeployments
TypeResource
Idgoogle.deploymentmanager.deployments

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstring (uint64)
namestringName of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
descriptionstringAn optional user-provided description of the deployment.
fingerprintstring (byte)Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens at a time. The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment.
insertTimestringOutput only. Creation timestamp in RFC3339 text format.
labelsarrayMap of One Platform labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?.
manifeststringOutput only. URL of the manifest representing the last manifest that was successfully deployed. If no manifest has been successfully deployed, this field will be absent.
operationobjectOutput only. The Operation that most recently ran, or is currently running, on this deployment. (id: Operation)
selfLinkstringOutput only. Server defined URL for the resource.
targetobject[Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates. (id: TargetConfiguration)
updateobjectOutput only. If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here. (id: DeploymentUpdate)
updateTimestringOutput only. Update timestamp in RFC3339 text format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, deploymentheader.bypassBillingFilterGets information about a specific deployment.
listselectprojectmaxResults, pageToken, filter, orderByLists all deployments for a given project.
insertinsertprojectpreview, createPolicy, header.bypassBillingFilterCreates a deployment and all of the resources described by the deployment manifest.
patchupdateproject, deploymentcreatePolicy, deletePolicy, preview, header.bypassBillingFilterPatches a deployment and all of the resources described by the deployment manifest.
updatereplaceproject, deploymentcreatePolicy, deletePolicy, preview, header.bypassBillingFilterUpdates a deployment and all of the resources described by the deployment manifest.
deletedeleteproject, deploymentdeletePolicy, header.bypassBillingFilterDeletes a deployment and all of the resources in the deployment.
cancel_previewexecproject, deploymentCancels and removes the preview currently associated with the deployment.
stopexecproject, deploymentStops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.

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
deploymentstring
projectstring
createPolicystring
deletePolicystring
filterstring
header.bypassBillingFilterboolean
maxResultsinteger (uint32)
orderBystring
pageTokenstring
previewboolean

SELECT examples

Gets information about a specific deployment.

SELECT
id,
name,
description,
fingerprint,
insertTime,
labels,
manifest,
operation,
selfLink,
target,
update,
updateTime
FROM google.deploymentmanager.deployments
WHERE project = '{{ project }}' -- required
AND deployment = '{{ deployment }}' -- required
AND header.bypassBillingFilter = '{{ header.bypassBillingFilter }}';

INSERT examples

Creates a deployment and all of the resources described by the deployment manifest.

INSERT INTO google.deploymentmanager.deployments (
data__id,
data__name,
data__description,
data__operation,
data__fingerprint,
data__manifest,
data__update,
data__insertTime,
data__updateTime,
data__target,
data__labels,
data__selfLink,
project,
preview,
createPolicy,
header.bypassBillingFilter
)
SELECT
'{{ id }}',
'{{ name }}',
'{{ description }}',
'{{ operation }}',
'{{ fingerprint }}',
'{{ manifest }}',
'{{ update }}',
'{{ insertTime }}',
'{{ updateTime }}',
'{{ target }}',
'{{ labels }}',
'{{ selfLink }}',
'{{ project }}',
'{{ preview }}',
'{{ createPolicy }}',
'{{ header.bypassBillingFilter }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
selfLinkWithId,
setAutoscalerLinkOperationMetadata,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;

UPDATE examples

Patches a deployment and all of the resources described by the deployment manifest.

UPDATE google.deploymentmanager.deployments
SET
data__id = '{{ id }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__operation = '{{ operation }}',
data__fingerprint = '{{ fingerprint }}',
data__manifest = '{{ manifest }}',
data__update = '{{ update }}',
data__insertTime = '{{ insertTime }}',
data__updateTime = '{{ updateTime }}',
data__target = '{{ target }}',
data__labels = '{{ labels }}',
data__selfLink = '{{ selfLink }}'
WHERE
project = '{{ project }}' --required
AND deployment = '{{ deployment }}' --required
AND createPolicy = '{{ createPolicy}}'
AND deletePolicy = '{{ deletePolicy}}'
AND preview = {{ preview}}
AND header.bypassBillingFilter = {{ header.bypassBillingFilter}}
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
selfLinkWithId,
setAutoscalerLinkOperationMetadata,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;

REPLACE examples

Updates a deployment and all of the resources described by the deployment manifest.

REPLACE google.deploymentmanager.deployments
SET
data__id = '{{ id }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__operation = '{{ operation }}',
data__fingerprint = '{{ fingerprint }}',
data__manifest = '{{ manifest }}',
data__update = '{{ update }}',
data__insertTime = '{{ insertTime }}',
data__updateTime = '{{ updateTime }}',
data__target = '{{ target }}',
data__labels = '{{ labels }}',
data__selfLink = '{{ selfLink }}'
WHERE
project = '{{ project }}' --required
AND deployment = '{{ deployment }}' --required
AND createPolicy = '{{ createPolicy}}'
AND deletePolicy = '{{ deletePolicy}}'
AND preview = {{ preview}}
AND header.bypassBillingFilter = {{ header.bypassBillingFilter}}
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
selfLinkWithId,
setAutoscalerLinkOperationMetadata,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;

DELETE examples

Deletes a deployment and all of the resources in the deployment.

DELETE FROM google.deploymentmanager.deployments
WHERE project = '{{ project }}' --required
AND deployment = '{{ deployment }}' --required
AND deletePolicy = '{{ deletePolicy }}'
AND header.bypassBillingFilter = '{{ header.bypassBillingFilter }}';

Lifecycle Methods

Cancels and removes the preview currently associated with the deployment.

EXEC google.deploymentmanager.deployments.cancel_preview 
@project='{{ project }}' --required,
@deployment='{{ deployment }}' --required
@@json=
'{
"fingerprint": "{{ fingerprint }}"
}';