Skip to content

Commit

Permalink
feat(clouddeploy): update the API
Browse files Browse the repository at this point in the history
#### clouddeploy:v1

The following keys were added:
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.description
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.flatPath
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.httpMethod
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.id
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.parameterOrder
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.parameters.name.description
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.parameters.name.location
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.parameters.name.pattern
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.parameters.name.required
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.parameters.name.type
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.path
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.request.$ref
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.response.$ref
- resources.projects.resources.locations.resources.deliveryPipelines.methods.rollbackTarget.scopes
- schemas.RollbackTargetConfig.description
- schemas.RollbackTargetConfig.id
- schemas.RollbackTargetConfig.properties.rollout.$ref
- schemas.RollbackTargetConfig.properties.rollout.description
- schemas.RollbackTargetConfig.properties.startingPhaseId.description
- schemas.RollbackTargetConfig.properties.startingPhaseId.type
- schemas.RollbackTargetConfig.type
- schemas.RollbackTargetRequest.description
- schemas.RollbackTargetRequest.id
- schemas.RollbackTargetRequest.properties.releaseId.description
- schemas.RollbackTargetRequest.properties.releaseId.type
- schemas.RollbackTargetRequest.properties.rollbackConfig.$ref
- schemas.RollbackTargetRequest.properties.rollbackConfig.description
- schemas.RollbackTargetRequest.properties.rolloutId.description
- schemas.RollbackTargetRequest.properties.rolloutId.type
- schemas.RollbackTargetRequest.properties.rolloutToRollBack.description
- schemas.RollbackTargetRequest.properties.rolloutToRollBack.type
- schemas.RollbackTargetRequest.properties.targetId.description
- schemas.RollbackTargetRequest.properties.targetId.type
- schemas.RollbackTargetRequest.properties.validateOnly.description
- schemas.RollbackTargetRequest.properties.validateOnly.type
- schemas.RollbackTargetRequest.type
- schemas.RollbackTargetResponse.description
- schemas.RollbackTargetResponse.id
- schemas.RollbackTargetResponse.properties.rollbackConfig.$ref
- schemas.RollbackTargetResponse.properties.rollbackConfig.description
- schemas.RollbackTargetResponse.type
- schemas.Rollout.properties.rollbackOfRollout.description
- schemas.Rollout.properties.rollbackOfRollout.readOnly
- schemas.Rollout.properties.rollbackOfRollout.type
- schemas.Rollout.properties.rolledBackByRollouts.description
- schemas.Rollout.properties.rolledBackByRollouts.items.type
- schemas.Rollout.properties.rolledBackByRollouts.readOnly
- schemas.Rollout.properties.rolledBackByRollouts.type
  • Loading branch information
yoshi-automation authored and sofisl committed Sep 22, 2023
1 parent b940b40 commit 60775aa
Show file tree
Hide file tree
Showing 2 changed files with 265 additions and 1 deletion.
100 changes: 99 additions & 1 deletion discovery/clouddeploy-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,34 @@
"https://www.googleapis.com/auth/cloud-platform"
]
},
"rollbackTarget": {
"description": "Creates a `Rollout` to roll back the specified target.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/deliveryPipelines/{deliveryPipelinesId}:rollbackTarget",
"httpMethod": "POST",
"id": "clouddeploy.projects.locations.deliveryPipelines.rollbackTarget",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. The `DeliveryPipeline` for which the rollback `Rollout` should be created. Format should be projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/deliveryPipelines/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:rollbackTarget",
"request": {
"$ref": "RollbackTargetRequest"
},
"response": {
"$ref": "RollbackTargetResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"setIamPolicy": {
"description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/deliveryPipelines/{deliveryPipelinesId}:setIamPolicy",
Expand Down Expand Up @@ -1451,7 +1479,7 @@
}
}
},
"revision": "20230802",
"revision": "20230904",
"rootUrl": "https://clouddeploy.googleapis.com/",
"schemas": {
"AbandonReleaseRequest": {
Expand Down Expand Up @@ -3384,6 +3412,63 @@
"properties": {},
"type": "object"
},
"RollbackTargetConfig": {
"description": "Configs for the Rollback rollout.",
"id": "RollbackTargetConfig",
"properties": {
"rollout": {
"$ref": "Rollout",
"description": "Optional. The rollback `Rollout` to create."
},
"startingPhaseId": {
"description": "Optional. The starting phase ID for the `Rollout`. If unspecified, the `Rollout` will start in the stable phase.",
"type": "string"
}
},
"type": "object"
},
"RollbackTargetRequest": {
"description": "The request object for `RollbackTarget`.",
"id": "RollbackTargetRequest",
"properties": {
"releaseId": {
"description": "Optional. ID of the `Release` to roll back to. If this isn't specified, the previous successful `Rollout` to the specified target will be used to determine the `Release`.",
"type": "string"
},
"rollbackConfig": {
"$ref": "RollbackTargetConfig",
"description": "Optional. Configs for the rollback `Rollout`."
},
"rolloutId": {
"description": "Required. ID of the rollback `Rollout` to create.",
"type": "string"
},
"rolloutToRollBack": {
"description": "Optional. If provided, this must be the latest `Rollout` that is on the `Target`.",
"type": "string"
},
"targetId": {
"description": "Required. ID of the `Target` that is being rolled back.",
"type": "string"
},
"validateOnly": {
"description": "Optional. If set to true, the request is validated and the user is provided with a `RollbackTargetResponse`.",
"type": "boolean"
}
},
"type": "object"
},
"RollbackTargetResponse": {
"description": "The response object from `RollbackTarget`.",
"id": "RollbackTargetResponse",
"properties": {
"rollbackConfig": {
"$ref": "RollbackTargetConfig",
"description": "The config of the rollback `Rollout` created or will be created."
}
},
"type": "object"
},
"Rollout": {
"description": "A `Rollout` resource in the Cloud Deploy API. A `Rollout` contains information around a specific deployment to a `Target`.",
"id": "Rollout",
Expand Down Expand Up @@ -3516,6 +3601,19 @@
"readOnly": true,
"type": "array"
},
"rollbackOfRollout": {
"description": "Output only. Name of the `Rollout` that is rolled back by this `Rollout`. Empty if this `Rollout` wasn't created as a rollback.",
"readOnly": true,
"type": "string"
},
"rolledBackByRollouts": {
"description": "Output only. Names of `Rollouts` that rolled back this `Rollout`.",
"items": {
"type": "string"
},
"readOnly": true,
"type": "array"
},
"state": {
"description": "Output only. Current state of the `Rollout`.",
"enum": [
Expand Down
166 changes: 166 additions & 0 deletions src/apis/clouddeploy/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,57 @@ export namespace clouddeploy_v1 {
* The response object from 'RetryJob'.
*/
export interface Schema$RetryJobResponse {}
/**
* Configs for the Rollback rollout.
*/
export interface Schema$RollbackTargetConfig {
/**
* Optional. The rollback `Rollout` to create.
*/
rollout?: Schema$Rollout;
/**
* Optional. The starting phase ID for the `Rollout`. If unspecified, the `Rollout` will start in the stable phase.
*/
startingPhaseId?: string | null;
}
/**
* The request object for `RollbackTarget`.
*/
export interface Schema$RollbackTargetRequest {
/**
* Optional. ID of the `Release` to roll back to. If this isn't specified, the previous successful `Rollout` to the specified target will be used to determine the `Release`.
*/
releaseId?: string | null;
/**
* Optional. Configs for the rollback `Rollout`.
*/
rollbackConfig?: Schema$RollbackTargetConfig;
/**
* Required. ID of the rollback `Rollout` to create.
*/
rolloutId?: string | null;
/**
* Optional. If provided, this must be the latest `Rollout` that is on the `Target`.
*/
rolloutToRollBack?: string | null;
/**
* Required. ID of the `Target` that is being rolled back.
*/
targetId?: string | null;
/**
* Optional. If set to true, the request is validated and the user is provided with a `RollbackTargetResponse`.
*/
validateOnly?: boolean | null;
}
/**
* The response object from `RollbackTarget`.
*/
export interface Schema$RollbackTargetResponse {
/**
* The config of the rollback `Rollout` created or will be created.
*/
rollbackConfig?: Schema$RollbackTargetConfig;
}
/**
* A `Rollout` resource in the Cloud Deploy API. A `Rollout` contains information around a specific deployment to a `Target`.
*/
Expand Down Expand Up @@ -1496,6 +1547,14 @@ export namespace clouddeploy_v1 {
* Output only. The phases that represent the workflows of this `Rollout`.
*/
phases?: Schema$Phase[];
/**
* Output only. Name of the `Rollout` that is rolled back by this `Rollout`. Empty if this `Rollout` wasn't created as a rollback.
*/
rollbackOfRollout?: string | null;
/**
* Output only. Names of `Rollouts` that rolled back this `Rollout`.
*/
rolledBackByRollouts?: string[] | null;
/**
* Output only. Current state of the `Rollout`.
*/
Expand Down Expand Up @@ -2775,6 +2834,101 @@ export namespace clouddeploy_v1 {
}
}

/**
* Creates a `Rollout` to roll back the specified target.
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
rollbackTarget(
params: Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
rollbackTarget(
params?: Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget,
options?: MethodOptions
): GaxiosPromise<Schema$RollbackTargetResponse>;
rollbackTarget(
params: Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
rollbackTarget(
params: Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget,
options:
| MethodOptions
| BodyResponseCallback<Schema$RollbackTargetResponse>,
callback: BodyResponseCallback<Schema$RollbackTargetResponse>
): void;
rollbackTarget(
params: Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget,
callback: BodyResponseCallback<Schema$RollbackTargetResponse>
): void;
rollbackTarget(
callback: BodyResponseCallback<Schema$RollbackTargetResponse>
): void;
rollbackTarget(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget
| BodyResponseCallback<Schema$RollbackTargetResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$RollbackTargetResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$RollbackTargetResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$RollbackTargetResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl = options.rootUrl || 'https://clouddeploy.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:rollbackTarget').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$RollbackTargetResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$RollbackTargetResponse>(parameters);
}
}

/**
* Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
Expand Down Expand Up @@ -3079,6 +3233,18 @@ export namespace clouddeploy_v1 {
*/
requestBody?: Schema$DeliveryPipeline;
}
export interface Params$Resource$Projects$Locations$Deliverypipelines$Rollbacktarget
extends StandardParameters {
/**
* Required. The `DeliveryPipeline` for which the rollback `Rollout` should be created. Format should be projects/{project_id\}/locations/{location_name\}/deliveryPipelines/{pipeline_name\}.
*/
name?: string;

/**
* Request body metadata
*/
requestBody?: Schema$RollbackTargetRequest;
}
export interface Params$Resource$Projects$Locations$Deliverypipelines$Setiampolicy
extends StandardParameters {
/**
Expand Down

0 comments on commit 60775aa

Please sign in to comment.