// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Compute Engine API Client for Deno * ================================== * * Creates and runs virtual machines on Google Cloud Platform. * * Docs: https://cloud.google.com/compute/ * Source: https://googleapis.deno.dev/v1/compute:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Creates and runs virtual machines on Google Cloud Platform. */ export class Compute { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://compute.googleapis.com/compute/v1/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Retrieves an aggregated list of accelerator types. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async acceleratorTypesAggregatedList(project: string, opts: AcceleratorTypesAggregatedListOptions = {}): Promise { opts = serializeAcceleratorTypesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/acceleratorTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAcceleratorTypeAggregatedList(data); } /** * Returns the specified accelerator type. * * @param acceleratorType Name of the accelerator type to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async acceleratorTypesGet(acceleratorType: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/acceleratorTypes/${ acceleratorType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAcceleratorType(data); } /** * Retrieves a list of accelerator types that are available to the specified * project. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async acceleratorTypesList(project: string, zone: string, opts: AcceleratorTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/acceleratorTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAcceleratorTypeList(data); } /** * Retrieves an aggregated list of addresses. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async addressesAggregatedList(project: string, opts: AddressesAggregatedListOptions = {}): Promise { opts = serializeAddressesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/addresses`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAddressAggregatedList(data); } /** * Deletes the specified address resource. * * @param address Name of the address resource to delete. * @param project Project ID for this request. * @param region Name of the region for this request. */ async addressesDelete(address: string, project: string, region: string, opts: AddressesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/addresses/${ address }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified address resource. * * @param address Name of the address resource to return. * @param project Project ID for this request. * @param region Name of the region for this request. */ async addressesGet(address: string, project: string, region: string): Promise
{ const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/addresses/${ address }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAddress(data); } /** * Creates an address resource in the specified project by using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async addressesInsert(project: string, region: string, req: Address, opts: AddressesInsertOptions = {}): Promise { req = serializeAddress(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/addresses`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of addresses contained within the specified region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async addressesList(project: string, region: string, opts: AddressesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/addresses`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAddressList(data); } /** * Moves the specified address resource. * * @param address Name of the address resource to move. * @param project Source project ID which the Address is moved from. * @param region Name of the region for this request. */ async addressesMove(address: string, project: string, region: string, req: RegionAddressesMoveRequest, opts: AddressesMoveOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/addresses/${ address }/move`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the labels on an Address. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async addressesSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: AddressesSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/addresses/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of autoscalers. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async autoscalersAggregatedList(project: string, opts: AutoscalersAggregatedListOptions = {}): Promise { opts = serializeAutoscalersAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/autoscalers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAutoscalerAggregatedList(data); } /** * Deletes the specified autoscaler. * * @param autoscaler Name of the autoscaler to delete. * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async autoscalersDelete(autoscaler: string, project: string, zone: string, opts: AutoscalersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/autoscalers/${ autoscaler }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified autoscaler resource. * * @param autoscaler Name of the autoscaler to return. * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async autoscalersGet(autoscaler: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/autoscalers/${ autoscaler }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAutoscaler(data); } /** * Creates an autoscaler in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async autoscalersInsert(project: string, zone: string, req: Autoscaler, opts: AutoscalersInsertOptions = {}): Promise { req = serializeAutoscaler(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/autoscalers`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of autoscalers contained within the specified zone. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async autoscalersList(project: string, zone: string, opts: AutoscalersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/autoscalers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAutoscalerList(data); } /** * Updates an autoscaler in the specified project using the data included in * the request. This method supports PATCH semantics and uses the JSON merge * patch format and processing rules. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async autoscalersPatch(project: string, zone: string, req: Autoscaler, opts: AutoscalersPatchOptions = {}): Promise { req = serializeAutoscaler(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/autoscalers`); if (opts.autoscaler !== undefined) { url.searchParams.append("autoscaler", String(opts.autoscaler)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates an autoscaler in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async autoscalersUpdate(project: string, zone: string, req: Autoscaler, opts: AutoscalersUpdateOptions = {}): Promise { req = serializeAutoscaler(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/autoscalers`); if (opts.autoscaler !== undefined) { url.searchParams.append("autoscaler", String(opts.autoscaler)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Adds a key for validating requests with signed URLs for this backend * bucket. * * @param backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendBucketsAddSignedUrlKey(backendBucket: string, project: string, req: SignedUrlKey, opts: BackendBucketsAddSignedUrlKeyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }/addSignedUrlKey`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified BackendBucket resource. * * @param backendBucket Name of the BackendBucket resource to delete. * @param project Project ID for this request. */ async backendBucketsDelete(backendBucket: string, project: string, opts: BackendBucketsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Deletes a key for validating requests with signed URLs for this backend * bucket. * * @param backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendBucketsDeleteSignedUrlKey(backendBucket: string, project: string, opts: BackendBucketsDeleteSignedUrlKeyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }/deleteSignedUrlKey`); if (opts.keyName !== undefined) { url.searchParams.append("keyName", String(opts.keyName)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Returns the specified BackendBucket resource. * * @param backendBucket Name of the BackendBucket resource to return. * @param project Project ID for this request. */ async backendBucketsGet(backendBucket: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendBucket(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async backendBucketsGetIamPolicy(project: string, resource: string, opts: BackendBucketsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a BackendBucket resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async backendBucketsInsert(project: string, req: BackendBucket, opts: BackendBucketsInsertOptions = {}): Promise { req = serializeBackendBucket(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of BackendBucket resources available to the specified * project. * * @param project Project ID for this request. */ async backendBucketsList(project: string, opts: BackendBucketsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendBucketList(data); } /** * Updates the specified BackendBucket resource with the data included in the * request. This method supports PATCH semantics and uses the JSON merge patch * format and processing rules. * * @param backendBucket Name of the BackendBucket resource to patch. * @param project Project ID for this request. */ async backendBucketsPatch(backendBucket: string, project: string, req: BackendBucket, opts: BackendBucketsPatchOptions = {}): Promise { req = serializeBackendBucket(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the edge security policy for the specified backend bucket. * * @param backendBucket Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendBucketsSetEdgeSecurityPolicy(backendBucket: string, project: string, req: SecurityPolicyReference, opts: BackendBucketsSetEdgeSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }/setEdgeSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async backendBucketsSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async backendBucketsTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Updates the specified BackendBucket resource with the data included in the * request. * * @param backendBucket Name of the BackendBucket resource to update. * @param project Project ID for this request. */ async backendBucketsUpdate(backendBucket: string, project: string, req: BackendBucket, opts: BackendBucketsUpdateOptions = {}): Promise { req = serializeBackendBucket(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendBuckets/${ backendBucket }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Adds a key for validating requests with signed URLs for this backend * service. * * @param backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendServicesAddSignedUrlKey(backendService: string, project: string, req: SignedUrlKey, opts: BackendServicesAddSignedUrlKeyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }/addSignedUrlKey`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of all BackendService resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async backendServicesAggregatedList(project: string, opts: BackendServicesAggregatedListOptions = {}): Promise { opts = serializeBackendServicesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/backendServices`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendServiceAggregatedList(data); } /** * Deletes the specified BackendService resource. * * @param backendService Name of the BackendService resource to delete. * @param project Project ID for this request. */ async backendServicesDelete(backendService: string, project: string, opts: BackendServicesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Deletes a key for validating requests with signed URLs for this backend * service. * * @param backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendServicesDeleteSignedUrlKey(backendService: string, project: string, opts: BackendServicesDeleteSignedUrlKeyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }/deleteSignedUrlKey`); if (opts.keyName !== undefined) { url.searchParams.append("keyName", String(opts.keyName)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Returns the specified BackendService resource. * * @param backendService Name of the BackendService resource to return. * @param project Project ID for this request. */ async backendServicesGet(backendService: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendService(data); } /** * Gets the most recent health check results for this BackendService. Example * request body: { "group": * "/zones/us-east1-b/instanceGroups/lb-backend-example" } * * @param backendService Name of the BackendService resource to which the queried instance belongs. */ async backendServicesGetHealth(backendService: string, project: string, req: ResourceGroupReference): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }/getHealth`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as BackendServiceGroupHealth; } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async backendServicesGetIamPolicy(project: string, resource: string, opts: BackendServicesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a BackendService resource in the specified project using the data * included in the request. For more information, see Backend services * overview . * * @param project Project ID for this request. */ async backendServicesInsert(project: string, req: BackendService, opts: BackendServicesInsertOptions = {}): Promise { req = serializeBackendService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of BackendService resources available to the specified * project. * * @param project Project ID for this request. */ async backendServicesList(project: string, opts: BackendServicesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendServiceList(data); } /** * Retrieves a list of all usable backend services in the specified project. * * @param project Project ID for this request. */ async backendServicesListUsable(project: string, opts: BackendServicesListUsableOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/listUsable`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendServiceListUsable(data); } /** * Patches the specified BackendService resource with the data included in * the request. For more information, see Backend services overview. This * method supports PATCH semantics and uses the JSON merge patch format and * processing rules. * * @param backendService Name of the BackendService resource to patch. * @param project Project ID for this request. */ async backendServicesPatch(backendService: string, project: string, req: BackendService, opts: BackendServicesPatchOptions = {}): Promise { req = serializeBackendService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the edge security policy for the specified backend service. * * @param backendService Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendServicesSetEdgeSecurityPolicy(backendService: string, project: string, req: SecurityPolicyReference, opts: BackendServicesSetEdgeSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }/setEdgeSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async backendServicesSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the Google Cloud Armor security policy for the specified backend * service. For more information, see Google Cloud Armor Overview * * @param backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. * @param project Project ID for this request. */ async backendServicesSetSecurityPolicy(backendService: string, project: string, req: SecurityPolicyReference, opts: BackendServicesSetSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }/setSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async backendServicesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Updates the specified BackendService resource with the data included in * the request. For more information, see Backend services overview. * * @param backendService Name of the BackendService resource to update. * @param project Project ID for this request. */ async backendServicesUpdate(backendService: string, project: string, req: BackendService, opts: BackendServicesUpdateOptions = {}): Promise { req = serializeBackendService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/backendServices/${ backendService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Adds existing resource policies to a disk. You can only add one policy * which will be applied to this disk for scheduling snapshot creation. * * @param disk The disk name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksAddResourcePolicies(disk: string, project: string, zone: string, req: DisksAddResourcePoliciesRequest, opts: DisksAddResourcePoliciesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }/addResourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of persistent disks. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async disksAggregatedList(project: string, opts: DisksAggregatedListOptions = {}): Promise { opts = serializeDisksAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/disks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskAggregatedList(data); } /** * Bulk create a set of disks. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksBulkInsert(project: string, zone: string, req: BulkInsertDiskResource, opts: DisksBulkInsertOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/bulkInsert`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Creates a snapshot of a specified persistent disk. For regular snapshot * creation, consider using snapshots.insert instead, as that method supports * more features, such as creating snapshots in a project different from the * source disk project. * * @param disk Name of the persistent disk to snapshot. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksCreateSnapshot(disk: string, project: string, zone: string, req: Snapshot, opts: DisksCreateSnapshotOptions = {}): Promise { req = serializeSnapshot(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }/createSnapshot`); if (opts.guestFlush !== undefined) { url.searchParams.append("guestFlush", String(opts.guestFlush)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified persistent disk. Deleting a disk removes its data * permanently and is irreversible. However, deleting a disk does not delete * any snapshots previously made from the disk. You must separately delete * snapshots. * * @param disk Name of the persistent disk to delete. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksDelete(disk: string, project: string, zone: string, opts: DisksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified persistent disk. * * @param disk Name of the persistent disk to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksGet(disk: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDisk(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async disksGetIamPolicy(project: string, resource: string, zone: string, opts: DisksGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a persistent disk in the specified project using the data in the * request. You can create a disk from a source (sourceImage, sourceSnapshot, * or sourceDisk) or create an empty 500 GB data disk by omitting all * properties. You can also create a disk that is larger than the default size * by specifying the sizeGb property. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksInsert(project: string, zone: string, req: Disk, opts: DisksInsertOptions = {}): Promise { req = serializeDisk(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceImage !== undefined) { url.searchParams.append("sourceImage", String(opts.sourceImage)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of persistent disks contained within the specified zone. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksList(project: string, zone: string, opts: DisksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskList(data); } /** * Removes resource policies from a disk. * * @param disk The disk name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksRemoveResourcePolicies(disk: string, project: string, zone: string, req: DisksRemoveResourcePoliciesRequest, opts: DisksRemoveResourcePoliciesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }/removeResourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Resizes the specified persistent disk. You can only increase the size of * the disk. * * @param disk The name of the persistent disk. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksResize(disk: string, project: string, zone: string, req: DisksResizeRequest, opts: DisksResizeOptions = {}): Promise { req = serializeDisksResizeRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }/resize`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async disksSetIamPolicy(project: string, resource: string, zone: string, req: ZoneSetPolicyRequest): Promise { req = serializeZoneSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the labels on a disk. To learn more about labels, read the Labeling * Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async disksSetLabels(project: string, resource: string, zone: string, req: ZoneSetLabelsRequest, opts: DisksSetLabelsOptions = {}): Promise { req = serializeZoneSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Starts asynchronous replication. Must be invoked on the primary disk. * * @param disk The name of the persistent disk. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksStartAsyncReplication(disk: string, project: string, zone: string, req: DisksStartAsyncReplicationRequest, opts: DisksStartAsyncReplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }/startAsyncReplication`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Stops asynchronous replication. Can be invoked either on the primary or on * the secondary disk. * * @param disk The name of the persistent disk. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksStopAsyncReplication(disk: string, project: string, zone: string, opts: DisksStopAsyncReplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }/stopAsyncReplication`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Stops asynchronous replication for a consistency group of disks. Can be * invoked either in the primary or secondary scope. * * @param project Project ID for this request. * @param zone The name of the zone for this request. This must be the zone of the primary or secondary disks in the consistency group. */ async disksStopGroupAsyncReplication(project: string, zone: string, req: DisksStopGroupAsyncReplicationResource, opts: DisksStopGroupAsyncReplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/stopGroupAsyncReplication`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async disksTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Updates the specified disk with the data included in the request. The * update is performed only on selected fields included as part of * update-mask. Only the following fields can be modified: user_license. * * @param disk The disk name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async disksUpdate(disk: string, project: string, zone: string, req: Disk, opts: DisksUpdateOptions = {}): Promise { req = serializeDisk(req); opts = serializeDisksUpdateOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/disks/${ disk }`); if (opts.paths !== undefined) { url.searchParams.append("paths", String(opts.paths)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of disk types. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async diskTypesAggregatedList(project: string, opts: DiskTypesAggregatedListOptions = {}): Promise { opts = serializeDiskTypesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/diskTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskTypeAggregatedList(data); } /** * Returns the specified disk type. * * @param diskType Name of the disk type to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async diskTypesGet(diskType: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/diskTypes/${ diskType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskType(data); } /** * Retrieves a list of disk types available to the specified project. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async diskTypesList(project: string, zone: string, opts: DiskTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/diskTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskTypeList(data); } /** * Deletes the specified externalVpnGateway. * * @param externalVpnGateway Name of the externalVpnGateways to delete. * @param project Project ID for this request. */ async externalVpnGatewaysDelete(externalVpnGateway: string, project: string, opts: ExternalVpnGatewaysDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/externalVpnGateways/${ externalVpnGateway }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified externalVpnGateway. Get a list of available * externalVpnGateways by making a list() request. * * @param externalVpnGateway Name of the externalVpnGateway to return. * @param project Project ID for this request. */ async externalVpnGatewaysGet(externalVpnGateway: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/externalVpnGateways/${ externalVpnGateway }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeExternalVpnGateway(data); } /** * Creates a ExternalVpnGateway in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async externalVpnGatewaysInsert(project: string, req: ExternalVpnGateway, opts: ExternalVpnGatewaysInsertOptions = {}): Promise { req = serializeExternalVpnGateway(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/externalVpnGateways`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of ExternalVpnGateway available to the specified * project. * * @param project Project ID for this request. */ async externalVpnGatewaysList(project: string, opts: ExternalVpnGatewaysListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/externalVpnGateways`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeExternalVpnGatewayList(data); } /** * Sets the labels on an ExternalVpnGateway. To learn more about labels, read * the Labeling Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async externalVpnGatewaysSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/externalVpnGateways/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async externalVpnGatewaysTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/externalVpnGateways/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Inserts an association for the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesAddAssociation(firewallPolicy: string, req: FirewallPolicyAssociation, opts: FirewallPoliciesAddAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/addAssociation`); if (opts.replaceExistingAssociation !== undefined) { url.searchParams.append("replaceExistingAssociation", String(opts.replaceExistingAssociation)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Inserts a rule into a firewall policy. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesAddRule(firewallPolicy: string, req: FirewallPolicyRule, opts: FirewallPoliciesAddRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/addRule`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Copies rules to the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesCloneRules(firewallPolicy: string, opts: FirewallPoliciesCloneRulesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/cloneRules`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceFirewallPolicy !== undefined) { url.searchParams.append("sourceFirewallPolicy", String(opts.sourceFirewallPolicy)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified policy. * * @param firewallPolicy Name of the firewall policy to delete. */ async firewallPoliciesDelete(firewallPolicy: string, opts: FirewallPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to get. */ async firewallPoliciesGet(firewallPolicy: string): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallPolicy(data); } /** * Gets an association with the specified name. * * @param firewallPolicy Name of the firewall policy to which the queried rule belongs. */ async firewallPoliciesGetAssociation(firewallPolicy: string, opts: FirewallPoliciesGetAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/getAssociation`); if (opts.name !== undefined) { url.searchParams.append("name", String(opts.name)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPolicyAssociation; } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param resource Name or id of the resource for this request. */ async firewallPoliciesGetIamPolicy(resource: string, opts: FirewallPoliciesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Gets a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to which the queried rule belongs. */ async firewallPoliciesGetRule(firewallPolicy: string, opts: FirewallPoliciesGetRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/getRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPolicyRule; } /** * Creates a new policy in the specified project using the data included in * the request. * */ async firewallPoliciesInsert(req: FirewallPolicy, opts: FirewallPoliciesInsertOptions = {}): Promise { req = serializeFirewallPolicy(req); const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies`); if (opts.parentId !== undefined) { url.searchParams.append("parentId", String(opts.parentId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists all the policies that have been configured for the specified folder * or organization. * */ async firewallPoliciesList(opts: FirewallPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.parentId !== undefined) { url.searchParams.append("parentId", String(opts.parentId)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallPolicyList(data); } /** * Lists associations of a specified target, i.e., organization or folder. * */ async firewallPoliciesListAssociations(opts: FirewallPoliciesListAssociationsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/listAssociations`); if (opts.targetResource !== undefined) { url.searchParams.append("targetResource", String(opts.targetResource)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPoliciesListAssociationsResponse; } /** * Moves the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesMove(firewallPolicy: string, opts: FirewallPoliciesMoveOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/move`); if (opts.parentId !== undefined) { url.searchParams.append("parentId", String(opts.parentId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Patches the specified policy with the data included in the request. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesPatch(firewallPolicy: string, req: FirewallPolicy, opts: FirewallPoliciesPatchOptions = {}): Promise { req = serializeFirewallPolicy(req); const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Patches a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesPatchRule(firewallPolicy: string, req: FirewallPolicyRule, opts: FirewallPoliciesPatchRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/patchRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Removes an association for the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesRemoveAssociation(firewallPolicy: string, opts: FirewallPoliciesRemoveAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/removeAssociation`); if (opts.name !== undefined) { url.searchParams.append("name", String(opts.name)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to update. */ async firewallPoliciesRemoveRule(firewallPolicy: string, opts: FirewallPoliciesRemoveRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ firewallPolicy }/removeRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param resource Name or id of the resource for this request. */ async firewallPoliciesSetIamPolicy(resource: string, req: GlobalOrganizationSetPolicyRequest): Promise { req = serializeGlobalOrganizationSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param resource Name or id of the resource for this request. */ async firewallPoliciesTestIamPermissions(resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}locations/global/firewallPolicies/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Deletes the specified firewall. * * @param firewall Name of the firewall rule to delete. * @param project Project ID for this request. */ async firewallsDelete(firewall: string, project: string, opts: FirewallsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewalls/${ firewall }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified firewall. * * @param firewall Name of the firewall rule to return. * @param project Project ID for this request. */ async firewallsGet(firewall: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewalls/${ firewall }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewall(data); } /** * Creates a firewall rule in the specified project using the data included * in the request. * * @param project Project ID for this request. */ async firewallsInsert(project: string, req: Firewall, opts: FirewallsInsertOptions = {}): Promise { req = serializeFirewall(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewalls`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of firewall rules available to the specified project. * * @param project Project ID for this request. */ async firewallsList(project: string, opts: FirewallsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewalls`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallList(data); } /** * Updates the specified firewall rule with the data included in the request. * This method supports PATCH semantics and uses the JSON merge patch format * and processing rules. * * @param firewall Name of the firewall rule to patch. * @param project Project ID for this request. */ async firewallsPatch(firewall: string, project: string, req: Firewall, opts: FirewallsPatchOptions = {}): Promise { req = serializeFirewall(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewalls/${ firewall }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates the specified firewall rule with the data included in the request. * Note that all fields will be updated if using PUT, even fields that are not * specified. To update individual fields, please use PATCH instead. * * @param firewall Name of the firewall rule to update. * @param project Project ID for this request. */ async firewallsUpdate(firewall: string, project: string, req: Firewall, opts: FirewallsUpdateOptions = {}): Promise { req = serializeFirewall(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewalls/${ firewall }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of forwarding rules. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async forwardingRulesAggregatedList(project: string, opts: ForwardingRulesAggregatedListOptions = {}): Promise { opts = serializeForwardingRulesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/forwardingRules`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeForwardingRuleAggregatedList(data); } /** * Deletes the specified ForwardingRule resource. * * @param forwardingRule Name of the ForwardingRule resource to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async forwardingRulesDelete(forwardingRule: string, project: string, region: string, opts: ForwardingRulesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules/${ forwardingRule }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified ForwardingRule resource. * * @param forwardingRule Name of the ForwardingRule resource to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async forwardingRulesGet(forwardingRule: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules/${ forwardingRule }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeForwardingRule(data); } /** * Creates a ForwardingRule resource in the specified project and region * using the data included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async forwardingRulesInsert(project: string, region: string, req: ForwardingRule, opts: ForwardingRulesInsertOptions = {}): Promise { req = serializeForwardingRule(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of ForwardingRule resources available to the specified * project and region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async forwardingRulesList(project: string, region: string, opts: ForwardingRulesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeForwardingRuleList(data); } /** * Updates the specified forwarding rule with the data included in the * request. This method supports PATCH semantics and uses the JSON merge patch * format and processing rules. Currently, you can only patch the network_tier * field. * * @param forwardingRule Name of the ForwardingRule resource to patch. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async forwardingRulesPatch(forwardingRule: string, project: string, region: string, req: ForwardingRule, opts: ForwardingRulesPatchOptions = {}): Promise { req = serializeForwardingRule(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules/${ forwardingRule }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the labels on the specified resource. To learn more about labels, * read the Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async forwardingRulesSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: ForwardingRulesSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes target URL for forwarding rule. The new target should be of the * same type as the old target. * * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async forwardingRulesSetTarget(forwardingRule: string, project: string, region: string, req: TargetReference, opts: ForwardingRulesSetTargetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/forwardingRules/${ forwardingRule }/setTarget`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified address resource. * * @param address Name of the address resource to delete. * @param project Project ID for this request. */ async globalAddressesDelete(address: string, project: string, opts: GlobalAddressesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/addresses/${ address }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified address resource. * * @param address Name of the address resource to return. * @param project Project ID for this request. */ async globalAddressesGet(address: string, project: string): Promise
{ const url = new URL(`${this.#baseUrl}projects/${ project }/global/addresses/${ address }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAddress(data); } /** * Creates an address resource in the specified project by using the data * included in the request. * * @param project Project ID for this request. */ async globalAddressesInsert(project: string, req: Address, opts: GlobalAddressesInsertOptions = {}): Promise { req = serializeAddress(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/addresses`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of global addresses. * * @param project Project ID for this request. */ async globalAddressesList(project: string, opts: GlobalAddressesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/addresses`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAddressList(data); } /** * Moves the specified address resource from one project to another project. * * @param address Name of the address resource to move. * @param project Source project ID which the Address is moved from. */ async globalAddressesMove(address: string, project: string, req: GlobalAddressesMoveRequest, opts: GlobalAddressesMoveOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/addresses/${ address }/move`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the labels on a GlobalAddress. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async globalAddressesSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/addresses/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified GlobalForwardingRule resource. * * @param forwardingRule Name of the ForwardingRule resource to delete. * @param project Project ID for this request. */ async globalForwardingRulesDelete(forwardingRule: string, project: string, opts: GlobalForwardingRulesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules/${ forwardingRule }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified GlobalForwardingRule resource. Gets a list of * available forwarding rules by making a list() request. * * @param forwardingRule Name of the ForwardingRule resource to return. * @param project Project ID for this request. */ async globalForwardingRulesGet(forwardingRule: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules/${ forwardingRule }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeForwardingRule(data); } /** * Creates a GlobalForwardingRule resource in the specified project using the * data included in the request. * * @param project Project ID for this request. */ async globalForwardingRulesInsert(project: string, req: ForwardingRule, opts: GlobalForwardingRulesInsertOptions = {}): Promise { req = serializeForwardingRule(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of GlobalForwardingRule resources available to the * specified project. * * @param project Project ID for this request. */ async globalForwardingRulesList(project: string, opts: GlobalForwardingRulesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeForwardingRuleList(data); } /** * Updates the specified forwarding rule with the data included in the * request. This method supports PATCH semantics and uses the JSON merge patch * format and processing rules. Currently, you can only patch the network_tier * field. * * @param forwardingRule Name of the ForwardingRule resource to patch. * @param project Project ID for this request. */ async globalForwardingRulesPatch(forwardingRule: string, project: string, req: ForwardingRule, opts: GlobalForwardingRulesPatchOptions = {}): Promise { req = serializeForwardingRule(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules/${ forwardingRule }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the labels on the specified resource. To learn more about labels, * read the Labeling resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async globalForwardingRulesSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes target URL for the GlobalForwardingRule resource. The new target * should be of the same type as the old target. * * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param project Project ID for this request. */ async globalForwardingRulesSetTarget(forwardingRule: string, project: string, req: TargetReference, opts: GlobalForwardingRulesSetTargetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/forwardingRules/${ forwardingRule }/setTarget`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Attach a network endpoint to the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. * @param project Project ID for this request. */ async globalNetworkEndpointGroupsAttachNetworkEndpoints(networkEndpointGroup: string, project: string, req: GlobalNetworkEndpointGroupsAttachEndpointsRequest, opts: GlobalNetworkEndpointGroupsAttachNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups/${ networkEndpointGroup }/attachNetworkEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified network endpoint group.Note that the NEG cannot be * deleted if there are backend services referencing it. * * @param networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. * @param project Project ID for this request. */ async globalNetworkEndpointGroupsDelete(networkEndpointGroup: string, project: string, opts: GlobalNetworkEndpointGroupsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups/${ networkEndpointGroup }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Detach the network endpoint from the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. * @param project Project ID for this request. */ async globalNetworkEndpointGroupsDetachNetworkEndpoints(networkEndpointGroup: string, project: string, req: GlobalNetworkEndpointGroupsDetachEndpointsRequest, opts: GlobalNetworkEndpointGroupsDetachNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups/${ networkEndpointGroup }/detachNetworkEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. * @param project Project ID for this request. */ async globalNetworkEndpointGroupsGet(networkEndpointGroup: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups/${ networkEndpointGroup }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroup(data); } /** * Creates a network endpoint group in the specified project using the * parameters that are included in the request. * * @param project Project ID for this request. */ async globalNetworkEndpointGroupsInsert(project: string, req: NetworkEndpointGroup, opts: GlobalNetworkEndpointGroupsInsertOptions = {}): Promise { req = serializeNetworkEndpointGroup(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of network endpoint groups that are located in the * specified project. * * @param project Project ID for this request. */ async globalNetworkEndpointGroupsList(project: string, opts: GlobalNetworkEndpointGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroupList(data); } /** * Lists the network endpoints in the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. * @param project Project ID for this request. */ async globalNetworkEndpointGroupsListNetworkEndpoints(networkEndpointGroup: string, project: string, opts: GlobalNetworkEndpointGroupsListNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networkEndpointGroups/${ networkEndpointGroup }/listNetworkEndpoints`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return data as NetworkEndpointGroupsListNetworkEndpoints; } /** * Retrieves an aggregated list of all operations. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async globalOperationsAggregatedList(project: string, opts: GlobalOperationsAggregatedListOptions = {}): Promise { opts = serializeGlobalOperationsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperationAggregatedList(data); } /** * Deletes the specified Operations resource. * * @param operation Name of the Operations resource to delete, or its unique numeric identifier. * @param project Project ID for this request. */ async globalOperationsDelete(operation: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/operations/${ operation }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Retrieves the specified Operations resource. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. * @param project Project ID for this request. */ async globalOperationsGet(operation: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/operations/${ operation }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperation(data); } /** * Retrieves a list of Operation resources contained within the specified * project. * * @param project Project ID for this request. */ async globalOperationsList(project: string, opts: GlobalOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperationList(data); } /** * Waits for the specified Operation resource to return as `DONE` or for the * request to approach the 2 minute deadline, and retrieves the specified * Operation resource. This method differs from the `GET` method in that it * waits for no more than the default deadline (2 minutes) and then returns * the current state of the operation, which might be `DONE` or still in * progress. This method is called on a best-effort basis. Specifically: - In * uncommon cases, when the server is overloaded, the request might return * before the default deadline is reached, or might return after zero seconds. * - If the default deadline is reached, there is no guarantee that the * operation is actually done when the method returns. Be prepared to retry if * the operation is not `DONE`. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. * @param project Project ID for this request. */ async globalOperationsWait(operation: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/operations/${ operation }/wait`); const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified Operations resource. * * @param operation Name of the Operations resource to delete, or its unique numeric identifier. */ async globalOrganizationOperationsDelete(operation: string, opts: GlobalOrganizationOperationsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/operations/${ operation }`); if (opts.parentId !== undefined) { url.searchParams.append("parentId", String(opts.parentId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Retrieves the specified Operations resource. Gets a list of operations by * making a `list()` request. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. */ async globalOrganizationOperationsGet(operation: string, opts: GlobalOrganizationOperationsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/operations/${ operation }`); if (opts.parentId !== undefined) { url.searchParams.append("parentId", String(opts.parentId)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperation(data); } /** * Retrieves a list of Operation resources contained within the specified * organization. * */ async globalOrganizationOperationsList(opts: GlobalOrganizationOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}locations/global/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.parentId !== undefined) { url.searchParams.append("parentId", String(opts.parentId)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperationList(data); } /** * Deletes the specified global PublicDelegatedPrefix. * * @param project Project ID for this request. * @param publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to delete. */ async globalPublicDelegatedPrefixesDelete(project: string, publicDelegatedPrefix: string, opts: GlobalPublicDelegatedPrefixesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicDelegatedPrefixes/${ publicDelegatedPrefix }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified global PublicDelegatedPrefix resource. * * @param project Project ID for this request. * @param publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to return. */ async globalPublicDelegatedPrefixesGet(project: string, publicDelegatedPrefix: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicDelegatedPrefixes/${ publicDelegatedPrefix }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicDelegatedPrefix(data); } /** * Creates a global PublicDelegatedPrefix in the specified project using the * parameters that are included in the request. * * @param project Project ID for this request. */ async globalPublicDelegatedPrefixesInsert(project: string, req: PublicDelegatedPrefix, opts: GlobalPublicDelegatedPrefixesInsertOptions = {}): Promise { req = serializePublicDelegatedPrefix(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicDelegatedPrefixes`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the global PublicDelegatedPrefixes for a project. * * @param project Project ID for this request. */ async globalPublicDelegatedPrefixesList(project: string, opts: GlobalPublicDelegatedPrefixesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicDelegatedPrefixes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicDelegatedPrefixList(data); } /** * Patches the specified global PublicDelegatedPrefix resource with the data * included in the request. This method supports PATCH semantics and uses JSON * merge patch format and processing rules. * * @param project Project ID for this request. * @param publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to patch. */ async globalPublicDelegatedPrefixesPatch(project: string, publicDelegatedPrefix: string, req: PublicDelegatedPrefix, opts: GlobalPublicDelegatedPrefixesPatchOptions = {}): Promise { req = serializePublicDelegatedPrefix(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicDelegatedPrefixes/${ publicDelegatedPrefix }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves the list of all HealthCheck resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async healthChecksAggregatedList(project: string, opts: HealthChecksAggregatedListOptions = {}): Promise { opts = serializeHealthChecksAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/healthChecks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthChecksAggregatedList(data); } /** * Deletes the specified HealthCheck resource. * * @param healthCheck Name of the HealthCheck resource to delete. * @param project Project ID for this request. */ async healthChecksDelete(healthCheck: string, project: string, opts: HealthChecksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/healthChecks/${ healthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified HealthCheck resource. * * @param healthCheck Name of the HealthCheck resource to return. * @param project Project ID for this request. */ async healthChecksGet(healthCheck: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/healthChecks/${ healthCheck }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthCheck(data); } /** * Creates a HealthCheck resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async healthChecksInsert(project: string, req: HealthCheck, opts: HealthChecksInsertOptions = {}): Promise { req = serializeHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/healthChecks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of HealthCheck resources available to the specified * project. * * @param project Project ID for this request. */ async healthChecksList(project: string, opts: HealthChecksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/healthChecks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthCheckList(data); } /** * Updates a HealthCheck resource in the specified project using the data * included in the request. This method supports PATCH semantics and uses the * JSON merge patch format and processing rules. * * @param healthCheck Name of the HealthCheck resource to patch. * @param project Project ID for this request. */ async healthChecksPatch(healthCheck: string, project: string, req: HealthCheck, opts: HealthChecksPatchOptions = {}): Promise { req = serializeHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/healthChecks/${ healthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates a HealthCheck resource in the specified project using the data * included in the request. * * @param healthCheck Name of the HealthCheck resource to update. * @param project Project ID for this request. */ async healthChecksUpdate(healthCheck: string, project: string, req: HealthCheck, opts: HealthChecksUpdateOptions = {}): Promise { req = serializeHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/healthChecks/${ healthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Deletes the specified HttpHealthCheck resource. * * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @param project Project ID for this request. */ async httpHealthChecksDelete(httpHealthCheck: string, project: string, opts: HttpHealthChecksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpHealthChecks/${ httpHealthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified HttpHealthCheck resource. * * @param httpHealthCheck Name of the HttpHealthCheck resource to return. * @param project Project ID for this request. */ async httpHealthChecksGet(httpHealthCheck: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpHealthChecks/${ httpHealthCheck }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpHealthCheck(data); } /** * Creates a HttpHealthCheck resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async httpHealthChecksInsert(project: string, req: HttpHealthCheck, opts: HttpHealthChecksInsertOptions = {}): Promise { req = serializeHttpHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpHealthChecks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of HttpHealthCheck resources available to the specified * project. * * @param project Project ID for this request. */ async httpHealthChecksList(project: string, opts: HttpHealthChecksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpHealthChecks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpHealthCheckList(data); } /** * Updates a HttpHealthCheck resource in the specified project using the data * included in the request. This method supports PATCH semantics and uses the * JSON merge patch format and processing rules. * * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. * @param project Project ID for this request. */ async httpHealthChecksPatch(httpHealthCheck: string, project: string, req: HttpHealthCheck, opts: HttpHealthChecksPatchOptions = {}): Promise { req = serializeHttpHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpHealthChecks/${ httpHealthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates a HttpHealthCheck resource in the specified project using the data * included in the request. * * @param httpHealthCheck Name of the HttpHealthCheck resource to update. * @param project Project ID for this request. */ async httpHealthChecksUpdate(httpHealthCheck: string, project: string, req: HttpHealthCheck, opts: HttpHealthChecksUpdateOptions = {}): Promise { req = serializeHttpHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpHealthChecks/${ httpHealthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Deletes the specified HttpsHealthCheck resource. * * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. * @param project Project ID for this request. */ async httpsHealthChecksDelete(httpsHealthCheck: string, project: string, opts: HttpsHealthChecksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpsHealthChecks/${ httpsHealthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified HttpsHealthCheck resource. * * @param httpsHealthCheck Name of the HttpsHealthCheck resource to return. * @param project Project ID for this request. */ async httpsHealthChecksGet(httpsHealthCheck: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpsHealthChecks/${ httpsHealthCheck }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpsHealthCheck(data); } /** * Creates a HttpsHealthCheck resource in the specified project using the * data included in the request. * * @param project Project ID for this request. */ async httpsHealthChecksInsert(project: string, req: HttpsHealthCheck, opts: HttpsHealthChecksInsertOptions = {}): Promise { req = serializeHttpsHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpsHealthChecks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of HttpsHealthCheck resources available to the * specified project. * * @param project Project ID for this request. */ async httpsHealthChecksList(project: string, opts: HttpsHealthChecksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpsHealthChecks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHttpsHealthCheckList(data); } /** * Updates a HttpsHealthCheck resource in the specified project using the * data included in the request. This method supports PATCH semantics and uses * the JSON merge patch format and processing rules. * * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. * @param project Project ID for this request. */ async httpsHealthChecksPatch(httpsHealthCheck: string, project: string, req: HttpsHealthCheck, opts: HttpsHealthChecksPatchOptions = {}): Promise { req = serializeHttpsHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpsHealthChecks/${ httpsHealthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates a HttpsHealthCheck resource in the specified project using the * data included in the request. * * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. * @param project Project ID for this request. */ async httpsHealthChecksUpdate(httpsHealthCheck: string, project: string, req: HttpsHealthCheck, opts: HttpsHealthChecksUpdateOptions = {}): Promise { req = serializeHttpsHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/httpsHealthChecks/${ httpsHealthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Returns the latest image that is part of an image family, is not * deprecated and is rolled out in the specified zone. * * @param family Name of the image family to search for. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async imageFamilyViewsGet(family: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/imageFamilyViews/${ family }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeImageFamilyView(data); } /** * Deletes the specified image. * * @param image Name of the image resource to delete. * @param project Project ID for this request. */ async imagesDelete(image: string, project: string, opts: ImagesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ image }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Sets the deprecation status of an image. If an empty request body is * given, clears the deprecation status instead. * * @param image Image name. * @param project Project ID for this request. */ async imagesDeprecate(image: string, project: string, req: DeprecationStatus, opts: ImagesDeprecateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ image }/deprecate`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified image. * * @param image Name of the image resource to return. * @param project Project ID for this request. */ async imagesGet(image: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ image }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeImage(data); } /** * Returns the latest image that is part of an image family and is not * deprecated. For more information on image families, see Public image * families documentation. * * @param family Name of the image family to search for. * @param project The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. */ async imagesGetFromFamily(family: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/family/${ family }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeImage(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async imagesGetIamPolicy(project: string, resource: string, opts: ImagesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates an image in the specified project using the data included in the * request. * * @param project Project ID for this request. */ async imagesInsert(project: string, req: Image, opts: ImagesInsertOptions = {}): Promise { req = serializeImage(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/images`); if (opts.forceCreate !== undefined) { url.searchParams.append("forceCreate", String(opts.forceCreate)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of custom images available to the specified project. * Custom images are images you create that belong to your project. This * method does not get any images that belong to other projects, including * publicly-available images, like Debian 8. If you want to get a list of * publicly-available images, use this method to make a request to the * respective image project, such as debian-cloud or windows-cloud. * * @param project Project ID for this request. */ async imagesList(project: string, opts: ImagesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeImageList(data); } /** * Patches the specified image with the data included in the request. Only * the following fields can be modified: family, description, deprecation * status. * * @param image Name of the image resource to patch. * @param project Project ID for this request. */ async imagesPatch(image: string, project: string, req: Image, opts: ImagesPatchOptions = {}): Promise { req = serializeImage(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ image }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async imagesSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the labels on an image. To learn more about labels, read the Labeling * Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async imagesSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async imagesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/images/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Cancels the specified resize request and removes it from the queue. * Cancelled resize request does no longer wait for the resources to be * provisioned. Cancel is only possible for requests that are accepted in the * queue. * * @param instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. * @param project Project ID for this request. * @param resizeRequest The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. * @param zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. */ async instanceGroupManagerResizeRequestsCancel(instanceGroupManager: string, project: string, resizeRequest: string, zone: string, opts: InstanceGroupManagerResizeRequestsCancelOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/resizeRequests/${ resizeRequest }/cancel`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified, inactive resize request. Requests that are still * active cannot be deleted. Deleting request does not delete instances that * were provisioned previously. * * @param instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. * @param project Project ID for this request. * @param resizeRequest The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. * @param zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. */ async instanceGroupManagerResizeRequestsDelete(instanceGroupManager: string, project: string, resizeRequest: string, zone: string, opts: InstanceGroupManagerResizeRequestsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/resizeRequests/${ resizeRequest }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns all of the details about the specified resize request. * * @param instanceGroupManager The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. * @param project Project ID for this request. * @param resizeRequest The name of the resize request. Name should conform to RFC1035 or be a resource ID. * @param zone Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. */ async instanceGroupManagerResizeRequestsGet(instanceGroupManager: string, project: string, resizeRequest: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/resizeRequests/${ resizeRequest }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupManagerResizeRequest(data); } /** * Creates a new resize request that starts provisioning VMs immediately or * queues VM creation. * * @param instanceGroupManager The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. */ async instanceGroupManagerResizeRequestsInsert(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagerResizeRequest, opts: InstanceGroupManagerResizeRequestsInsertOptions = {}): Promise { req = serializeInstanceGroupManagerResizeRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/resizeRequests`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of resize requests that are contained in the managed * instance group. * * @param instanceGroupManager The name of the managed instance group. The name should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. */ async instanceGroupManagerResizeRequestsList(instanceGroupManager: string, project: string, zone: string, opts: InstanceGroupManagerResizeRequestsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/resizeRequests`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupManagerResizeRequestsListResponse(data); } /** * Flags the specified instances to be removed from the managed instance * group. Abandoning an instance does not delete the instance, but it does * remove the instance from any target pools that are applied by the managed * instance group. This method reduces the targetSize of the managed instance * group by the number of instances that you abandon. This operation is marked * as DONE when the action is scheduled even if the instances have not yet * been removed from the group. You must separately verify the status of the * abandoning action with the listmanagedinstances method. If the group is * part of a backend service that has enabled connection draining, it can take * up to 60 seconds after the connection draining duration has elapsed before * the VM instance is removed or deleted. You can specify a maximum of 1000 * instances with this method per request. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersAbandonInstances(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersAbandonInstancesRequest, opts: InstanceGroupManagersAbandonInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/abandonInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of managed instance groups and groups them by zone. To * prevent failure, Google recommends that you set the `returnPartialSuccess` * parameter to `true`. * * @param project Project ID for this request. */ async instanceGroupManagersAggregatedList(project: string, opts: InstanceGroupManagersAggregatedListOptions = {}): Promise { opts = serializeInstanceGroupManagersAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/instanceGroupManagers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupManagerAggregatedList(data); } /** * Applies changes to selected instances on the managed instance group. This * method can be used to apply new overrides and/or new versions. * * @param instanceGroupManager The name of the managed instance group, should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. Should conform to RFC1035. */ async instanceGroupManagersApplyUpdatesToInstances(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersApplyUpdatesRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/applyUpdatesToInstances`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Creates instances with per-instance configurations in this managed * instance group. Instances are created using the current instance template. * The create instances operation is marked DONE if the createInstances * request is successful. The underlying actions take additional time. You * must separately verify the status of the creating or actions with the * listmanagedinstances method. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. It should conform to RFC1035. */ async instanceGroupManagersCreateInstances(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersCreateInstancesRequest, opts: InstanceGroupManagersCreateInstancesOptions = {}): Promise { req = serializeInstanceGroupManagersCreateInstancesRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/createInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified managed instance group and all of the instances in * that group. Note that the instance group must not belong to a backend * service. Read Deleting an instance group for more information. * * @param instanceGroupManager The name of the managed instance group to delete. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersDelete(instanceGroupManager: string, project: string, zone: string, opts: InstanceGroupManagersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Flags the specified instances in the managed instance group for immediate * deletion. The instances are also removed from any target pools of which * they were a member. This method reduces the targetSize of the managed * instance group by the number of instances that you delete. This operation * is marked as DONE when the action is scheduled even if the instances are * still being deleted. You must separately verify the status of the deleting * action with the listmanagedinstances method. If the group is part of a * backend service that has enabled connection draining, it can take up to 60 * seconds after the connection draining duration has elapsed before the VM * instance is removed or deleted. You can specify a maximum of 1000 instances * with this method per request. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersDeleteInstances(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersDeleteInstancesRequest, opts: InstanceGroupManagersDeleteInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/deleteInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes selected per-instance configurations for the managed instance * group. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. It should conform to RFC1035. */ async instanceGroupManagersDeletePerInstanceConfigs(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersDeletePerInstanceConfigsReq): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/deletePerInstanceConfigs`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns all of the details about the specified managed instance group. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersGet(instanceGroupManager: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupManager(data); } /** * Creates a managed instance group using the information that you specify in * the request. After the group is created, instances in the group are created * using the specified instance template. This operation is marked as DONE * when the group is created even if the instances in the group have not yet * been created. You must separately verify the status of the individual * instances with the listmanagedinstances method. A managed instance group * can have up to 1000 VM instances per group. Please contact Cloud Support if * you need an increase in this limit. * * @param project Project ID for this request. * @param zone The name of the zone where you want to create the managed instance group. */ async instanceGroupManagersInsert(project: string, zone: string, req: InstanceGroupManager, opts: InstanceGroupManagersInsertOptions = {}): Promise { req = serializeInstanceGroupManager(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of managed instance groups that are contained within the * specified project and zone. * * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersList(project: string, zone: string, opts: InstanceGroupManagersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupManagerList(data); } /** * Lists all errors thrown by actions on instances for a given managed * instance group. The filter and orderBy query parameters are not supported. * * @param instanceGroupManager The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. It should conform to RFC1035. */ async instanceGroupManagersListErrors(instanceGroupManager: string, project: string, zone: string, opts: InstanceGroupManagersListErrorsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/listErrors`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InstanceGroupManagersListErrorsResponse; } /** * Lists all of the instances in the managed instance group. Each instance in * the list has a currentAction, which indicates the action that the managed * instance group is performing on the instance. For example, if the group is * still creating an instance, the currentAction is CREATING. If a previous * action failed, the list displays the errors for that failed action. The * orderBy query parameter is not supported. The `pageToken` query parameter * is supported only if the group's `listManagedInstancesResults` field is set * to `PAGINATED`. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersListManagedInstances(instanceGroupManager: string, project: string, zone: string, opts: InstanceGroupManagersListManagedInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/listManagedInstances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeInstanceGroupManagersListManagedInstancesResponse(data); } /** * Lists all of the per-instance configurations defined for the managed * instance group. The orderBy query parameter is not supported. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. It should conform to RFC1035. */ async instanceGroupManagersListPerInstanceConfigs(instanceGroupManager: string, project: string, zone: string, opts: InstanceGroupManagersListPerInstanceConfigsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/listPerInstanceConfigs`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeInstanceGroupManagersListPerInstanceConfigsResp(data); } /** * Updates a managed instance group using the information that you specify in * the request. This operation is marked as DONE when the group is patched * even if the instances in the group are still in the process of being * patched. You must separately verify the status of the individual instances * with the listManagedInstances method. This method supports PATCH semantics * and uses the JSON merge patch format and processing rules. If you update * your group to specify a new template or instance configuration, it's * possible that your intended specification for each VM in the group is * different from the current state of that VM. To learn how to apply an * updated configuration to the VMs in a MIG, see Updating instances in a MIG. * * @param instanceGroupManager The name of the instance group manager. * @param project Project ID for this request. * @param zone The name of the zone where you want to create the managed instance group. */ async instanceGroupManagersPatch(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManager, opts: InstanceGroupManagersPatchOptions = {}): Promise { req = serializeInstanceGroupManager(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Inserts or patches per-instance configurations for the managed instance * group. perInstanceConfig.name serves as a key used to distinguish whether * to perform insert or patch. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. It should conform to RFC1035. */ async instanceGroupManagersPatchPerInstanceConfigs(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersPatchPerInstanceConfigsReq, opts: InstanceGroupManagersPatchPerInstanceConfigsOptions = {}): Promise { req = serializeInstanceGroupManagersPatchPerInstanceConfigsReq(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/patchPerInstanceConfigs`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Flags the specified VM instances in the managed instance group to be * immediately recreated. Each instance is recreated using the group's current * configuration. This operation is marked as DONE when the flag is set even * if the instances have not yet been recreated. You must separately verify * the status of each instance by checking its currentAction field; for more * information, see Checking the status of managed instances. If the group is * part of a backend service that has enabled connection draining, it can take * up to 60 seconds after the connection draining duration has elapsed before * the VM instance is removed or deleted. You can specify a maximum of 1000 * instances with this method per request. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersRecreateInstances(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersRecreateInstancesRequest, opts: InstanceGroupManagersRecreateInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/recreateInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Resizes the managed instance group. If you increase the size, the group * creates new instances using the current instance template. If you decrease * the size, the group deletes instances. The resize operation is marked DONE * when the resize actions are scheduled even if the group has not yet added * or deleted any instances. You must separately verify the status of the * creating or deleting actions with the listmanagedinstances method. When * resizing down, the instance group arbitrarily chooses the order in which * VMs are deleted. The group takes into account some VM attributes when * making the selection including: + The status of the VM instance. + The * health of the VM instance. + The instance template version the VM is based * on. + For regional managed instance groups, the location of the VM * instance. This list is subject to change. If the group is part of a backend * service that has enabled connection draining, it can take up to 60 seconds * after the connection draining duration has elapsed before the VM instance * is removed or deleted. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersResize(instanceGroupManager: string, project: string, zone: string, opts: InstanceGroupManagersResizeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/resize`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.size !== undefined) { url.searchParams.append("size", String(opts.size)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Specifies the instance template to use when creating new instances in this * group. The templates for existing instances in the group do not change * unless you run recreateInstances, run applyUpdatesToInstances, or set the * group's updatePolicy.type to PROACTIVE. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersSetInstanceTemplate(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersSetInstanceTemplateRequest, opts: InstanceGroupManagersSetInstanceTemplateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/setInstanceTemplate`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Modifies the target pools to which all instances in this managed instance * group are assigned. The target pools automatically apply to all of the * instances in the managed instance group. This operation is marked DONE when * you make the request even if the instances have not yet been added to their * target pools. The change might take some time to apply to all of the * instances in the group depending on the size of the group. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. */ async instanceGroupManagersSetTargetPools(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersSetTargetPoolsRequest, opts: InstanceGroupManagersSetTargetPoolsOptions = {}): Promise { req = serializeInstanceGroupManagersSetTargetPoolsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/setTargetPools`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Inserts or updates per-instance configurations for the managed instance * group. perInstanceConfig.name serves as a key used to distinguish whether * to perform insert or patch. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the managed instance group is located. It should conform to RFC1035. */ async instanceGroupManagersUpdatePerInstanceConfigs(instanceGroupManager: string, project: string, zone: string, req: InstanceGroupManagersUpdatePerInstanceConfigsReq, opts: InstanceGroupManagersUpdatePerInstanceConfigsOptions = {}): Promise { req = serializeInstanceGroupManagersUpdatePerInstanceConfigsReq(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroupManagers/${ instanceGroupManager }/updatePerInstanceConfigs`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Adds a list of instances to the specified instance group. All of the * instances in the instance group must be in the same network/subnetwork. * Read Adding instances for more information. * * @param instanceGroup The name of the instance group where you are adding instances. * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsAddInstances(instanceGroup: string, project: string, zone: string, req: InstanceGroupsAddInstancesRequest, opts: InstanceGroupsAddInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups/${ instanceGroup }/addInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of instance groups and sorts them by zone. To prevent * failure, Google recommends that you set the `returnPartialSuccess` * parameter to `true`. * * @param project Project ID for this request. */ async instanceGroupsAggregatedList(project: string, opts: InstanceGroupsAggregatedListOptions = {}): Promise { opts = serializeInstanceGroupsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/instanceGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupAggregatedList(data); } /** * Deletes the specified instance group. The instances in the group are not * deleted. Note that instance group must not belong to a backend service. * Read Deleting an instance group for more information. * * @param instanceGroup The name of the instance group to delete. * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsDelete(instanceGroup: string, project: string, zone: string, opts: InstanceGroupsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups/${ instanceGroup }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified zonal instance group. Get a list of available zonal * instance groups by making a list() request. For managed instance groups, * use the instanceGroupManagers or regionInstanceGroupManagers methods * instead. * * @param instanceGroup The name of the instance group. * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsGet(instanceGroup: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups/${ instanceGroup }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroup(data); } /** * Creates an instance group in the specified project using the parameters * that are included in the request. * * @param project Project ID for this request. * @param zone The name of the zone where you want to create the instance group. */ async instanceGroupsInsert(project: string, zone: string, req: InstanceGroup, opts: InstanceGroupsInsertOptions = {}): Promise { req = serializeInstanceGroup(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of zonal instance group resources contained within the * specified zone. For managed instance groups, use the instanceGroupManagers * or regionInstanceGroupManagers methods instead. * * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsList(project: string, zone: string, opts: InstanceGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupList(data); } /** * Lists the instances in the specified instance group. The orderBy query * parameter is not supported. The filter query parameter is supported, but * only for expressions that use `eq` (equal) or `ne` (not equal) operators. * * @param instanceGroup The name of the instance group from which you want to generate a list of included instances. * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsListInstances(instanceGroup: string, project: string, zone: string, req: InstanceGroupsListInstancesRequest, opts: InstanceGroupsListInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups/${ instanceGroup }/listInstances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as InstanceGroupsListInstances; } /** * Removes one or more instances from the specified instance group, but does * not delete those instances. If the group is part of a backend service that * has enabled connection draining, it can take up to 60 seconds after the * connection draining duration before the VM instance is removed or deleted. * * @param instanceGroup The name of the instance group where the specified instances will be removed. * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsRemoveInstances(instanceGroup: string, project: string, zone: string, req: InstanceGroupsRemoveInstancesRequest, opts: InstanceGroupsRemoveInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups/${ instanceGroup }/removeInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the named ports for the specified instance group. * * @param instanceGroup The name of the instance group where the named ports are updated. * @param project Project ID for this request. * @param zone The name of the zone where the instance group is located. */ async instanceGroupsSetNamedPorts(instanceGroup: string, project: string, zone: string, req: InstanceGroupsSetNamedPortsRequest, opts: InstanceGroupsSetNamedPortsOptions = {}): Promise { req = serializeInstanceGroupsSetNamedPortsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceGroups/${ instanceGroup }/setNamedPorts`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Adds an access config to an instance's network interface. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesAddAccessConfig(instance: string, project: string, zone: string, req: AccessConfig, opts: InstancesAddAccessConfigOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/addAccessConfig`); if (opts.networkInterface !== undefined) { url.searchParams.append("networkInterface", String(opts.networkInterface)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Adds existing resource policies to an instance. You can only add one * policy right now which will be applied to this instance for scheduling live * migrations. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesAddResourcePolicies(instance: string, project: string, zone: string, req: InstancesAddResourcePoliciesRequest, opts: InstancesAddResourcePoliciesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/addResourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of all of the instances in your project * across all regions and zones. The performance of this method degrades when * a filter is specified on a project that has a very large number of * instances. To prevent failure, Google recommends that you set the * `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async instancesAggregatedList(project: string, opts: InstancesAggregatedListOptions = {}): Promise { opts = serializeInstancesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/instances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceAggregatedList(data); } /** * Attaches an existing Disk resource to an instance. You must first create * the disk before you can attach it. It is not possible to create and attach * a disk at the same time. For more information, read Adding a persistent * disk to your instance. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesAttachDisk(instance: string, project: string, zone: string, req: AttachedDisk, opts: InstancesAttachDiskOptions = {}): Promise { req = serializeAttachedDisk(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/attachDisk`); if (opts.forceAttach !== undefined) { url.searchParams.append("forceAttach", String(opts.forceAttach)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Creates multiple instances. Count specifies the number of instances to * create. For more information, see About bulk creation of VMs. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesBulkInsert(project: string, zone: string, req: BulkInsertInstanceResource, opts: InstancesBulkInsertOptions = {}): Promise { req = serializeBulkInsertInstanceResource(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/bulkInsert`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified Instance resource. For more information, see * Deleting an instance. * * @param instance Name of the instance resource to delete. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesDelete(instance: string, project: string, zone: string, opts: InstancesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Deletes an access config from an instance's network interface. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesDeleteAccessConfig(instance: string, project: string, zone: string, opts: InstancesDeleteAccessConfigOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/deleteAccessConfig`); if (opts.accessConfig !== undefined) { url.searchParams.append("accessConfig", String(opts.accessConfig)); } if (opts.networkInterface !== undefined) { url.searchParams.append("networkInterface", String(opts.networkInterface)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Detaches a disk from an instance. * * @param instance Instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesDetachDisk(instance: string, project: string, zone: string, opts: InstancesDetachDiskOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/detachDisk`); if (opts.deviceName !== undefined) { url.searchParams.append("deviceName", String(opts.deviceName)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Get Instance settings. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async instanceSettingsGet(project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceSettings`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceSettings(data); } /** * Patch Instance settings * * @param project Project ID for this request. * @param zone The zone scoping this request. It should conform to RFC1035. */ async instanceSettingsPatch(project: string, zone: string, req: InstanceSettings, opts: InstanceSettingsPatchOptions = {}): Promise { req = serializeInstanceSettings(req); opts = serializeInstanceSettingsPatchOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instanceSettings`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Returns the specified Instance resource. * * @param instance Name of the instance resource to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesGet(instance: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstance(data); } /** * Returns effective firewalls applied to an interface of the instance. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesGetEffectiveFirewalls(instance: string, project: string, zone: string, opts: InstancesGetEffectiveFirewallsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/getEffectiveFirewalls`); if (opts.networkInterface !== undefined) { url.searchParams.append("networkInterface", String(opts.networkInterface)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstancesGetEffectiveFirewallsResponse(data); } /** * Returns the specified guest attributes entry. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesGetGuestAttributes(instance: string, project: string, zone: string, opts: InstancesGetGuestAttributesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/getGuestAttributes`); if (opts.queryPath !== undefined) { url.searchParams.append("queryPath", String(opts.queryPath)); } if (opts.variableKey !== undefined) { url.searchParams.append("variableKey", String(opts.variableKey)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GuestAttributes; } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instancesGetIamPolicy(project: string, resource: string, zone: string, opts: InstancesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Returns the screenshot from the specified instance. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesGetScreenshot(instance: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/screenshot`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Screenshot; } /** * Returns the last 1 MB of serial port output from the specified instance. * * @param instance Name of the instance for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesGetSerialPortOutput(instance: string, project: string, zone: string, opts: InstancesGetSerialPortOutputOptions = {}): Promise { opts = serializeInstancesGetSerialPortOutputOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/serialPort`); if (opts.port !== undefined) { url.searchParams.append("port", String(opts.port)); } if (opts.start !== undefined) { url.searchParams.append("start", String(opts.start)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSerialPortOutput(data); } /** * Returns the Shielded Instance Identity of an instance * * @param instance Name or id of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesGetShieldedInstanceIdentity(instance: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/getShieldedInstanceIdentity`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ShieldedInstanceIdentity; } /** * Creates an instance resource in the specified project using the data * included in the request. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesInsert(project: string, zone: string, req: Instance, opts: InstancesInsertOptions = {}): Promise { req = serializeInstance(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceInstanceTemplate !== undefined) { url.searchParams.append("sourceInstanceTemplate", String(opts.sourceInstanceTemplate)); } if (opts.sourceMachineImage !== undefined) { url.searchParams.append("sourceMachineImage", String(opts.sourceMachineImage)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of instances contained within the specified zone. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesList(project: string, zone: string, opts: InstancesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceList(data); } /** * Retrieves a list of resources that refer to the VM instance specified in * the request. For example, if the VM instance is part of a managed or * unmanaged instance group, the referrers list includes the instance group. * For more information, read Viewing referrers to VM instances. * * @param instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesListReferrers(instance: string, project: string, zone: string, opts: InstancesListReferrersOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/referrers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InstanceListReferrers; } /** * Perform a manual maintenance on the instance. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesPerformMaintenance(instance: string, project: string, zone: string, opts: InstancesPerformMaintenanceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/performMaintenance`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Removes resource policies from an instance. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesRemoveResourcePolicies(instance: string, project: string, zone: string, req: InstancesRemoveResourcePoliciesRequest, opts: InstancesRemoveResourcePoliciesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/removeResourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Performs a reset on the instance. This is a hard reset. The VM does not do * a graceful shutdown. For more information, see Resetting an instance. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesReset(instance: string, project: string, zone: string, opts: InstancesResetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/reset`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Resumes an instance that was suspended using the instances().suspend * method. * * @param instance Name of the instance resource to resume. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesResume(instance: string, project: string, zone: string, opts: InstancesResumeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/resume`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sends diagnostic interrupt to the instance. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSendDiagnosticInterrupt(instance: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/sendDiagnosticInterrupt`); const data = await request(url.href, { client: this.#client, method: "POST", }); } /** * Sets deletion protection on the instance. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instancesSetDeletionProtection(project: string, resource: string, zone: string, opts: InstancesSetDeletionProtectionOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ resource }/setDeletionProtection`); if (opts.deletionProtection !== undefined) { url.searchParams.append("deletionProtection", String(opts.deletionProtection)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the auto-delete flag for a disk attached to an instance. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetDiskAutoDelete(instance: string, project: string, zone: string, opts: InstancesSetDiskAutoDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setDiskAutoDelete`); if (opts.autoDelete !== undefined) { url.searchParams.append("autoDelete", String(opts.autoDelete)); } if (opts.deviceName !== undefined) { url.searchParams.append("deviceName", String(opts.deviceName)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instancesSetIamPolicy(project: string, resource: string, zone: string, req: ZoneSetPolicyRequest): Promise { req = serializeZoneSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets labels on an instance. To learn more about labels, read the Labeling * Resources documentation. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetLabels(instance: string, project: string, zone: string, req: InstancesSetLabelsRequest, opts: InstancesSetLabelsOptions = {}): Promise { req = serializeInstancesSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the number and/or type of accelerator for a stopped instance to * the values specified in the request. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetMachineResources(instance: string, project: string, zone: string, req: InstancesSetMachineResourcesRequest, opts: InstancesSetMachineResourcesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setMachineResources`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the machine type for a stopped instance to the machine type * specified in the request. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetMachineType(instance: string, project: string, zone: string, req: InstancesSetMachineTypeRequest, opts: InstancesSetMachineTypeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setMachineType`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets metadata for the specified instance to the data included in the * request. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetMetadata(instance: string, project: string, zone: string, req: Metadata, opts: InstancesSetMetadataOptions = {}): Promise { req = serializeMetadata(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setMetadata`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the minimum CPU platform that this instance should use. This * method can only be called on a stopped instance. For more information, read * Specifying a Minimum CPU Platform. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetMinCpuPlatform(instance: string, project: string, zone: string, req: InstancesSetMinCpuPlatformRequest, opts: InstancesSetMinCpuPlatformOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setMinCpuPlatform`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets name of an instance. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetName(instance: string, project: string, zone: string, req: InstancesSetNameRequest, opts: InstancesSetNameOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setName`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets an instance's scheduling options. You can only call this method on a * stopped instance, that is, a VM instance that is in a `TERMINATED` state. * See Instance Life Cycle for more information on the possible instance * states. For more information about setting scheduling options for a VM, see * Set VM host maintenance policy. * * @param instance Instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetScheduling(instance: string, project: string, zone: string, req: Scheduling, opts: InstancesSetSchedulingOptions = {}): Promise { req = serializeScheduling(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setScheduling`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the Google Cloud Armor security policy for the specified instance. * For more information, see Google Cloud Armor Overview * * @param instance Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. * @param project Project ID for this request. * @param zone Name of the zone scoping this request. */ async instancesSetSecurityPolicy(instance: string, project: string, zone: string, req: InstancesSetSecurityPolicyRequest, opts: InstancesSetSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the service account on the instance. For more information, read * Changing the service account and access scopes for an instance. * * @param instance Name of the instance resource to start. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetServiceAccount(instance: string, project: string, zone: string, req: InstancesSetServiceAccountRequest, opts: InstancesSetServiceAccountOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setServiceAccount`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the Shielded Instance integrity policy for an instance. You can only * use this method on a running instance. This method supports PATCH semantics * and uses the JSON merge patch format and processing rules. * * @param instance Name or id of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetShieldedInstanceIntegrityPolicy(instance: string, project: string, zone: string, req: ShieldedInstanceIntegrityPolicy, opts: InstancesSetShieldedInstanceIntegrityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setShieldedInstanceIntegrityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets network tags for the specified instance to the data included in the * request. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSetTags(instance: string, project: string, zone: string, req: Tags, opts: InstancesSetTagsOptions = {}): Promise { req = serializeTags(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/setTags`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Simulates a host maintenance event on a VM. For more information, see * Simulate a host maintenance event. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSimulateMaintenanceEvent(instance: string, project: string, zone: string, opts: InstancesSimulateMaintenanceEventOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/simulateMaintenanceEvent`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.withExtendedNotifications !== undefined) { url.searchParams.append("withExtendedNotifications", String(opts.withExtendedNotifications)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Starts an instance that was stopped using the instances().stop method. For * more information, see Restart an instance. * * @param instance Name of the instance resource to start. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesStart(instance: string, project: string, zone: string, opts: InstancesStartOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/start`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Starts an instance that was stopped using the instances().stop method. For * more information, see Restart an instance. * * @param instance Name of the instance resource to start. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesStartWithEncryptionKey(instance: string, project: string, zone: string, req: InstancesStartWithEncryptionKeyRequest, opts: InstancesStartWithEncryptionKeyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/startWithEncryptionKey`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Stops a running instance, shutting it down cleanly, and allows you to * restart the instance at a later time. Stopped instances do not incur VM * usage charges while they are stopped. However, resources that the VM is * using, such as persistent disks and static IP addresses, will continue to * be charged until they are deleted. For more information, see Stopping an * instance. * * @param instance Name of the instance resource to stop. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesStop(instance: string, project: string, zone: string, opts: InstancesStopOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/stop`); if (opts.discardLocalSsd !== undefined) { url.searchParams.append("discardLocalSsd", String(opts.discardLocalSsd)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * This method suspends a running instance, saving its state to persistent * storage, and allows you to resume the instance at a later time. Suspended * instances have no compute costs (cores or RAM), and incur only storage * charges for the saved VM memory and localSSD data. Any charged resources * the virtual machine was using, such as persistent disks and static IP * addresses, will continue to be charged while the instance is suspended. For * more information, see Suspending and resuming an instance. * * @param instance Name of the instance resource to suspend. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesSuspend(instance: string, project: string, zone: string, opts: InstancesSuspendOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/suspend`); if (opts.discardLocalSsd !== undefined) { url.searchParams.append("discardLocalSsd", String(opts.discardLocalSsd)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instancesTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Updates an instance only if the necessary resources are available. This * method can update only a specific set of instance properties. See Updating * a running instance for a list of updatable instance properties. * * @param instance Name of the instance resource to update. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesUpdate(instance: string, project: string, zone: string, req: Instance, opts: InstancesUpdateOptions = {}): Promise { req = serializeInstance(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }`); if (opts.minimalAction !== undefined) { url.searchParams.append("minimalAction", String(opts.minimalAction)); } if (opts.mostDisruptiveAllowedAction !== undefined) { url.searchParams.append("mostDisruptiveAllowedAction", String(opts.mostDisruptiveAllowedAction)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Updates the specified access config from an instance's network interface * with the data included in the request. This method supports PATCH semantics * and uses the JSON merge patch format and processing rules. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesUpdateAccessConfig(instance: string, project: string, zone: string, req: AccessConfig, opts: InstancesUpdateAccessConfigOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/updateAccessConfig`); if (opts.networkInterface !== undefined) { url.searchParams.append("networkInterface", String(opts.networkInterface)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Updates the Display config for a VM instance. You can only use this method * on a stopped VM instance. This method supports PATCH semantics and uses the * JSON merge patch format and processing rules. * * @param instance Name of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesUpdateDisplayDevice(instance: string, project: string, zone: string, req: DisplayDevice, opts: InstancesUpdateDisplayDeviceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/updateDisplayDevice`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates an instance's network interface. This method can only update an * interface's alias IP range and attached network. See Modifying alias IP * ranges for an existing instance for instructions on changing alias IP * ranges. See Migrating a VM between networks for instructions on migrating * an interface. This method follows PATCH semantics. * * @param instance The instance name for this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesUpdateNetworkInterface(instance: string, project: string, zone: string, req: NetworkInterface, opts: InstancesUpdateNetworkInterfaceOptions = {}): Promise { req = serializeNetworkInterface(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/updateNetworkInterface`); if (opts.networkInterface !== undefined) { url.searchParams.append("networkInterface", String(opts.networkInterface)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates the Shielded Instance config for an instance. You can only use * this method on a stopped instance. This method supports PATCH semantics and * uses the JSON merge patch format and processing rules. * * @param instance Name or id of the instance scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instancesUpdateShieldedInstanceConfig(instance: string, project: string, zone: string, req: ShieldedInstanceConfig, opts: InstancesUpdateShieldedInstanceConfigOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instances/${ instance }/updateShieldedInstanceConfig`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves the list of all InstanceTemplates resources, regional and * global, available to the specified project. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async instanceTemplatesAggregatedList(project: string, opts: InstanceTemplatesAggregatedListOptions = {}): Promise { opts = serializeInstanceTemplatesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/instanceTemplates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceTemplateAggregatedList(data); } /** * Deletes the specified instance template. Deleting an instance template is * permanent and cannot be undone. It is not possible to delete templates that * are already in use by a managed instance group. * * @param instanceTemplate The name of the instance template to delete. * @param project Project ID for this request. */ async instanceTemplatesDelete(instanceTemplate: string, project: string, opts: InstanceTemplatesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates/${ instanceTemplate }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified instance template. * * @param instanceTemplate The name of the instance template. * @param project Project ID for this request. */ async instanceTemplatesGet(instanceTemplate: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates/${ instanceTemplate }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceTemplate(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async instanceTemplatesGetIamPolicy(project: string, resource: string, opts: InstanceTemplatesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates an instance template in the specified project using the data that * is included in the request. If you are creating a new template to update an * existing instance group, your new instance template must use the same * network or, if applicable, the same subnetwork as the original template. * * @param project Project ID for this request. */ async instanceTemplatesInsert(project: string, req: InstanceTemplate, opts: InstanceTemplatesInsertOptions = {}): Promise { req = serializeInstanceTemplate(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of instance templates that are contained within the * specified project. * * @param project Project ID for this request. */ async instanceTemplatesList(project: string, opts: InstanceTemplatesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceTemplateList(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async instanceTemplatesSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async instanceTemplatesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/instanceTemplates/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of instantSnapshots. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async instantSnapshotsAggregatedList(project: string, opts: InstantSnapshotsAggregatedListOptions = {}): Promise { opts = serializeInstantSnapshotsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/instantSnapshots`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstantSnapshotAggregatedList(data); } /** * Deletes the specified InstantSnapshot resource. Keep in mind that deleting * a single instantSnapshot might not necessarily delete all the data on that * instantSnapshot. If any data on the instantSnapshot that is marked for * deletion is needed for subsequent instantSnapshots, the data will be moved * to the next corresponding instantSnapshot. For more information, see * Deleting instantSnapshots. * * @param instantSnapshot Name of the InstantSnapshot resource to delete. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsDelete(instantSnapshot: string, project: string, zone: string, opts: InstantSnapshotsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots/${ instantSnapshot }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified InstantSnapshot resource in the specified zone. * * @param instantSnapshot Name of the InstantSnapshot resource to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsGet(instantSnapshot: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots/${ instantSnapshot }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstantSnapshot(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsGetIamPolicy(project: string, resource: string, zone: string, opts: InstantSnapshotsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates an instant snapshot in the specified zone. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async instantSnapshotsInsert(project: string, zone: string, req: InstantSnapshot, opts: InstantSnapshotsInsertOptions = {}): Promise { req = serializeInstantSnapshot(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of InstantSnapshot resources contained within the * specified zone. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsList(project: string, zone: string, opts: InstantSnapshotsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstantSnapshotList(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsSetIamPolicy(project: string, resource: string, zone: string, req: ZoneSetPolicyRequest): Promise { req = serializeZoneSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the labels on a instantSnapshot in the given zone. To learn more * about labels, read the Labeling Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsSetLabels(project: string, resource: string, zone: string, req: ZoneSetLabelsRequest, opts: InstantSnapshotsSetLabelsOptions = {}): Promise { req = serializeZoneSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async instantSnapshotsTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/instantSnapshots/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of interconnect attachments. To prevent * failure, Google recommends that you set the `returnPartialSuccess` * parameter to `true`. * * @param project Project ID for this request. */ async interconnectAttachmentsAggregatedList(project: string, opts: InterconnectAttachmentsAggregatedListOptions = {}): Promise { opts = serializeInterconnectAttachmentsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/interconnectAttachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectAttachmentAggregatedList(data); } /** * Deletes the specified interconnect attachment. * * @param interconnectAttachment Name of the interconnect attachment to delete. * @param project Project ID for this request. * @param region Name of the region for this request. */ async interconnectAttachmentsDelete(interconnectAttachment: string, project: string, region: string, opts: InterconnectAttachmentsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/interconnectAttachments/${ interconnectAttachment }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified interconnect attachment. * * @param interconnectAttachment Name of the interconnect attachment to return. * @param project Project ID for this request. * @param region Name of the region for this request. */ async interconnectAttachmentsGet(interconnectAttachment: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/interconnectAttachments/${ interconnectAttachment }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectAttachment(data); } /** * Creates an InterconnectAttachment in the specified project using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async interconnectAttachmentsInsert(project: string, region: string, req: InterconnectAttachment, opts: InterconnectAttachmentsInsertOptions = {}): Promise { req = serializeInterconnectAttachment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/interconnectAttachments`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of interconnect attachments contained within the * specified region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async interconnectAttachmentsList(project: string, region: string, opts: InterconnectAttachmentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/interconnectAttachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectAttachmentList(data); } /** * Updates the specified interconnect attachment with the data included in * the request. This method supports PATCH semantics and uses the JSON merge * patch format and processing rules. * * @param interconnectAttachment Name of the interconnect attachment to patch. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async interconnectAttachmentsPatch(interconnectAttachment: string, project: string, region: string, req: InterconnectAttachment, opts: InterconnectAttachmentsPatchOptions = {}): Promise { req = serializeInterconnectAttachment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/interconnectAttachments/${ interconnectAttachment }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the labels on an InterconnectAttachment. To learn more about labels, * read the Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async interconnectAttachmentsSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: InterconnectAttachmentsSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/interconnectAttachments/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the details for the specified interconnect location. Gets a list * of available interconnect locations by making a list() request. * * @param interconnectLocation Name of the interconnect location to return. * @param project Project ID for this request. */ async interconnectLocationsGet(interconnectLocation: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnectLocations/${ interconnectLocation }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectLocation(data); } /** * Retrieves the list of interconnect locations available to the specified * project. * * @param project Project ID for this request. */ async interconnectLocationsList(project: string, opts: InterconnectLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnectLocations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectLocationList(data); } /** * Returns the details for the specified interconnect remote location. Gets a * list of available interconnect remote locations by making a list() request. * * @param interconnectRemoteLocation Name of the interconnect remote location to return. * @param project Project ID for this request. */ async interconnectRemoteLocationsGet(interconnectRemoteLocation: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnectRemoteLocations/${ interconnectRemoteLocation }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectRemoteLocation(data); } /** * Retrieves the list of interconnect remote locations available to the * specified project. * * @param project Project ID for this request. */ async interconnectRemoteLocationsList(project: string, opts: InterconnectRemoteLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnectRemoteLocations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectRemoteLocationList(data); } /** * Deletes the specified Interconnect. * * @param interconnect Name of the interconnect to delete. * @param project Project ID for this request. */ async interconnectsDelete(interconnect: string, project: string, opts: InterconnectsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects/${ interconnect }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified Interconnect. Get a list of available Interconnects * by making a list() request. * * @param interconnect Name of the interconnect to return. * @param project Project ID for this request. */ async interconnectsGet(interconnect: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects/${ interconnect }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnect(data); } /** * Returns the interconnectDiagnostics for the specified Interconnect. In the * event of a global outage, do not use this API to make decisions about where * to redirect your network traffic. Unlike a VLAN attachment, which is * regional, a Cloud Interconnect connection is a global resource. A global * outage can prevent this API from functioning properly. * * @param interconnect Name of the interconnect resource to query. * @param project Project ID for this request. */ async interconnectsGetDiagnostics(interconnect: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects/${ interconnect }/getDiagnostics`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InterconnectsGetDiagnosticsResponse; } /** * Returns the interconnectMacsecConfig for the specified Interconnect. * * @param interconnect Name of the interconnect resource to query. * @param project Project ID for this request. */ async interconnectsGetMacsecConfig(interconnect: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects/${ interconnect }/getMacsecConfig`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InterconnectsGetMacsecConfigResponse; } /** * Creates an Interconnect in the specified project using the data included * in the request. * * @param project Project ID for this request. */ async interconnectsInsert(project: string, req: Interconnect, opts: InterconnectsInsertOptions = {}): Promise { req = serializeInterconnect(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of Interconnects available to the specified project. * * @param project Project ID for this request. */ async interconnectsList(project: string, opts: InterconnectsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInterconnectList(data); } /** * Updates the specified Interconnect with the data included in the request. * This method supports PATCH semantics and uses the JSON merge patch format * and processing rules. * * @param interconnect Name of the interconnect to update. * @param project Project ID for this request. */ async interconnectsPatch(interconnect: string, project: string, req: Interconnect, opts: InterconnectsPatchOptions = {}): Promise { req = serializeInterconnect(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects/${ interconnect }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the labels on an Interconnect. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async interconnectsSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/interconnects/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Return a specified license code. License codes are mirrored across all * projects that have permissions to read the License Code. *Caution* This * resource is intended for use only by third-party partners who are creating * Cloud Marketplace images. * * @param licenseCode Number corresponding to the License code resource to return. * @param project Project ID for this request. */ async licenseCodesGet(licenseCode: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenseCodes/${ licenseCode }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLicenseCode(data); } /** * Returns permissions that a caller has on the specified resource. *Caution* * This resource is intended for use only by third-party partners who are * creating Cloud Marketplace images. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async licenseCodesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenseCodes/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Deletes the specified license. *Caution* This resource is intended for use * only by third-party partners who are creating Cloud Marketplace images. * * @param license Name of the license resource to delete. * @param project Project ID for this request. */ async licensesDelete(license: string, project: string, opts: LicensesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses/${ license }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified License resource. *Caution* This resource is * intended for use only by third-party partners who are creating Cloud * Marketplace images. * * @param license Name of the License resource to return. * @param project Project ID for this request. */ async licensesGet(license: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses/${ license }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLicense(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. *Caution* This resource is intended for use only * by third-party partners who are creating Cloud Marketplace images. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async licensesGetIamPolicy(project: string, resource: string, opts: LicensesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Create a License resource in the specified project. *Caution* This * resource is intended for use only by third-party partners who are creating * Cloud Marketplace images. * * @param project Project ID for this request. */ async licensesInsert(project: string, req: License, opts: LicensesInsertOptions = {}): Promise { req = serializeLicense(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of licenses available in the specified project. This * method does not get any licenses that belong to other projects, including * licenses attached to publicly-available images, like Debian 9. If you want * to get a list of publicly-available licenses, use this method to make a * request to the respective image project, such as debian-cloud or * windows-cloud. *Caution* This resource is intended for use only by * third-party partners who are creating Cloud Marketplace images. * * @param project Project ID for this request. */ async licensesList(project: string, opts: LicensesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLicensesListResponse(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. *Caution* This resource is intended for use only by * third-party partners who are creating Cloud Marketplace images. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async licensesSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. *Caution* * This resource is intended for use only by third-party partners who are * creating Cloud Marketplace images. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async licensesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/licenses/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Deletes the specified machine image. Deleting a machine image is permanent * and cannot be undone. * * @param machineImage The name of the machine image to delete. * @param project Project ID for this request. */ async machineImagesDelete(machineImage: string, project: string, opts: MachineImagesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages/${ machineImage }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified machine image. * * @param machineImage The name of the machine image. * @param project Project ID for this request. */ async machineImagesGet(machineImage: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages/${ machineImage }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMachineImage(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async machineImagesGetIamPolicy(project: string, resource: string, opts: MachineImagesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a machine image in the specified project using the data that is * included in the request. If you are creating a new machine image to update * an existing instance, your new machine image should use the same network * or, if applicable, the same subnetwork as the original instance. * * @param project Project ID for this request. */ async machineImagesInsert(project: string, req: MachineImage, opts: MachineImagesInsertOptions = {}): Promise { req = serializeMachineImage(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceInstance !== undefined) { url.searchParams.append("sourceInstance", String(opts.sourceInstance)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of machine images that are contained within the specified * project. * * @param project Project ID for this request. */ async machineImagesList(project: string, opts: MachineImagesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMachineImageList(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async machineImagesSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async machineImagesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/machineImages/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of machine types. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async machineTypesAggregatedList(project: string, opts: MachineTypesAggregatedListOptions = {}): Promise { opts = serializeMachineTypesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/machineTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMachineTypeAggregatedList(data); } /** * Returns the specified machine type. * * @param machineType Name of the machine type to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async machineTypesGet(machineType: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/machineTypes/${ machineType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMachineType(data); } /** * Retrieves a list of machine types available to the specified project. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async machineTypesList(project: string, zone: string, opts: MachineTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/machineTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMachineTypeList(data); } /** * Retrieves the list of all NetworkAttachment resources, regional and * global, available to the specified project. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async networkAttachmentsAggregatedList(project: string, opts: NetworkAttachmentsAggregatedListOptions = {}): Promise { opts = serializeNetworkAttachmentsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/networkAttachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkAttachmentAggregatedList(data); } /** * Deletes the specified NetworkAttachment in the given scope * * @param networkAttachment Name of the NetworkAttachment resource to delete. * @param project Project ID for this request. * @param region Name of the region of this request. */ async networkAttachmentsDelete(networkAttachment: string, project: string, region: string, opts: NetworkAttachmentsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments/${ networkAttachment }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified NetworkAttachment resource in the given scope. * * @param networkAttachment Name of the NetworkAttachment resource to return. * @param project Project ID for this request. * @param region Name of the region of this request. */ async networkAttachmentsGet(networkAttachment: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments/${ networkAttachment }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkAttachment(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async networkAttachmentsGetIamPolicy(project: string, region: string, resource: string, opts: NetworkAttachmentsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a NetworkAttachment in the specified project in the given scope * using the parameters that are included in the request. * * @param project Project ID for this request. * @param region Name of the region of this request. */ async networkAttachmentsInsert(project: string, region: string, req: NetworkAttachment, opts: NetworkAttachmentsInsertOptions = {}): Promise { req = serializeNetworkAttachment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the NetworkAttachments for a project in the given scope. * * @param project Project ID for this request. * @param region Name of the region of this request. */ async networkAttachmentsList(project: string, region: string, opts: NetworkAttachmentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkAttachmentList(data); } /** * Patches the specified NetworkAttachment resource with the data included in * the request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param networkAttachment Name of the NetworkAttachment resource to patch. * @param project Project ID for this request. * @param region Name of the region for this request. */ async networkAttachmentsPatch(networkAttachment: string, project: string, region: string, req: NetworkAttachment, opts: NetworkAttachmentsPatchOptions = {}): Promise { req = serializeNetworkAttachment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments/${ networkAttachment }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async networkAttachmentsSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async networkAttachmentsTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkAttachments/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves the list of all NetworkEdgeSecurityService resources available * to the specified project. To prevent failure, Google recommends that you * set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async networkEdgeSecurityServicesAggregatedList(project: string, opts: NetworkEdgeSecurityServicesAggregatedListOptions = {}): Promise { opts = serializeNetworkEdgeSecurityServicesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/networkEdgeSecurityServices`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEdgeSecurityServiceAggregatedList(data); } /** * Deletes the specified service. * * @param networkEdgeSecurityService Name of the network edge security service to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async networkEdgeSecurityServicesDelete(networkEdgeSecurityService: string, project: string, region: string, opts: NetworkEdgeSecurityServicesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEdgeSecurityServices/${ networkEdgeSecurityService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Gets a specified NetworkEdgeSecurityService. * * @param networkEdgeSecurityService Name of the network edge security service to get. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async networkEdgeSecurityServicesGet(networkEdgeSecurityService: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEdgeSecurityServices/${ networkEdgeSecurityService }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEdgeSecurityService(data); } /** * Creates a new service in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async networkEdgeSecurityServicesInsert(project: string, region: string, req: NetworkEdgeSecurityService, opts: NetworkEdgeSecurityServicesInsertOptions = {}): Promise { req = serializeNetworkEdgeSecurityService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEdgeSecurityServices`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Patches the specified policy with the data included in the request. * * @param networkEdgeSecurityService Name of the network edge security service to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async networkEdgeSecurityServicesPatch(networkEdgeSecurityService: string, project: string, region: string, req: NetworkEdgeSecurityService, opts: NetworkEdgeSecurityServicesPatchOptions = {}): Promise { req = serializeNetworkEdgeSecurityService(req); opts = serializeNetworkEdgeSecurityServicesPatchOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEdgeSecurityServices/${ networkEdgeSecurityService }`); if (opts.paths !== undefined) { url.searchParams.append("paths", String(opts.paths)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves the list of network endpoint groups and sorts them by zone. To * prevent failure, Google recommends that you set the `returnPartialSuccess` * parameter to `true`. * * @param project Project ID for this request. */ async networkEndpointGroupsAggregatedList(project: string, opts: NetworkEndpointGroupsAggregatedListOptions = {}): Promise { opts = serializeNetworkEndpointGroupsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/networkEndpointGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroupAggregatedList(data); } /** * Attach a list of network endpoints to the specified network endpoint * group. * * @param networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. */ async networkEndpointGroupsAttachNetworkEndpoints(networkEndpointGroup: string, project: string, zone: string, req: NetworkEndpointGroupsAttachEndpointsRequest, opts: NetworkEndpointGroupsAttachNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups/${ networkEndpointGroup }/attachNetworkEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified network endpoint group. The network endpoints in the * NEG and the VM instances they belong to are not terminated when the NEG is * deleted. Note that the NEG cannot be deleted if there are backend services * referencing it. * * @param networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. */ async networkEndpointGroupsDelete(networkEndpointGroup: string, project: string, zone: string, opts: NetworkEndpointGroupsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups/${ networkEndpointGroup }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Detach a list of network endpoints from the specified network endpoint * group. * * @param networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. */ async networkEndpointGroupsDetachNetworkEndpoints(networkEndpointGroup: string, project: string, zone: string, req: NetworkEndpointGroupsDetachEndpointsRequest, opts: NetworkEndpointGroupsDetachNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups/${ networkEndpointGroup }/detachNetworkEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. */ async networkEndpointGroupsGet(networkEndpointGroup: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups/${ networkEndpointGroup }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroup(data); } /** * Creates a network endpoint group in the specified project using the * parameters that are included in the request. * * @param project Project ID for this request. * @param zone The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. */ async networkEndpointGroupsInsert(project: string, zone: string, req: NetworkEndpointGroup, opts: NetworkEndpointGroupsInsertOptions = {}): Promise { req = serializeNetworkEndpointGroup(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of network endpoint groups that are located in the * specified project and zone. * * @param project Project ID for this request. * @param zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. */ async networkEndpointGroupsList(project: string, zone: string, opts: NetworkEndpointGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroupList(data); } /** * Lists the network endpoints in the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. * @param project Project ID for this request. * @param zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. */ async networkEndpointGroupsListNetworkEndpoints(networkEndpointGroup: string, project: string, zone: string, req: NetworkEndpointGroupsListEndpointsRequest, opts: NetworkEndpointGroupsListNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups/${ networkEndpointGroup }/listNetworkEndpoints`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as NetworkEndpointGroupsListNetworkEndpoints; } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async networkEndpointGroupsTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/networkEndpointGroups/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Inserts an association for the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesAddAssociation(firewallPolicy: string, project: string, req: FirewallPolicyAssociation, opts: NetworkFirewallPoliciesAddAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/addAssociation`); if (opts.replaceExistingAssociation !== undefined) { url.searchParams.append("replaceExistingAssociation", String(opts.replaceExistingAssociation)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Inserts a rule into a firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesAddRule(firewallPolicy: string, project: string, req: FirewallPolicyRule, opts: NetworkFirewallPoliciesAddRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/addRule`); if (opts.maxPriority !== undefined) { url.searchParams.append("maxPriority", String(opts.maxPriority)); } if (opts.minPriority !== undefined) { url.searchParams.append("minPriority", String(opts.minPriority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Copies rules to the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesCloneRules(firewallPolicy: string, project: string, opts: NetworkFirewallPoliciesCloneRulesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/cloneRules`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceFirewallPolicy !== undefined) { url.searchParams.append("sourceFirewallPolicy", String(opts.sourceFirewallPolicy)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified policy. * * @param firewallPolicy Name of the firewall policy to delete. * @param project Project ID for this request. */ async networkFirewallPoliciesDelete(firewallPolicy: string, project: string, opts: NetworkFirewallPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to get. * @param project Project ID for this request. */ async networkFirewallPoliciesGet(firewallPolicy: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallPolicy(data); } /** * Gets an association with the specified name. * * @param firewallPolicy Name of the firewall policy to which the queried association belongs. * @param project Project ID for this request. */ async networkFirewallPoliciesGetAssociation(firewallPolicy: string, project: string, opts: NetworkFirewallPoliciesGetAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/getAssociation`); if (opts.name !== undefined) { url.searchParams.append("name", String(opts.name)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPolicyAssociation; } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async networkFirewallPoliciesGetIamPolicy(project: string, resource: string, opts: NetworkFirewallPoliciesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Gets a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to which the queried rule belongs. * @param project Project ID for this request. */ async networkFirewallPoliciesGetRule(firewallPolicy: string, project: string, opts: NetworkFirewallPoliciesGetRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/getRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPolicyRule; } /** * Creates a new policy in the specified project using the data included in * the request. * * @param project Project ID for this request. */ async networkFirewallPoliciesInsert(project: string, req: FirewallPolicy, opts: NetworkFirewallPoliciesInsertOptions = {}): Promise { req = serializeFirewallPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists all the policies that have been configured for the specified * project. * * @param project Project ID for this request. */ async networkFirewallPoliciesList(project: string, opts: NetworkFirewallPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallPolicyList(data); } /** * Patches the specified policy with the data included in the request. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesPatch(firewallPolicy: string, project: string, req: FirewallPolicy, opts: NetworkFirewallPoliciesPatchOptions = {}): Promise { req = serializeFirewallPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Patches a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesPatchRule(firewallPolicy: string, project: string, req: FirewallPolicyRule, opts: NetworkFirewallPoliciesPatchRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/patchRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Removes an association for the specified firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesRemoveAssociation(firewallPolicy: string, project: string, opts: NetworkFirewallPoliciesRemoveAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/removeAssociation`); if (opts.name !== undefined) { url.searchParams.append("name", String(opts.name)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. */ async networkFirewallPoliciesRemoveRule(firewallPolicy: string, project: string, opts: NetworkFirewallPoliciesRemoveRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ firewallPolicy }/removeRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async networkFirewallPoliciesSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async networkFirewallPoliciesTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/firewallPolicies/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Adds a peering to the specified network. * * @param network Name of the network resource to add peering to. * @param project Project ID for this request. */ async networksAddPeering(network: string, project: string, req: NetworksAddPeeringRequest, opts: NetworksAddPeeringOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }/addPeering`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified network. * * @param network Name of the network to delete. * @param project Project ID for this request. */ async networksDelete(network: string, project: string, opts: NetworksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified network. * * @param network Name of the network to return. * @param project Project ID for this request. */ async networksGet(network: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetwork(data); } /** * Returns the effective firewalls on a given network. * * @param network Name of the network for this request. * @param project Project ID for this request. */ async networksGetEffectiveFirewalls(network: string, project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }/getEffectiveFirewalls`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworksGetEffectiveFirewallsResponse(data); } /** * Creates a network in the specified project using the data included in the * request. * * @param project Project ID for this request. */ async networksInsert(project: string, req: Network, opts: NetworksInsertOptions = {}): Promise { req = serializeNetwork(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of networks available to the specified project. * * @param project Project ID for this request. */ async networksList(project: string, opts: NetworksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkList(data); } /** * Lists the peering routes exchanged over peering connection. * * @param network Name of the network for this request. * @param project Project ID for this request. */ async networksListPeeringRoutes(network: string, project: string, opts: NetworksListPeeringRoutesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }/listPeeringRoutes`); if (opts.direction !== undefined) { url.searchParams.append("direction", String(opts.direction)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.peeringName !== undefined) { url.searchParams.append("peeringName", String(opts.peeringName)); } if (opts.region !== undefined) { url.searchParams.append("region", String(opts.region)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ExchangedPeeringRoutesList; } /** * Patches the specified network with the data included in the request. Only * routingConfig can be modified. * * @param network Name of the network to update. * @param project Project ID for this request. */ async networksPatch(network: string, project: string, req: Network, opts: NetworksPatchOptions = {}): Promise { req = serializeNetwork(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Removes a peering from the specified network. * * @param network Name of the network resource to remove peering from. * @param project Project ID for this request. */ async networksRemovePeering(network: string, project: string, req: NetworksRemovePeeringRequest, opts: NetworksRemovePeeringOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }/removePeering`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Switches the network mode from auto subnet mode to custom subnet mode. * * @param network Name of the network to be updated. * @param project Project ID for this request. */ async networksSwitchToCustomMode(network: string, project: string, opts: NetworksSwitchToCustomModeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }/switchToCustomMode`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Updates the specified network peering with the data included in the * request. You can only modify the NetworkPeering.export_custom_routes field * and the NetworkPeering.import_custom_routes field. * * @param network Name of the network resource which the updated peering is belonging to. * @param project Project ID for this request. */ async networksUpdatePeering(network: string, project: string, req: NetworksUpdatePeeringRequest, opts: NetworksUpdatePeeringOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/networks/${ network }/updatePeering`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Adds specified number of nodes to the node group. * * @param nodeGroup Name of the NodeGroup resource. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsAddNodes(nodeGroup: string, project: string, zone: string, req: NodeGroupsAddNodesRequest, opts: NodeGroupsAddNodesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }/addNodes`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of node groups. Note: use * nodeGroups.listNodes for more details about each group. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async nodeGroupsAggregatedList(project: string, opts: NodeGroupsAggregatedListOptions = {}): Promise { opts = serializeNodeGroupsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/nodeGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeGroupAggregatedList(data); } /** * Deletes the specified NodeGroup resource. * * @param nodeGroup Name of the NodeGroup resource to delete. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsDelete(nodeGroup: string, project: string, zone: string, opts: NodeGroupsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Deletes specified nodes from the node group. * * @param nodeGroup Name of the NodeGroup resource whose nodes will be deleted. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsDeleteNodes(nodeGroup: string, project: string, zone: string, req: NodeGroupsDeleteNodesRequest, opts: NodeGroupsDeleteNodesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }/deleteNodes`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified NodeGroup. Get a list of available NodeGroups by * making a list() request. Note: the "nodes" field should not be used. Use * nodeGroups.listNodes instead. * * @param nodeGroup Name of the node group to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsGet(nodeGroup: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeGroup(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async nodeGroupsGetIamPolicy(project: string, resource: string, zone: string, opts: NodeGroupsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a NodeGroup resource in the specified project using the data * included in the request. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsInsert(project: string, zone: string, req: NodeGroup, opts: NodeGroupsInsertOptions = {}): Promise { req = serializeNodeGroup(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups`); if (opts.initialNodeCount !== undefined) { url.searchParams.append("initialNodeCount", String(opts.initialNodeCount)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of node groups available to the specified project. Note: * use nodeGroups.listNodes for more details about each group. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsList(project: string, zone: string, opts: NodeGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeGroupList(data); } /** * Lists nodes in the node group. * * @param nodeGroup Name of the NodeGroup resource whose nodes you want to list. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsListNodes(nodeGroup: string, project: string, zone: string, opts: NodeGroupsListNodesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }/listNodes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return data as NodeGroupsListNodes; } /** * Updates the specified node group. * * @param nodeGroup Name of the NodeGroup resource to update. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsPatch(nodeGroup: string, project: string, zone: string, req: NodeGroup, opts: NodeGroupsPatchOptions = {}): Promise { req = serializeNodeGroup(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Perform maintenance on a subset of nodes in the node group. * * @param nodeGroup Name of the node group scoping this request. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsPerformMaintenance(nodeGroup: string, project: string, zone: string, req: NodeGroupsPerformMaintenanceRequest, opts: NodeGroupsPerformMaintenanceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }/performMaintenance`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async nodeGroupsSetIamPolicy(project: string, resource: string, zone: string, req: ZoneSetPolicyRequest): Promise { req = serializeZoneSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Updates the node template of the node group. * * @param nodeGroup Name of the NodeGroup resource to update. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsSetNodeTemplate(nodeGroup: string, project: string, zone: string, req: NodeGroupsSetNodeTemplateRequest, opts: NodeGroupsSetNodeTemplateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }/setNodeTemplate`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Simulates maintenance event on specified nodes from the node group. * * @param nodeGroup Name of the NodeGroup resource whose nodes will go under maintenance simulation. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeGroupsSimulateMaintenanceEvent(nodeGroup: string, project: string, zone: string, req: NodeGroupsSimulateMaintenanceEventRequest, opts: NodeGroupsSimulateMaintenanceEventOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ nodeGroup }/simulateMaintenanceEvent`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async nodeGroupsTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeGroups/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of node templates. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async nodeTemplatesAggregatedList(project: string, opts: NodeTemplatesAggregatedListOptions = {}): Promise { opts = serializeNodeTemplatesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/nodeTemplates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeTemplateAggregatedList(data); } /** * Deletes the specified NodeTemplate resource. * * @param nodeTemplate Name of the NodeTemplate resource to delete. * @param project Project ID for this request. * @param region The name of the region for this request. */ async nodeTemplatesDelete(nodeTemplate: string, project: string, region: string, opts: NodeTemplatesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates/${ nodeTemplate }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified node template. * * @param nodeTemplate Name of the node template to return. * @param project Project ID for this request. * @param region The name of the region for this request. */ async nodeTemplatesGet(nodeTemplate: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates/${ nodeTemplate }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeTemplate(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async nodeTemplatesGetIamPolicy(project: string, region: string, resource: string, opts: NodeTemplatesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a NodeTemplate resource in the specified project using the data * included in the request. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async nodeTemplatesInsert(project: string, region: string, req: NodeTemplate, opts: NodeTemplatesInsertOptions = {}): Promise { req = serializeNodeTemplate(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of node templates available to the specified project. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async nodeTemplatesList(project: string, region: string, opts: NodeTemplatesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeTemplateList(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async nodeTemplatesSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async nodeTemplatesTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/nodeTemplates/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of node types. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async nodeTypesAggregatedList(project: string, opts: NodeTypesAggregatedListOptions = {}): Promise { opts = serializeNodeTypesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/nodeTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeTypeAggregatedList(data); } /** * Returns the specified node type. * * @param nodeType Name of the node type to return. * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeTypesGet(nodeType: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeTypes/${ nodeType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeType(data); } /** * Retrieves a list of node types available to the specified project. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async nodeTypesList(project: string, zone: string, opts: NodeTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/nodeTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNodeTypeList(data); } /** * Retrieves an aggregated list of packetMirrorings. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async packetMirroringsAggregatedList(project: string, opts: PacketMirroringsAggregatedListOptions = {}): Promise { opts = serializePacketMirroringsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/packetMirrorings`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePacketMirroringAggregatedList(data); } /** * Deletes the specified PacketMirroring resource. * * @param packetMirroring Name of the PacketMirroring resource to delete. * @param project Project ID for this request. * @param region Name of the region for this request. */ async packetMirroringsDelete(packetMirroring: string, project: string, region: string, opts: PacketMirroringsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/packetMirrorings/${ packetMirroring }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified PacketMirroring resource. * * @param packetMirroring Name of the PacketMirroring resource to return. * @param project Project ID for this request. * @param region Name of the region for this request. */ async packetMirroringsGet(packetMirroring: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/packetMirrorings/${ packetMirroring }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePacketMirroring(data); } /** * Creates a PacketMirroring resource in the specified project and region * using the data included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async packetMirroringsInsert(project: string, region: string, req: PacketMirroring, opts: PacketMirroringsInsertOptions = {}): Promise { req = serializePacketMirroring(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/packetMirrorings`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of PacketMirroring resources available to the specified * project and region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async packetMirroringsList(project: string, region: string, opts: PacketMirroringsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/packetMirrorings`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePacketMirroringList(data); } /** * Patches the specified PacketMirroring resource with the data included in * the request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param packetMirroring Name of the PacketMirroring resource to patch. * @param project Project ID for this request. * @param region Name of the region for this request. */ async packetMirroringsPatch(packetMirroring: string, project: string, region: string, req: PacketMirroring, opts: PacketMirroringsPatchOptions = {}): Promise { req = serializePacketMirroring(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/packetMirrorings/${ packetMirroring }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async packetMirroringsTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/packetMirrorings/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Disable this project as a shared VPC host project. * * @param project Project ID for this request. */ async projectsDisableXpnHost(project: string, opts: ProjectsDisableXpnHostOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/disableXpnHost`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Disable a service resource (also known as service project) associated with * this host project. * * @param project Project ID for this request. */ async projectsDisableXpnResource(project: string, req: ProjectsDisableXpnResourceRequest, opts: ProjectsDisableXpnResourceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/disableXpnResource`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Enable this project as a shared VPC host project. * * @param project Project ID for this request. */ async projectsEnableXpnHost(project: string, opts: ProjectsEnableXpnHostOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/enableXpnHost`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Enable service resource (a.k.a service project) for a host project, so * that subnets in the host project can be used by instances in the service * project. * * @param project Project ID for this request. */ async projectsEnableXpnResource(project: string, req: ProjectsEnableXpnResourceRequest, opts: ProjectsEnableXpnResourceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/enableXpnResource`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified Project resource. To decrease latency for this * method, you can optionally omit any unneeded information from the response * by using a field mask. This practice is especially recommended for unused * quota information (the `quotas` field). To exclude one or more fields, set * your request's `fields` query parameter to only include the fields you * need. For example, to only include the `id` and `selfLink` fields, add the * query parameter `?fields=id,selfLink` to your request. * * @param project Project ID for this request. */ async projectsGet(project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeProject(data); } /** * Gets the shared VPC host project that this project links to. May be empty * if no link exists. * * @param project Project ID for this request. */ async projectsGetXpnHost(project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/getXpnHost`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeProject(data); } /** * Gets service resources (a.k.a service project) associated with this host * project. * * @param project Project ID for this request. */ async projectsGetXpnResources(project: string, opts: ProjectsGetXpnResourcesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/getXpnResources`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ProjectsGetXpnResources; } /** * Lists all shared VPC host projects visible to the user in an organization. * * @param project Project ID for this request. */ async projectsListXpnHosts(project: string, req: ProjectsListXpnHostsRequest, opts: ProjectsListXpnHostsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/listXpnHosts`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeXpnHostList(data); } /** * Moves a persistent disk from one zone to another. * * @param project Project ID for this request. */ async projectsMoveDisk(project: string, req: DiskMoveRequest, opts: ProjectsMoveDiskOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/moveDisk`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Moves an instance and its attached persistent disks from one zone to * another. *Note*: Moving VMs or disks by using this method might cause * unexpected behavior. For more information, see the [known * issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). * [Deprecated] This method is deprecated. See [moving instance across * zones](/compute/docs/instances/moving-instance-across-zones) instead. * * @param project Project ID for this request. */ async projectsMoveInstance(project: string, req: InstanceMoveRequest, opts: ProjectsMoveInstanceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/moveInstance`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the * billing account of the project must be subscribed to Cloud Armor * Enterprise. See Subscribing to Cloud Armor Enterprise for more information. * * @param project Project ID for this request. */ async projectsSetCloudArmorTier(project: string, req: ProjectsSetCloudArmorTierRequest, opts: ProjectsSetCloudArmorTierOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/setCloudArmorTier`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets metadata common to all instances within the specified project using * the data included in the request. * * @param project Project ID for this request. */ async projectsSetCommonInstanceMetadata(project: string, req: Metadata, opts: ProjectsSetCommonInstanceMetadataOptions = {}): Promise { req = serializeMetadata(req); const url = new URL(`${this.#baseUrl}projects/${ project }/setCommonInstanceMetadata`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the default network tier of the project. The default network tier is * used when an address/forwardingRule/instance is created without specifying * the network tier field. * * @param project Project ID for this request. */ async projectsSetDefaultNetworkTier(project: string, req: ProjectsSetDefaultNetworkTierRequest, opts: ProjectsSetDefaultNetworkTierOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/setDefaultNetworkTier`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Enables the usage export feature and sets the usage export bucket where * reports are stored. If you provide an empty request body using this method, * the usage export feature will be disabled. * * @param project Project ID for this request. */ async projectsSetUsageExportBucket(project: string, req: UsageExportLocation, opts: ProjectsSetUsageExportBucketOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/setUsageExportBucket`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Announces the specified PublicAdvertisedPrefix * * @param project Project ID for this request. * @param publicAdvertisedPrefix The name of the public advertised prefix. It should comply with RFC1035. */ async publicAdvertisedPrefixesAnnounce(project: string, publicAdvertisedPrefix: string, opts: PublicAdvertisedPrefixesAnnounceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes/${ publicAdvertisedPrefix }/announce`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified PublicAdvertisedPrefix * * @param project Project ID for this request. * @param publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to delete. */ async publicAdvertisedPrefixesDelete(project: string, publicAdvertisedPrefix: string, opts: PublicAdvertisedPrefixesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes/${ publicAdvertisedPrefix }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified PublicAdvertisedPrefix resource. * * @param project Project ID for this request. * @param publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to return. */ async publicAdvertisedPrefixesGet(project: string, publicAdvertisedPrefix: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes/${ publicAdvertisedPrefix }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicAdvertisedPrefix(data); } /** * Creates a PublicAdvertisedPrefix in the specified project using the * parameters that are included in the request. * * @param project Project ID for this request. */ async publicAdvertisedPrefixesInsert(project: string, req: PublicAdvertisedPrefix, opts: PublicAdvertisedPrefixesInsertOptions = {}): Promise { req = serializePublicAdvertisedPrefix(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the PublicAdvertisedPrefixes for a project. * * @param project Project ID for this request. */ async publicAdvertisedPrefixesList(project: string, opts: PublicAdvertisedPrefixesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicAdvertisedPrefixList(data); } /** * Patches the specified Router resource with the data included in the * request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to patch. */ async publicAdvertisedPrefixesPatch(project: string, publicAdvertisedPrefix: string, req: PublicAdvertisedPrefix, opts: PublicAdvertisedPrefixesPatchOptions = {}): Promise { req = serializePublicAdvertisedPrefix(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes/${ publicAdvertisedPrefix }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Withdraws the specified PublicAdvertisedPrefix * * @param project Project ID for this request. * @param publicAdvertisedPrefix The name of the public advertised prefix. It should comply with RFC1035. */ async publicAdvertisedPrefixesWithdraw(project: string, publicAdvertisedPrefix: string, opts: PublicAdvertisedPrefixesWithdrawOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/publicAdvertisedPrefixes/${ publicAdvertisedPrefix }/withdraw`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Lists all PublicDelegatedPrefix resources owned by the specific project * across all scopes. To prevent failure, Google recommends that you set the * `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async publicDelegatedPrefixesAggregatedList(project: string, opts: PublicDelegatedPrefixesAggregatedListOptions = {}): Promise { opts = serializePublicDelegatedPrefixesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/publicDelegatedPrefixes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicDelegatedPrefixAggregatedList(data); } /** * Announces the specified PublicDelegatedPrefix in the given region. * * @param project Project ID for this request. * @param publicDelegatedPrefix The name of the public delegated prefix. It should comply with RFC1035. * @param region The name of the region where the public delegated prefix is located. It should comply with RFC1035. */ async publicDelegatedPrefixesAnnounce(project: string, publicDelegatedPrefix: string, region: string, opts: PublicDelegatedPrefixesAnnounceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes/${ publicDelegatedPrefix }/announce`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified PublicDelegatedPrefix in the given region. * * @param project Project ID for this request. * @param publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to delete. * @param region Name of the region of this request. */ async publicDelegatedPrefixesDelete(project: string, publicDelegatedPrefix: string, region: string, opts: PublicDelegatedPrefixesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes/${ publicDelegatedPrefix }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified PublicDelegatedPrefix resource in the given region. * * @param project Project ID for this request. * @param publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to return. * @param region Name of the region of this request. */ async publicDelegatedPrefixesGet(project: string, publicDelegatedPrefix: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes/${ publicDelegatedPrefix }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicDelegatedPrefix(data); } /** * Creates a PublicDelegatedPrefix in the specified project in the given * region using the parameters that are included in the request. * * @param project Project ID for this request. * @param region Name of the region of this request. */ async publicDelegatedPrefixesInsert(project: string, region: string, req: PublicDelegatedPrefix, opts: PublicDelegatedPrefixesInsertOptions = {}): Promise { req = serializePublicDelegatedPrefix(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the PublicDelegatedPrefixes for a project in the given region. * * @param project Project ID for this request. * @param region Name of the region of this request. */ async publicDelegatedPrefixesList(project: string, region: string, opts: PublicDelegatedPrefixesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePublicDelegatedPrefixList(data); } /** * Patches the specified PublicDelegatedPrefix resource with the data * included in the request. This method supports PATCH semantics and uses JSON * merge patch format and processing rules. * * @param project Project ID for this request. * @param publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to patch. * @param region Name of the region for this request. */ async publicDelegatedPrefixesPatch(project: string, publicDelegatedPrefix: string, region: string, req: PublicDelegatedPrefix, opts: PublicDelegatedPrefixesPatchOptions = {}): Promise { req = serializePublicDelegatedPrefix(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes/${ publicDelegatedPrefix }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Withdraws the specified PublicDelegatedPrefix in the given region. * * @param project Project ID for this request. * @param publicDelegatedPrefix The name of the public delegated prefix. It should comply with RFC1035. * @param region The name of the region where the public delegated prefix is located. It should comply with RFC1035. */ async publicDelegatedPrefixesWithdraw(project: string, publicDelegatedPrefix: string, region: string, opts: PublicDelegatedPrefixesWithdrawOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/publicDelegatedPrefixes/${ publicDelegatedPrefix }/withdraw`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified autoscaler. * * @param autoscaler Name of the autoscaler to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionAutoscalersDelete(autoscaler: string, project: string, region: string, opts: RegionAutoscalersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/autoscalers/${ autoscaler }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified autoscaler. * * @param autoscaler Name of the autoscaler to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionAutoscalersGet(autoscaler: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/autoscalers/${ autoscaler }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAutoscaler(data); } /** * Creates an autoscaler in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionAutoscalersInsert(project: string, region: string, req: Autoscaler, opts: RegionAutoscalersInsertOptions = {}): Promise { req = serializeAutoscaler(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/autoscalers`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of autoscalers contained within the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionAutoscalersList(project: string, region: string, opts: RegionAutoscalersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/autoscalers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegionAutoscalerList(data); } /** * Updates an autoscaler in the specified project using the data included in * the request. This method supports PATCH semantics and uses the JSON merge * patch format and processing rules. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionAutoscalersPatch(project: string, region: string, req: Autoscaler, opts: RegionAutoscalersPatchOptions = {}): Promise { req = serializeAutoscaler(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/autoscalers`); if (opts.autoscaler !== undefined) { url.searchParams.append("autoscaler", String(opts.autoscaler)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates an autoscaler in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionAutoscalersUpdate(project: string, region: string, req: Autoscaler, opts: RegionAutoscalersUpdateOptions = {}): Promise { req = serializeAutoscaler(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/autoscalers`); if (opts.autoscaler !== undefined) { url.searchParams.append("autoscaler", String(opts.autoscaler)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Deletes the specified regional BackendService resource. * * @param backendService Name of the BackendService resource to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesDelete(backendService: string, project: string, region: string, opts: RegionBackendServicesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ backendService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified regional BackendService resource. * * @param backendService Name of the BackendService resource to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesGet(backendService: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ backendService }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendService(data); } /** * Gets the most recent health check results for this regional * BackendService. * * @param backendService Name of the BackendService resource for which to get health. * @param region Name of the region scoping this request. */ async regionBackendServicesGetHealth(backendService: string, project: string, region: string, req: ResourceGroupReference): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ backendService }/getHealth`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as BackendServiceGroupHealth; } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionBackendServicesGetIamPolicy(project: string, region: string, resource: string, opts: RegionBackendServicesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a regional BackendService resource in the specified project using * the data included in the request. For more information, see Backend * services overview. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesInsert(project: string, region: string, req: BackendService, opts: RegionBackendServicesInsertOptions = {}): Promise { req = serializeBackendService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of regional BackendService resources available to the * specified project in the given region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesList(project: string, region: string, opts: RegionBackendServicesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendServiceList(data); } /** * Retrieves a list of all usable backend services in the specified project * in the given region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. */ async regionBackendServicesListUsable(project: string, region: string, opts: RegionBackendServicesListUsableOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/listUsable`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBackendServiceListUsable(data); } /** * Updates the specified regional BackendService resource with the data * included in the request. For more information, see Understanding backend * services This method supports PATCH semantics and uses the JSON merge patch * format and processing rules. * * @param backendService Name of the BackendService resource to patch. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesPatch(backendService: string, project: string, region: string, req: BackendService, opts: RegionBackendServicesPatchOptions = {}): Promise { req = serializeBackendService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ backendService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionBackendServicesSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the Google Cloud Armor security policy for the specified backend * service. For more information, see Google Cloud Armor Overview * * @param backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesSetSecurityPolicy(backendService: string, project: string, region: string, req: SecurityPolicyReference, opts: RegionBackendServicesSetSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ backendService }/setSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionBackendServicesTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Updates the specified regional BackendService resource with the data * included in the request. For more information, see Backend services * overview . * * @param backendService Name of the BackendService resource to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionBackendServicesUpdate(backendService: string, project: string, region: string, req: BackendService, opts: RegionBackendServicesUpdateOptions = {}): Promise { req = serializeBackendService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/backendServices/${ backendService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of commitments by region. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async regionCommitmentsAggregatedList(project: string, opts: RegionCommitmentsAggregatedListOptions = {}): Promise { opts = serializeRegionCommitmentsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/commitments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeCommitmentAggregatedList(data); } /** * Returns the specified commitment resource. * * @param commitment Name of the commitment to return. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionCommitmentsGet(commitment: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/commitments/${ commitment }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeCommitment(data); } /** * Creates a commitment in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionCommitmentsInsert(project: string, region: string, req: Commitment, opts: RegionCommitmentsInsertOptions = {}): Promise { req = serializeCommitment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/commitments`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of commitments contained within the specified region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionCommitmentsList(project: string, region: string, opts: RegionCommitmentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/commitments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeCommitmentList(data); } /** * Updates the specified commitment with the data included in the request. * Update is performed only on selected fields included as part of * update-mask. Only the following fields can be modified: auto_renew. * * @param commitment Name of the commitment for which auto renew is being updated. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionCommitmentsUpdate(commitment: string, project: string, region: string, req: Commitment, opts: RegionCommitmentsUpdateOptions = {}): Promise { req = serializeCommitment(req); opts = serializeRegionCommitmentsUpdateOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/commitments/${ commitment }`); if (opts.paths !== undefined) { url.searchParams.append("paths", String(opts.paths)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Adds existing resource policies to a regional disk. You can only add one * policy which will be applied to this disk for scheduling snapshot creation. * * @param disk The disk name for this request. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDisksAddResourcePolicies(disk: string, project: string, region: string, req: RegionDisksAddResourcePoliciesRequest, opts: RegionDisksAddResourcePoliciesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }/addResourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Bulk create a set of disks. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDisksBulkInsert(project: string, region: string, req: BulkInsertDiskResource, opts: RegionDisksBulkInsertOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/bulkInsert`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Creates a snapshot of a specified persistent disk. For regular snapshot * creation, consider using snapshots.insert instead, as that method supports * more features, such as creating snapshots in a project different from the * source disk project. * * @param disk Name of the regional persistent disk to snapshot. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionDisksCreateSnapshot(disk: string, project: string, region: string, req: Snapshot, opts: RegionDisksCreateSnapshotOptions = {}): Promise { req = serializeSnapshot(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }/createSnapshot`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified regional persistent disk. Deleting a regional disk * removes all the replicas of its data permanently and is irreversible. * However, deleting a disk does not delete any snapshots previously made from * the disk. You must separately delete snapshots. * * @param disk Name of the regional persistent disk to delete. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionDisksDelete(disk: string, project: string, region: string, opts: RegionDisksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns a specified regional persistent disk. * * @param disk Name of the regional persistent disk to return. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionDisksGet(disk: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDisk(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionDisksGetIamPolicy(project: string, region: string, resource: string, opts: RegionDisksGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a persistent regional disk in the specified project using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionDisksInsert(project: string, region: string, req: Disk, opts: RegionDisksInsertOptions = {}): Promise { req = serializeDisk(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceImage !== undefined) { url.searchParams.append("sourceImage", String(opts.sourceImage)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of persistent disks contained within the specified * region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionDisksList(project: string, region: string, opts: RegionDisksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskList(data); } /** * Removes resource policies from a regional disk. * * @param disk The disk name for this request. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDisksRemoveResourcePolicies(disk: string, project: string, region: string, req: RegionDisksRemoveResourcePoliciesRequest, opts: RegionDisksRemoveResourcePoliciesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }/removeResourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Resizes the specified regional persistent disk. * * @param disk Name of the regional persistent disk. * @param project The project ID for this request. * @param region Name of the region for this request. */ async regionDisksResize(disk: string, project: string, region: string, req: RegionDisksResizeRequest, opts: RegionDisksResizeOptions = {}): Promise { req = serializeRegionDisksResizeRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }/resize`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionDisksSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the labels on the target regional disk. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async regionDisksSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: RegionDisksSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Starts asynchronous replication. Must be invoked on the primary disk. * * @param disk The name of the persistent disk. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDisksStartAsyncReplication(disk: string, project: string, region: string, req: RegionDisksStartAsyncReplicationRequest, opts: RegionDisksStartAsyncReplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }/startAsyncReplication`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Stops asynchronous replication. Can be invoked either on the primary or on * the secondary disk. * * @param disk The name of the persistent disk. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDisksStopAsyncReplication(disk: string, project: string, region: string, opts: RegionDisksStopAsyncReplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }/stopAsyncReplication`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Stops asynchronous replication for a consistency group of disks. Can be * invoked either in the primary or secondary scope. * * @param project Project ID for this request. * @param region The name of the region for this request. This must be the region of the primary or secondary disks in the consistency group. */ async regionDisksStopGroupAsyncReplication(project: string, region: string, req: DisksStopGroupAsyncReplicationResource, opts: RegionDisksStopGroupAsyncReplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/stopGroupAsyncReplication`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionDisksTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Update the specified disk with the data included in the request. Update is * performed only on selected fields included as part of update-mask. Only the * following fields can be modified: user_license. * * @param disk The disk name for this request. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDisksUpdate(disk: string, project: string, region: string, req: Disk, opts: RegionDisksUpdateOptions = {}): Promise { req = serializeDisk(req); opts = serializeRegionDisksUpdateOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/disks/${ disk }`); if (opts.paths !== undefined) { url.searchParams.append("paths", String(opts.paths)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Returns the specified regional disk type. * * @param diskType Name of the disk type to return. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDiskTypesGet(diskType: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/diskTypes/${ diskType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDiskType(data); } /** * Retrieves a list of regional disk types available to the specified * project. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionDiskTypesList(project: string, region: string, opts: RegionDiskTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/diskTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegionDiskTypeList(data); } /** * Deletes the specified HealthCheck resource. * * @param healthCheck Name of the HealthCheck resource to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthChecksDelete(healthCheck: string, project: string, region: string, opts: RegionHealthChecksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthChecks/${ healthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Deletes the specified regional HealthCheckService. * * @param healthCheckService Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthCheckServicesDelete(healthCheckService: string, project: string, region: string, opts: RegionHealthCheckServicesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthCheckServices/${ healthCheckService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified regional HealthCheckService resource. * * @param healthCheckService Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthCheckServicesGet(healthCheckService: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthCheckServices/${ healthCheckService }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthCheckService(data); } /** * Creates a regional HealthCheckService resource in the specified project * and region using the data included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthCheckServicesInsert(project: string, region: string, req: HealthCheckService, opts: RegionHealthCheckServicesInsertOptions = {}): Promise { req = serializeHealthCheckService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthCheckServices`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists all the HealthCheckService resources that have been configured for * the specified project in the given region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthCheckServicesList(project: string, region: string, opts: RegionHealthCheckServicesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthCheckServices`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthCheckServicesList(data); } /** * Updates the specified regional HealthCheckService resource with the data * included in the request. This method supports PATCH semantics and uses the * JSON merge patch format and processing rules. * * @param healthCheckService Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthCheckServicesPatch(healthCheckService: string, project: string, region: string, req: HealthCheckService, opts: RegionHealthCheckServicesPatchOptions = {}): Promise { req = serializeHealthCheckService(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthCheckServices/${ healthCheckService }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Returns the specified HealthCheck resource. * * @param healthCheck Name of the HealthCheck resource to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthChecksGet(healthCheck: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthChecks/${ healthCheck }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthCheck(data); } /** * Creates a HealthCheck resource in the specified project using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthChecksInsert(project: string, region: string, req: HealthCheck, opts: RegionHealthChecksInsertOptions = {}): Promise { req = serializeHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthChecks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of HealthCheck resources available to the specified * project. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthChecksList(project: string, region: string, opts: RegionHealthChecksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthChecks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeHealthCheckList(data); } /** * Updates a HealthCheck resource in the specified project using the data * included in the request. This method supports PATCH semantics and uses the * JSON merge patch format and processing rules. * * @param healthCheck Name of the HealthCheck resource to patch. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthChecksPatch(healthCheck: string, project: string, region: string, req: HealthCheck, opts: RegionHealthChecksPatchOptions = {}): Promise { req = serializeHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthChecks/${ healthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates a HealthCheck resource in the specified project using the data * included in the request. * * @param healthCheck Name of the HealthCheck resource to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionHealthChecksUpdate(healthCheck: string, project: string, region: string, req: HealthCheck, opts: RegionHealthChecksUpdateOptions = {}): Promise { req = serializeHealthCheck(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/healthChecks/${ healthCheck }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Flags the specified instances to be immediately removed from the managed * instance group. Abandoning an instance does not delete the instance, but it * does remove the instance from any target pools that are applied by the * managed instance group. This method reduces the targetSize of the managed * instance group by the number of instances that you abandon. This operation * is marked as DONE when the action is scheduled even if the instances have * not yet been removed from the group. You must separately verify the status * of the abandoning action with the listmanagedinstances method. If the group * is part of a backend service that has enabled connection draining, it can * take up to 60 seconds after the connection draining duration has elapsed * before the VM instance is removed or deleted. You can specify a maximum of * 1000 instances with this method per request. * * @param instanceGroupManager Name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersAbandonInstances(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersAbandonInstancesRequest, opts: RegionInstanceGroupManagersAbandonInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/abandonInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Apply updates to selected instances the managed instance group. * * @param instanceGroupManager The name of the managed instance group, should conform to RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request, should conform to RFC1035. */ async regionInstanceGroupManagersApplyUpdatesToInstances(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersApplyUpdatesRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/applyUpdatesToInstances`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Creates instances with per-instance configurations in this regional * managed instance group. Instances are created using the current instance * template. The create instances operation is marked DONE if the * createInstances request is successful. The underlying actions take * additional time. You must separately verify the status of the creating or * actions with the listmanagedinstances method. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param region The name of the region where the managed instance group is located. It should conform to RFC1035. */ async regionInstanceGroupManagersCreateInstances(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersCreateInstancesRequest, opts: RegionInstanceGroupManagersCreateInstancesOptions = {}): Promise { req = serializeRegionInstanceGroupManagersCreateInstancesRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/createInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified managed instance group and all of the instances in * that group. * * @param instanceGroupManager Name of the managed instance group to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersDelete(instanceGroupManager: string, project: string, region: string, opts: RegionInstanceGroupManagersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Flags the specified instances in the managed instance group to be * immediately deleted. The instances are also removed from any target pools * of which they were a member. This method reduces the targetSize of the * managed instance group by the number of instances that you delete. The * deleteInstances operation is marked DONE if the deleteInstances request is * successful. The underlying actions take additional time. You must * separately verify the status of the deleting action with the * listmanagedinstances method. If the group is part of a backend service that * has enabled connection draining, it can take up to 60 seconds after the * connection draining duration has elapsed before the VM instance is removed * or deleted. You can specify a maximum of 1000 instances with this method * per request. * * @param instanceGroupManager Name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersDeleteInstances(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersDeleteInstancesRequest, opts: RegionInstanceGroupManagersDeleteInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/deleteInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes selected per-instance configurations for the managed instance * group. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request, should conform to RFC1035. */ async regionInstanceGroupManagersDeletePerInstanceConfigs(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagerDeleteInstanceConfigReq): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/deletePerInstanceConfigs`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns all of the details about the specified managed instance group. * * @param instanceGroupManager Name of the managed instance group to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersGet(instanceGroupManager: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroupManager(data); } /** * Creates a managed instance group using the information that you specify in * the request. After the group is created, instances in the group are created * using the specified instance template. This operation is marked as DONE * when the group is created even if the instances in the group have not yet * been created. You must separately verify the status of the individual * instances with the listmanagedinstances method. A regional managed instance * group can contain up to 2000 instances. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersInsert(project: string, region: string, req: InstanceGroupManager, opts: RegionInstanceGroupManagersInsertOptions = {}): Promise { req = serializeInstanceGroupManager(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of managed instance groups that are contained within * the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersList(project: string, region: string, opts: RegionInstanceGroupManagersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegionInstanceGroupManagerList(data); } /** * Lists all errors thrown by actions on instances for a given regional * managed instance group. The filter and orderBy query parameters are not * supported. * * @param instanceGroupManager The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. * @param project Project ID for this request. * @param region Name of the region scoping this request. This should conform to RFC1035. */ async regionInstanceGroupManagersListErrors(instanceGroupManager: string, project: string, region: string, opts: RegionInstanceGroupManagersListErrorsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/listErrors`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as RegionInstanceGroupManagersListErrorsResponse; } /** * Lists the instances in the managed instance group and instances that are * scheduled to be created. The list includes any current actions that the * group has scheduled for its instances. The orderBy query parameter is not * supported. The `pageToken` query parameter is supported only if the group's * `listManagedInstancesResults` field is set to `PAGINATED`. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersListManagedInstances(instanceGroupManager: string, project: string, region: string, opts: RegionInstanceGroupManagersListManagedInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/listManagedInstances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeRegionInstanceGroupManagersListInstancesResponse(data); } /** * Lists all of the per-instance configurations defined for the managed * instance group. The orderBy query parameter is not supported. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request, should conform to RFC1035. */ async regionInstanceGroupManagersListPerInstanceConfigs(instanceGroupManager: string, project: string, region: string, opts: RegionInstanceGroupManagersListPerInstanceConfigsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/listPerInstanceConfigs`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeRegionInstanceGroupManagersListInstanceConfigsResp(data); } /** * Updates a managed instance group using the information that you specify in * the request. This operation is marked as DONE when the group is patched * even if the instances in the group are still in the process of being * patched. You must separately verify the status of the individual instances * with the listmanagedinstances method. This method supports PATCH semantics * and uses the JSON merge patch format and processing rules. If you update * your group to specify a new template or instance configuration, it's * possible that your intended specification for each VM in the group is * different from the current state of that VM. To learn how to apply an * updated configuration to the VMs in a MIG, see Updating instances in a MIG. * * @param instanceGroupManager The name of the instance group manager. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersPatch(instanceGroupManager: string, project: string, region: string, req: InstanceGroupManager, opts: RegionInstanceGroupManagersPatchOptions = {}): Promise { req = serializeInstanceGroupManager(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Inserts or patches per-instance configurations for the managed instance * group. perInstanceConfig.name serves as a key used to distinguish whether * to perform insert or patch. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request, should conform to RFC1035. */ async regionInstanceGroupManagersPatchPerInstanceConfigs(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagerPatchInstanceConfigReq, opts: RegionInstanceGroupManagersPatchPerInstanceConfigsOptions = {}): Promise { req = serializeRegionInstanceGroupManagerPatchInstanceConfigReq(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/patchPerInstanceConfigs`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Flags the specified VM instances in the managed instance group to be * immediately recreated. Each instance is recreated using the group's current * configuration. This operation is marked as DONE when the flag is set even * if the instances have not yet been recreated. You must separately verify * the status of each instance by checking its currentAction field; for more * information, see Checking the status of managed instances. If the group is * part of a backend service that has enabled connection draining, it can take * up to 60 seconds after the connection draining duration has elapsed before * the VM instance is removed or deleted. You can specify a maximum of 1000 * instances with this method per request. * * @param instanceGroupManager Name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersRecreateInstances(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersRecreateRequest, opts: RegionInstanceGroupManagersRecreateInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/recreateInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the intended size of the managed instance group. If you increase * the size, the group creates new instances using the current instance * template. If you decrease the size, the group deletes one or more * instances. The resize operation is marked DONE if the resize request is * successful. The underlying actions take additional time. You must * separately verify the status of the creating or deleting actions with the * listmanagedinstances method. If the group is part of a backend service that * has enabled connection draining, it can take up to 60 seconds after the * connection draining duration has elapsed before the VM instance is removed * or deleted. * * @param instanceGroupManager Name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersResize(instanceGroupManager: string, project: string, region: string, opts: RegionInstanceGroupManagersResizeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/resize`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.size !== undefined) { url.searchParams.append("size", String(opts.size)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the instance template to use when creating new instances or * recreating instances in this group. Existing instances are not affected. * * @param instanceGroupManager The name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersSetInstanceTemplate(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersSetTemplateRequest, opts: RegionInstanceGroupManagersSetInstanceTemplateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/setInstanceTemplate`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Modifies the target pools to which all new instances in this group are * assigned. Existing instances in the group are not affected. * * @param instanceGroupManager Name of the managed instance group. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupManagersSetTargetPools(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagersSetTargetPoolsRequest, opts: RegionInstanceGroupManagersSetTargetPoolsOptions = {}): Promise { req = serializeRegionInstanceGroupManagersSetTargetPoolsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/setTargetPools`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Inserts or updates per-instance configurations for the managed instance * group. perInstanceConfig.name serves as a key used to distinguish whether * to perform insert or patch. * * @param instanceGroupManager The name of the managed instance group. It should conform to RFC1035. * @param project Project ID for this request. * @param region Name of the region scoping this request, should conform to RFC1035. */ async regionInstanceGroupManagersUpdatePerInstanceConfigs(instanceGroupManager: string, project: string, region: string, req: RegionInstanceGroupManagerUpdateInstanceConfigReq, opts: RegionInstanceGroupManagersUpdatePerInstanceConfigsOptions = {}): Promise { req = serializeRegionInstanceGroupManagerUpdateInstanceConfigReq(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroupManagers/${ instanceGroupManager }/updatePerInstanceConfigs`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified instance group resource. * * @param instanceGroup Name of the instance group resource to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupsGet(instanceGroup: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroups/${ instanceGroup }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceGroup(data); } /** * Retrieves the list of instance group resources contained within the * specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupsList(project: string, region: string, opts: RegionInstanceGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegionInstanceGroupList(data); } /** * Lists the instances in the specified instance group and displays * information about the named ports. Depending on the specified options, this * method can list all instances or only the instances that are running. The * orderBy query parameter is not supported. * * @param instanceGroup Name of the regional instance group for which we want to list the instances. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupsListInstances(instanceGroup: string, project: string, region: string, req: RegionInstanceGroupsListInstancesRequest, opts: RegionInstanceGroupsListInstancesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroups/${ instanceGroup }/listInstances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as RegionInstanceGroupsListInstances; } /** * Sets the named ports for the specified regional instance group. * * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionInstanceGroupsSetNamedPorts(instanceGroup: string, project: string, region: string, req: RegionInstanceGroupsSetNamedPortsRequest, opts: RegionInstanceGroupsSetNamedPortsOptions = {}): Promise { req = serializeRegionInstanceGroupsSetNamedPortsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceGroups/${ instanceGroup }/setNamedPorts`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Creates multiple instances in a given region. Count specifies the number * of instances to create. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstancesBulkInsert(project: string, region: string, req: BulkInsertInstanceResource, opts: RegionInstancesBulkInsertOptions = {}): Promise { req = serializeBulkInsertInstanceResource(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instances/bulkInsert`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified instance template. Deleting an instance template is * permanent and cannot be undone. * * @param instanceTemplate The name of the instance template to delete. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstanceTemplatesDelete(instanceTemplate: string, project: string, region: string, opts: RegionInstanceTemplatesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceTemplates/${ instanceTemplate }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified instance template. * * @param instanceTemplate The name of the instance template. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstanceTemplatesGet(instanceTemplate: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceTemplates/${ instanceTemplate }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceTemplate(data); } /** * Creates an instance template in the specified project and region using the * global instance template whose URL is included in the request. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstanceTemplatesInsert(project: string, region: string, req: InstanceTemplate, opts: RegionInstanceTemplatesInsertOptions = {}): Promise { req = serializeInstanceTemplate(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceTemplates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of instance templates that are contained within the * specified project and region. * * @param project Project ID for this request. * @param region The name of the regions for this request. */ async regionInstanceTemplatesList(project: string, region: string, opts: RegionInstanceTemplatesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instanceTemplates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstanceTemplateList(data); } /** * Deletes the specified InstantSnapshot resource. Keep in mind that deleting * a single instantSnapshot might not necessarily delete all the data on that * instantSnapshot. If any data on the instantSnapshot that is marked for * deletion is needed for subsequent instantSnapshots, the data will be moved * to the next corresponding instantSnapshot. For more information, see * Deleting instantSnapshots. * * @param instantSnapshot Name of the InstantSnapshot resource to delete. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstantSnapshotsDelete(instantSnapshot: string, project: string, region: string, opts: RegionInstantSnapshotsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots/${ instantSnapshot }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified InstantSnapshot resource in the specified region. * * @param instantSnapshot Name of the InstantSnapshot resource to return. * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstantSnapshotsGet(instantSnapshot: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots/${ instantSnapshot }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstantSnapshot(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionInstantSnapshotsGetIamPolicy(project: string, region: string, resource: string, opts: RegionInstantSnapshotsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates an instant snapshot in the specified region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionInstantSnapshotsInsert(project: string, region: string, req: InstantSnapshot, opts: RegionInstantSnapshotsInsertOptions = {}): Promise { req = serializeInstantSnapshot(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of InstantSnapshot resources contained within the * specified region. * * @param project Project ID for this request. * @param region The name of the region for this request. */ async regionInstantSnapshotsList(project: string, region: string, opts: RegionInstantSnapshotsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeInstantSnapshotList(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionInstantSnapshotsSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the labels on a instantSnapshot in the given region. To learn more * about labels, read the Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async regionInstantSnapshotsSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: RegionInstantSnapshotsSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionInstantSnapshotsTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/instantSnapshots/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Attach a list of network endpoints to the specified network endpoint * group. * * @param networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. * @param project Project ID for this request. * @param region The name of the region where you want to create the network endpoint group. It should comply with RFC1035. */ async regionNetworkEndpointGroupsAttachNetworkEndpoints(networkEndpointGroup: string, project: string, region: string, req: RegionNetworkEndpointGroupsAttachEndpointsRequest, opts: RegionNetworkEndpointGroupsAttachNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups/${ networkEndpointGroup }/attachNetworkEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified network endpoint group. Note that the NEG cannot be * deleted if it is configured as a backend of a backend service. * * @param networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. * @param project Project ID for this request. * @param region The name of the region where the network endpoint group is located. It should comply with RFC1035. */ async regionNetworkEndpointGroupsDelete(networkEndpointGroup: string, project: string, region: string, opts: RegionNetworkEndpointGroupsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups/${ networkEndpointGroup }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Detach the network endpoint from the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. * @param project Project ID for this request. * @param region The name of the region where the network endpoint group is located. It should comply with RFC1035. */ async regionNetworkEndpointGroupsDetachNetworkEndpoints(networkEndpointGroup: string, project: string, region: string, req: RegionNetworkEndpointGroupsDetachEndpointsRequest, opts: RegionNetworkEndpointGroupsDetachNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups/${ networkEndpointGroup }/detachNetworkEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. * @param project Project ID for this request. * @param region The name of the region where the network endpoint group is located. It should comply with RFC1035. */ async regionNetworkEndpointGroupsGet(networkEndpointGroup: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups/${ networkEndpointGroup }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroup(data); } /** * Creates a network endpoint group in the specified project using the * parameters that are included in the request. * * @param project Project ID for this request. * @param region The name of the region where you want to create the network endpoint group. It should comply with RFC1035. */ async regionNetworkEndpointGroupsInsert(project: string, region: string, req: NetworkEndpointGroup, opts: RegionNetworkEndpointGroupsInsertOptions = {}): Promise { req = serializeNetworkEndpointGroup(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of regional network endpoint groups available to the * specified project in the given region. * * @param project Project ID for this request. * @param region The name of the region where the network endpoint group is located. It should comply with RFC1035. */ async regionNetworkEndpointGroupsList(project: string, region: string, opts: RegionNetworkEndpointGroupsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNetworkEndpointGroupList(data); } /** * Lists the network endpoints in the specified network endpoint group. * * @param networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. * @param project Project ID for this request. * @param region The name of the region where the network endpoint group is located. It should comply with RFC1035. */ async regionNetworkEndpointGroupsListNetworkEndpoints(networkEndpointGroup: string, project: string, region: string, opts: RegionNetworkEndpointGroupsListNetworkEndpointsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/networkEndpointGroups/${ networkEndpointGroup }/listNetworkEndpoints`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return data as NetworkEndpointGroupsListNetworkEndpoints; } /** * Inserts an association for the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesAddAssociation(firewallPolicy: string, project: string, region: string, req: FirewallPolicyAssociation, opts: RegionNetworkFirewallPoliciesAddAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/addAssociation`); if (opts.replaceExistingAssociation !== undefined) { url.searchParams.append("replaceExistingAssociation", String(opts.replaceExistingAssociation)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Inserts a rule into a network firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesAddRule(firewallPolicy: string, project: string, region: string, req: FirewallPolicyRule, opts: RegionNetworkFirewallPoliciesAddRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/addRule`); if (opts.maxPriority !== undefined) { url.searchParams.append("maxPriority", String(opts.maxPriority)); } if (opts.minPriority !== undefined) { url.searchParams.append("minPriority", String(opts.minPriority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Copies rules to the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesCloneRules(firewallPolicy: string, project: string, region: string, opts: RegionNetworkFirewallPoliciesCloneRulesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/cloneRules`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.sourceFirewallPolicy !== undefined) { url.searchParams.append("sourceFirewallPolicy", String(opts.sourceFirewallPolicy)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesDelete(firewallPolicy: string, project: string, region: string, opts: RegionNetworkFirewallPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to get. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesGet(firewallPolicy: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallPolicy(data); } /** * Gets an association with the specified name. * * @param firewallPolicy Name of the firewall policy to which the queried association belongs. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesGetAssociation(firewallPolicy: string, project: string, region: string, opts: RegionNetworkFirewallPoliciesGetAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/getAssociation`); if (opts.name !== undefined) { url.searchParams.append("name", String(opts.name)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPolicyAssociation; } /** * Returns the effective firewalls on a given network. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesGetEffectiveFirewalls(project: string, region: string, opts: RegionNetworkFirewallPoliciesGetEffectiveFirewallsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/getEffectiveFirewalls`); if (opts.network !== undefined) { url.searchParams.append("network", String(opts.network)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionNetworkFirewallPoliciesGetIamPolicy(project: string, region: string, resource: string, opts: RegionNetworkFirewallPoliciesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Gets a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to which the queried rule belongs. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesGetRule(firewallPolicy: string, project: string, region: string, opts: RegionNetworkFirewallPoliciesGetRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/getRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FirewallPolicyRule; } /** * Creates a new network firewall policy in the specified project and region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesInsert(project: string, region: string, req: FirewallPolicy, opts: RegionNetworkFirewallPoliciesInsertOptions = {}): Promise { req = serializeFirewallPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists all the network firewall policies that have been configured for the * specified project in the given region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesList(project: string, region: string, opts: RegionNetworkFirewallPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFirewallPolicyList(data); } /** * Patches the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesPatch(firewallPolicy: string, project: string, region: string, req: FirewallPolicy, opts: RegionNetworkFirewallPoliciesPatchOptions = {}): Promise { req = serializeFirewallPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Patches a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesPatchRule(firewallPolicy: string, project: string, region: string, req: FirewallPolicyRule, opts: RegionNetworkFirewallPoliciesPatchRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/patchRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Removes an association for the specified network firewall policy. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesRemoveAssociation(firewallPolicy: string, project: string, region: string, opts: RegionNetworkFirewallPoliciesRemoveAssociationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/removeAssociation`); if (opts.name !== undefined) { url.searchParams.append("name", String(opts.name)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Deletes a rule of the specified priority. * * @param firewallPolicy Name of the firewall policy to update. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNetworkFirewallPoliciesRemoveRule(firewallPolicy: string, project: string, region: string, opts: RegionNetworkFirewallPoliciesRemoveRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ firewallPolicy }/removeRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionNetworkFirewallPoliciesSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async regionNetworkFirewallPoliciesTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/firewallPolicies/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Deletes the specified NotificationEndpoint in the given region * * @param notificationEndpoint Name of the NotificationEndpoint resource to delete. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNotificationEndpointsDelete(notificationEndpoint: string, project: string, region: string, opts: RegionNotificationEndpointsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/notificationEndpoints/${ notificationEndpoint }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified NotificationEndpoint resource in the given region. * * @param notificationEndpoint Name of the NotificationEndpoint resource to return. * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNotificationEndpointsGet(notificationEndpoint: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/notificationEndpoints/${ notificationEndpoint }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNotificationEndpoint(data); } /** * Create a NotificationEndpoint in the specified project in the given region * using the parameters that are included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNotificationEndpointsInsert(project: string, region: string, req: NotificationEndpoint, opts: RegionNotificationEndpointsInsertOptions = {}): Promise { req = serializeNotificationEndpoint(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/notificationEndpoints`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the NotificationEndpoints for a project in the given region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionNotificationEndpointsList(project: string, region: string, opts: RegionNotificationEndpointsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/notificationEndpoints`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeNotificationEndpointList(data); } /** * Deletes the specified region-specific Operations resource. * * @param operation Name of the Operations resource to delete, or its unique numeric identifier. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionOperationsDelete(operation: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/operations/${ operation }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Retrieves the specified region-specific Operations resource. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionOperationsGet(operation: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/operations/${ operation }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperation(data); } /** * Retrieves a list of Operation resources contained within the specified * region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionOperationsList(project: string, region: string, opts: RegionOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperationList(data); } /** * Waits for the specified Operation resource to return as `DONE` or for the * request to approach the 2 minute deadline, and retrieves the specified * Operation resource. This method differs from the `GET` method in that it * waits for no more than the default deadline (2 minutes) and then returns * the current state of the operation, which might be `DONE` or still in * progress. This method is called on a best-effort basis. Specifically: - In * uncommon cases, when the server is overloaded, the request might return * before the default deadline is reached, or might return after zero seconds. * - If the default deadline is reached, there is no guarantee that the * operation is actually done when the method returns. Be prepared to retry if * the operation is not `DONE`. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. * @param project Project ID for this request. * @param region Name of the region for this request. */ async regionOperationsWait(operation: string, project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/operations/${ operation }/wait`); const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Inserts a rule into a security policy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to update. */ async regionSecurityPoliciesAddRule(project: string, region: string, securityPolicy: string, req: SecurityPolicyRule, opts: RegionSecurityPoliciesAddRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }/addRule`); if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified policy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to delete. */ async regionSecurityPoliciesDelete(project: string, region: string, securityPolicy: string, opts: RegionSecurityPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * List all of the ordered rules present in a single specified policy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to get. */ async regionSecurityPoliciesGet(project: string, region: string, securityPolicy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSecurityPolicy(data); } /** * Gets a rule at the specified priority. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to which the queried rule belongs. */ async regionSecurityPoliciesGetRule(project: string, region: string, securityPolicy: string, opts: RegionSecurityPoliciesGetRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }/getRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SecurityPolicyRule; } /** * Creates a new policy in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSecurityPoliciesInsert(project: string, region: string, req: SecurityPolicy, opts: RegionSecurityPoliciesInsertOptions = {}): Promise { req = serializeSecurityPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * List all the policies that have been configured for the specified project * and region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSecurityPoliciesList(project: string, region: string, opts: RegionSecurityPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSecurityPolicyList(data); } /** * Patches the specified policy with the data included in the request. To * clear fields in the policy, leave the fields empty and specify them in the * updateMask. This cannot be used to be update the rules in the policy. * Please use the per rule methods like addRule, patchRule, and removeRule * instead. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to update. */ async regionSecurityPoliciesPatch(project: string, region: string, securityPolicy: string, req: SecurityPolicy, opts: RegionSecurityPoliciesPatchOptions = {}): Promise { req = serializeSecurityPolicy(req); opts = serializeRegionSecurityPoliciesPatchOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Patches a rule at the specified priority. To clear fields in the rule, * leave the fields empty and specify them in the updateMask. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to update. */ async regionSecurityPoliciesPatchRule(project: string, region: string, securityPolicy: string, req: SecurityPolicyRule, opts: RegionSecurityPoliciesPatchRuleOptions = {}): Promise { opts = serializeRegionSecurityPoliciesPatchRuleOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }/patchRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes a rule at the specified priority. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param securityPolicy Name of the security policy to update. */ async regionSecurityPoliciesRemoveRule(project: string, region: string, securityPolicy: string, opts: RegionSecurityPoliciesRemoveRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/securityPolicies/${ securityPolicy }/removeRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Returns the specified Region resource. To decrease latency for this * method, you can optionally omit any unneeded information from the response * by using a field mask. This practice is especially recommended for unused * quota information (the `quotas` field). To exclude one or more fields, set * your request's `fields` query parameter to only include the fields you * need. For example, to only include the `id` and `selfLink` fields, add the * query parameter `?fields=id,selfLink` to your request. This method fails if * the quota information is unavailable for the region and if the organization * policy constraint compute.requireBasicQuotaInResponse is enforced. This * constraint, when enforced, disables the fail-open behaviour when quota * information (the `items.quotas` field) is unavailable for the region. It is * recommended to use the default setting for the constraint unless your * application requires the fail-closed behaviour for this method. * * @param project Project ID for this request. * @param region Name of the region resource to return. */ async regionsGet(project: string, region: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegion(data); } /** * Retrieves the list of region resources available to the specified project. * To decrease latency for this method, you can optionally omit any unneeded * information from the response by using a field mask. This practice is * especially recommended for unused quota information (the `items.quotas` * field). To exclude one or more fields, set your request's `fields` query * parameter to only include the fields you need. For example, to only include * the `id` and `selfLink` fields, add the query parameter * `?fields=id,selfLink` to your request. This method fails if the quota * information is unavailable for the region and if the organization policy * constraint compute.requireBasicQuotaInResponse is enforced. This * constraint, when enforced, disables the fail-open behaviour when quota * information (the `items.quotas` field) is unavailable for the region. It is * recommended to use the default setting for the constraint unless your * application requires the fail-closed behaviour for this method. * * @param project Project ID for this request. */ async regionsList(project: string, opts: RegionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRegionList(data); } /** * Deletes the specified SslCertificate resource in the region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param sslCertificate Name of the SslCertificate resource to delete. */ async regionSslCertificatesDelete(project: string, region: string, sslCertificate: string, opts: RegionSslCertificatesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslCertificates/${ sslCertificate }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified SslCertificate resource in the specified region. Get * a list of available SSL certificates by making a list() request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param sslCertificate Name of the SslCertificate resource to return. */ async regionSslCertificatesGet(project: string, region: string, sslCertificate: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslCertificates/${ sslCertificate }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslCertificate(data); } /** * Creates a SslCertificate resource in the specified project and region * using the data included in the request * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSslCertificatesInsert(project: string, region: string, req: SslCertificate, opts: RegionSslCertificatesInsertOptions = {}): Promise { req = serializeSslCertificate(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslCertificates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of SslCertificate resources available to the specified * project in the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSslCertificatesList(project: string, region: string, opts: RegionSslCertificatesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslCertificates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslCertificateList(data); } /** * Deletes the specified SSL policy. The SSL policy resource can be deleted * only if it is not in use by any TargetHttpsProxy or TargetSslProxy * resources. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. */ async regionSslPoliciesDelete(project: string, region: string, sslPolicy: string, opts: RegionSslPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslPolicies/${ sslPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Lists all of the ordered rules present in a single specified policy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. */ async regionSslPoliciesGet(project: string, region: string, sslPolicy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslPolicies/${ sslPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslPolicy(data); } /** * Creates a new policy in the specified project and region using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSslPoliciesInsert(project: string, region: string, req: SslPolicy, opts: RegionSslPoliciesInsertOptions = {}): Promise { req = serializeSslPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslPolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists all the SSL policies that have been configured for the specified * project and region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSslPoliciesList(project: string, region: string, opts: RegionSslPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslPoliciesList(data); } /** * Lists all features that can be specified in the SSL policy when using * custom profile. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionSslPoliciesListAvailableFeatures(project: string, region: string, opts: RegionSslPoliciesListAvailableFeaturesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslPolicies/listAvailableFeatures`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SslPoliciesListAvailableFeaturesResponse; } /** * Patches the specified SSL policy with the data included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. */ async regionSslPoliciesPatch(project: string, region: string, sslPolicy: string, req: SslPolicy, opts: RegionSslPoliciesPatchOptions = {}): Promise { req = serializeSslPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/sslPolicies/${ sslPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Deletes the specified TargetHttpProxy resource. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. */ async regionTargetHttpProxiesDelete(project: string, region: string, targetHttpProxy: string, opts: RegionTargetHttpProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpProxies/${ targetHttpProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetHttpProxy resource in the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpProxy Name of the TargetHttpProxy resource to return. */ async regionTargetHttpProxiesGet(project: string, region: string, targetHttpProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpProxies/${ targetHttpProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpProxy(data); } /** * Creates a TargetHttpProxy resource in the specified project and region * using the data included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionTargetHttpProxiesInsert(project: string, region: string, req: TargetHttpProxy, opts: RegionTargetHttpProxiesInsertOptions = {}): Promise { req = serializeTargetHttpProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of TargetHttpProxy resources available to the specified * project in the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionTargetHttpProxiesList(project: string, region: string, opts: RegionTargetHttpProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpProxyList(data); } /** * Changes the URL map for TargetHttpProxy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. */ async regionTargetHttpProxiesSetUrlMap(project: string, region: string, targetHttpProxy: string, req: UrlMapReference, opts: RegionTargetHttpProxiesSetUrlMapOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpProxies/${ targetHttpProxy }/setUrlMap`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified TargetHttpsProxy resource. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. */ async regionTargetHttpsProxiesDelete(project: string, region: string, targetHttpsProxy: string, opts: RegionTargetHttpsProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies/${ targetHttpsProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetHttpsProxy resource in the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to return. */ async regionTargetHttpsProxiesGet(project: string, region: string, targetHttpsProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies/${ targetHttpsProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpsProxy(data); } /** * Creates a TargetHttpsProxy resource in the specified project and region * using the data included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionTargetHttpsProxiesInsert(project: string, region: string, req: TargetHttpsProxy, opts: RegionTargetHttpsProxiesInsertOptions = {}): Promise { req = serializeTargetHttpsProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of TargetHttpsProxy resources available to the * specified project in the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionTargetHttpsProxiesList(project: string, region: string, opts: RegionTargetHttpsProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpsProxyList(data); } /** * Patches the specified regional TargetHttpsProxy resource with the data * included in the request. This method supports PATCH semantics and uses JSON * merge patch format and processing rules. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to patch. */ async regionTargetHttpsProxiesPatch(project: string, region: string, targetHttpsProxy: string, req: TargetHttpsProxy, opts: RegionTargetHttpsProxiesPatchOptions = {}): Promise { req = serializeTargetHttpsProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies/${ targetHttpsProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Replaces SslCertificates for TargetHttpsProxy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. */ async regionTargetHttpsProxiesSetSslCertificates(project: string, region: string, targetHttpsProxy: string, req: RegionTargetHttpsProxiesSetSslCertificatesRequest, opts: RegionTargetHttpsProxiesSetSslCertificatesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies/${ targetHttpsProxy }/setSslCertificates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the URL map for TargetHttpsProxy. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetHttpsProxy Name of the TargetHttpsProxy to set a URL map for. */ async regionTargetHttpsProxiesSetUrlMap(project: string, region: string, targetHttpsProxy: string, req: UrlMapReference, opts: RegionTargetHttpsProxiesSetUrlMapOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetHttpsProxies/${ targetHttpsProxy }/setUrlMap`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified TargetTcpProxy resource. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. */ async regionTargetTcpProxiesDelete(project: string, region: string, targetTcpProxy: string, opts: RegionTargetTcpProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetTcpProxies/${ targetTcpProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetTcpProxy resource. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetTcpProxy Name of the TargetTcpProxy resource to return. */ async regionTargetTcpProxiesGet(project: string, region: string, targetTcpProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetTcpProxies/${ targetTcpProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetTcpProxy(data); } /** * Creates a TargetTcpProxy resource in the specified project and region * using the data included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionTargetTcpProxiesInsert(project: string, region: string, req: TargetTcpProxy, opts: RegionTargetTcpProxiesInsertOptions = {}): Promise { req = serializeTargetTcpProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetTcpProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of TargetTcpProxy resources available to the specified * project in a given region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionTargetTcpProxiesList(project: string, region: string, opts: RegionTargetTcpProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetTcpProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetTcpProxyList(data); } /** * Deletes the specified UrlMap resource. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param urlMap Name of the UrlMap resource to delete. */ async regionUrlMapsDelete(project: string, region: string, urlMap: string, opts: RegionUrlMapsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps/${ urlMap }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified UrlMap resource. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param urlMap Name of the UrlMap resource to return. */ async regionUrlMapsGet(project: string, region: string, urlMap: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps/${ urlMap }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeUrlMap(data); } /** * Creates a UrlMap resource in the specified project using the data included * in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionUrlMapsInsert(project: string, region: string, req: UrlMap, opts: RegionUrlMapsInsertOptions = {}): Promise { req = serializeUrlMap(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of UrlMap resources available to the specified project * in the specified region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async regionUrlMapsList(project: string, region: string, opts: RegionUrlMapsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeUrlMapList(data); } /** * Patches the specified UrlMap resource with the data included in the * request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param urlMap Name of the UrlMap resource to patch. */ async regionUrlMapsPatch(project: string, region: string, urlMap: string, req: UrlMap, opts: RegionUrlMapsPatchOptions = {}): Promise { req = serializeUrlMap(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps/${ urlMap }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates the specified UrlMap resource with the data included in the * request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param urlMap Name of the UrlMap resource to update. */ async regionUrlMapsUpdate(project: string, region: string, urlMap: string, req: UrlMap, opts: RegionUrlMapsUpdateOptions = {}): Promise { req = serializeUrlMap(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps/${ urlMap }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Runs static validation for the UrlMap. In particular, the tests of the * provided UrlMap will be run. Calling this method does NOT create the * UrlMap. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param urlMap Name of the UrlMap resource to be validated as. */ async regionUrlMapsValidate(project: string, region: string, urlMap: string, req: RegionUrlMapsValidateRequest): Promise { req = serializeRegionUrlMapsValidateRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/urlMaps/${ urlMap }/validate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UrlMapsValidateResponse; } /** * Retrieves the list of Zone resources under the specific region available * to the specified project. * * @param project Project ID for this request. * @param region Region for this request. */ async regionZonesList(project: string, region: string, opts: RegionZonesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/zones`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeZoneList(data); } /** * Retrieves an aggregated list of reservations. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async reservationsAggregatedList(project: string, opts: ReservationsAggregatedListOptions = {}): Promise { opts = serializeReservationsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/reservations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeReservationAggregatedList(data); } /** * Deletes the specified reservation. * * @param project Project ID for this request. * @param reservation Name of the reservation to delete. * @param zone Name of the zone for this request. */ async reservationsDelete(project: string, reservation: string, zone: string, opts: ReservationsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ reservation }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Retrieves information about the specified reservation. * * @param project Project ID for this request. * @param reservation Name of the reservation to retrieve. * @param zone Name of the zone for this request. */ async reservationsGet(project: string, reservation: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ reservation }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeReservation(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async reservationsGetIamPolicy(project: string, resource: string, zone: string, opts: ReservationsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a new reservation. For more information, read Reserving zonal * resources. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async reservationsInsert(project: string, zone: string, req: Reservation, opts: ReservationsInsertOptions = {}): Promise { req = serializeReservation(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * A list of all the reservations that have been configured for the specified * project in specified zone. * * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async reservationsList(project: string, zone: string, opts: ReservationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeReservationList(data); } /** * Resizes the reservation (applicable to standalone reservations only). For * more information, read Modifying reservations. * * @param project Project ID for this request. * @param reservation Name of the reservation to update. * @param zone Name of the zone for this request. */ async reservationsResize(project: string, reservation: string, zone: string, req: ReservationsResizeRequest, opts: ReservationsResizeOptions = {}): Promise { req = serializeReservationsResizeRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ reservation }/resize`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async reservationsSetIamPolicy(project: string, resource: string, zone: string, req: ZoneSetPolicyRequest): Promise { req = serializeZoneSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async reservationsTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Update share settings of the reservation. * * @param project Project ID for this request. * @param reservation Name of the reservation to update. * @param zone Name of the zone for this request. */ async reservationsUpdate(project: string, reservation: string, zone: string, req: Reservation, opts: ReservationsUpdateOptions = {}): Promise { req = serializeReservation(req); opts = serializeReservationsUpdateOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/reservations/${ reservation }`); if (opts.paths !== undefined) { url.searchParams.append("paths", String(opts.paths)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of resource policies. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async resourcePoliciesAggregatedList(project: string, opts: ResourcePoliciesAggregatedListOptions = {}): Promise { opts = serializeResourcePoliciesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/resourcePolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeResourcePolicyAggregatedList(data); } /** * Deletes the specified resource policy. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param resourcePolicy Name of the resource policy to delete. */ async resourcePoliciesDelete(project: string, region: string, resourcePolicy: string, opts: ResourcePoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies/${ resourcePolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Retrieves all information of the specified resource policy. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param resourcePolicy Name of the resource policy to retrieve. */ async resourcePoliciesGet(project: string, region: string, resourcePolicy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies/${ resourcePolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeResourcePolicy(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async resourcePoliciesGetIamPolicy(project: string, region: string, resource: string, opts: ResourcePoliciesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a new resource policy. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async resourcePoliciesInsert(project: string, region: string, req: ResourcePolicy, opts: ResourcePoliciesInsertOptions = {}): Promise { req = serializeResourcePolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * A list all the resource policies that have been configured for the * specified project in specified region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async resourcePoliciesList(project: string, region: string, opts: ResourcePoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeResourcePolicyList(data); } /** * Modify the specified resource policy. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param resourcePolicy Id of the resource policy to patch. */ async resourcePoliciesPatch(project: string, region: string, resourcePolicy: string, req: ResourcePolicy, opts: ResourcePoliciesPatchOptions = {}): Promise { req = serializeResourcePolicy(req); opts = serializeResourcePoliciesPatchOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies/${ resourcePolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async resourcePoliciesSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async resourcePoliciesTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/resourcePolicies/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of routers. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async routersAggregatedList(project: string, opts: RoutersAggregatedListOptions = {}): Promise { opts = serializeRoutersAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/routers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRouterAggregatedList(data); } /** * Deletes the specified Router resource. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to delete. */ async routersDelete(project: string, region: string, router: string, opts: RoutersDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified Router resource. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to return. */ async routersGet(project: string, region: string, router: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRouter(data); } /** * Retrieves runtime NAT IP information. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. */ async routersGetNatIpInfo(project: string, region: string, router: string, opts: RoutersGetNatIpInfoOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }/getNatIpInfo`); if (opts.natName !== undefined) { url.searchParams.append("natName", String(opts.natName)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as NatIpInfoResponse; } /** * Retrieves runtime Nat mapping information of VM endpoints. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to query for Nat Mapping information of VM endpoints. */ async routersGetNatMappingInfo(project: string, region: string, router: string, opts: RoutersGetNatMappingInfoOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }/getNatMappingInfo`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.natName !== undefined) { url.searchParams.append("natName", String(opts.natName)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as VmEndpointNatMappingsList; } /** * Retrieves runtime information of the specified router. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to query. */ async routersGetRouterStatus(project: string, region: string, router: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }/getRouterStatus`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRouterStatusResponse(data); } /** * Creates a Router resource in the specified project and region using the * data included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async routersInsert(project: string, region: string, req: Router, opts: RoutersInsertOptions = {}): Promise { req = serializeRouter(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of Router resources available to the specified project. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async routersList(project: string, region: string, opts: RoutersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRouterList(data); } /** * Patches the specified Router resource with the data included in the * request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to patch. */ async routersPatch(project: string, region: string, router: string, req: Router, opts: RoutersPatchOptions = {}): Promise { req = serializeRouter(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Preview fields auto-generated during router create and update operations. * Calling this method does NOT create or update the router. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to query. */ async routersPreview(project: string, region: string, router: string, req: Router): Promise { req = serializeRouter(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }/preview`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeRoutersPreviewResponse(data); } /** * Updates the specified Router resource with the data included in the * request. This method conforms to PUT semantics, which requests that the * state of the target resource be created or replaced with the state defined * by the representation enclosed in the request message payload. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param router Name of the Router resource to update. */ async routersUpdate(project: string, region: string, router: string, req: Router, opts: RoutersUpdateOptions = {}): Promise { req = serializeRouter(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/routers/${ router }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Deletes the specified Route resource. * * @param project Project ID for this request. * @param route Name of the Route resource to delete. */ async routesDelete(project: string, route: string, opts: RoutesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/routes/${ route }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified Route resource. * * @param project Project ID for this request. * @param route Name of the Route resource to return. */ async routesGet(project: string, route: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/routes/${ route }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRoute(data); } /** * Creates a Route resource in the specified project using the data included * in the request. * * @param project Project ID for this request. */ async routesInsert(project: string, req: Route, opts: RoutesInsertOptions = {}): Promise { req = serializeRoute(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/routes`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of Route resources available to the specified project. * * @param project Project ID for this request. */ async routesList(project: string, opts: RoutesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/routes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRouteList(data); } /** * Inserts a rule into a security policy. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to update. */ async securityPoliciesAddRule(project: string, securityPolicy: string, req: SecurityPolicyRule, opts: SecurityPoliciesAddRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }/addRule`); if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of all SecurityPolicy resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async securityPoliciesAggregatedList(project: string, opts: SecurityPoliciesAggregatedListOptions = {}): Promise { opts = serializeSecurityPoliciesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/securityPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSecurityPoliciesAggregatedList(data); } /** * Deletes the specified policy. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to delete. */ async securityPoliciesDelete(project: string, securityPolicy: string, opts: SecurityPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * List all of the ordered rules present in a single specified policy. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to get. */ async securityPoliciesGet(project: string, securityPolicy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSecurityPolicy(data); } /** * Gets a rule at the specified priority. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to which the queried rule belongs. */ async securityPoliciesGetRule(project: string, securityPolicy: string, opts: SecurityPoliciesGetRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }/getRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SecurityPolicyRule; } /** * Creates a new policy in the specified project using the data included in * the request. * * @param project Project ID for this request. */ async securityPoliciesInsert(project: string, req: SecurityPolicy, opts: SecurityPoliciesInsertOptions = {}): Promise { req = serializeSecurityPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * List all the policies that have been configured for the specified project. * * @param project Project ID for this request. */ async securityPoliciesList(project: string, opts: SecurityPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSecurityPolicyList(data); } /** * Gets the current list of preconfigured Web Application Firewall (WAF) * expressions. * * @param project Project ID for this request. */ async securityPoliciesListPreconfiguredExpressionSets(project: string, opts: SecurityPoliciesListPreconfiguredExpressionSetsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/listPreconfiguredExpressionSets`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SecurityPoliciesListPreconfiguredExpressionSetsResponse; } /** * Patches the specified policy with the data included in the request. To * clear fields in the policy, leave the fields empty and specify them in the * updateMask. This cannot be used to be update the rules in the policy. * Please use the per rule methods like addRule, patchRule, and removeRule * instead. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to update. */ async securityPoliciesPatch(project: string, securityPolicy: string, req: SecurityPolicy, opts: SecurityPoliciesPatchOptions = {}): Promise { req = serializeSecurityPolicy(req); opts = serializeSecurityPoliciesPatchOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Patches a rule at the specified priority. To clear fields in the rule, * leave the fields empty and specify them in the updateMask. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to update. */ async securityPoliciesPatchRule(project: string, securityPolicy: string, req: SecurityPolicyRule, opts: SecurityPoliciesPatchRuleOptions = {}): Promise { opts = serializeSecurityPoliciesPatchRuleOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }/patchRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes a rule at the specified priority. * * @param project Project ID for this request. * @param securityPolicy Name of the security policy to update. */ async securityPoliciesRemoveRule(project: string, securityPolicy: string, opts: SecurityPoliciesRemoveRuleOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ securityPolicy }/removeRule`); if (opts.priority !== undefined) { url.searchParams.append("priority", String(opts.priority)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Sets the labels on a security policy. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async securityPoliciesSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/securityPolicies/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of all ServiceAttachment resources, regional and * global, available to the specified project. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async serviceAttachmentsAggregatedList(project: string, opts: ServiceAttachmentsAggregatedListOptions = {}): Promise { opts = serializeServiceAttachmentsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/serviceAttachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeServiceAttachmentAggregatedList(data); } /** * Deletes the specified ServiceAttachment in the given scope * * @param project Project ID for this request. * @param region Name of the region of this request. * @param serviceAttachment Name of the ServiceAttachment resource to delete. */ async serviceAttachmentsDelete(project: string, region: string, serviceAttachment: string, opts: ServiceAttachmentsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments/${ serviceAttachment }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified ServiceAttachment resource in the given scope. * * @param project Project ID for this request. * @param region Name of the region of this request. * @param serviceAttachment Name of the ServiceAttachment resource to return. */ async serviceAttachmentsGet(project: string, region: string, serviceAttachment: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments/${ serviceAttachment }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeServiceAttachment(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async serviceAttachmentsGetIamPolicy(project: string, region: string, resource: string, opts: ServiceAttachmentsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a ServiceAttachment in the specified project in the given scope * using the parameters that are included in the request. * * @param project Project ID for this request. * @param region Name of the region of this request. */ async serviceAttachmentsInsert(project: string, region: string, req: ServiceAttachment, opts: ServiceAttachmentsInsertOptions = {}): Promise { req = serializeServiceAttachment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the ServiceAttachments for a project in the given scope. * * @param project Project ID for this request. * @param region Name of the region of this request. */ async serviceAttachmentsList(project: string, region: string, opts: ServiceAttachmentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeServiceAttachmentList(data); } /** * Patches the specified ServiceAttachment resource with the data included in * the request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param region The region scoping this request and should conform to RFC1035. * @param serviceAttachment The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. */ async serviceAttachmentsPatch(project: string, region: string, serviceAttachment: string, req: ServiceAttachment, opts: ServiceAttachmentsPatchOptions = {}): Promise { req = serializeServiceAttachment(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments/${ serviceAttachment }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async serviceAttachmentsSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async serviceAttachmentsTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/serviceAttachments/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Deletes the specified Snapshot resource. Keep in mind that deleting a * single snapshot might not necessarily delete all the data on that snapshot. * If any data on the snapshot that is marked for deletion is needed for * subsequent snapshots, the data will be moved to the next corresponding * snapshot. For more information, see Deleting snapshots. * * @param project Project ID for this request. * @param snapshot Name of the Snapshot resource to delete. */ async snapshotsDelete(project: string, snapshot: string, opts: SnapshotsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots/${ snapshot }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Get snapshot settings. * * @param project Project ID for this request. */ async snapshotSettingsGet(project: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshotSettings`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SnapshotSettings; } /** * Patch snapshot settings. * * @param project Project ID for this request. */ async snapshotSettingsPatch(project: string, req: SnapshotSettings, opts: SnapshotSettingsPatchOptions = {}): Promise { opts = serializeSnapshotSettingsPatchOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshotSettings`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Returns the specified Snapshot resource. * * @param project Project ID for this request. * @param snapshot Name of the Snapshot resource to return. */ async snapshotsGet(project: string, snapshot: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots/${ snapshot }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSnapshot(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async snapshotsGetIamPolicy(project: string, resource: string, opts: SnapshotsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a snapshot in the specified project using the data included in the * request. For regular snapshot creation, consider using this method instead * of disks.createSnapshot, as this method supports more features, such as * creating snapshots in a project different from the source disk project. * * @param project Project ID for this request. */ async snapshotsInsert(project: string, req: Snapshot, opts: SnapshotsInsertOptions = {}): Promise { req = serializeSnapshot(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of Snapshot resources contained within the specified * project. * * @param project Project ID for this request. */ async snapshotsList(project: string, opts: SnapshotsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSnapshotList(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async snapshotsSetIamPolicy(project: string, resource: string, req: GlobalSetPolicyRequest): Promise { req = serializeGlobalSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Sets the labels on a snapshot. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async snapshotsSetLabels(project: string, resource: string, req: GlobalSetLabelsRequest): Promise { req = serializeGlobalSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots/${ resource }/setLabels`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. */ async snapshotsTestIamPermissions(project: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/snapshots/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves the list of all SslCertificate resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async sslCertificatesAggregatedList(project: string, opts: SslCertificatesAggregatedListOptions = {}): Promise { opts = serializeSslCertificatesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/sslCertificates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslCertificateAggregatedList(data); } /** * Deletes the specified SslCertificate resource. * * @param project Project ID for this request. * @param sslCertificate Name of the SslCertificate resource to delete. */ async sslCertificatesDelete(project: string, sslCertificate: string, opts: SslCertificatesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslCertificates/${ sslCertificate }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified SslCertificate resource. * * @param project Project ID for this request. * @param sslCertificate Name of the SslCertificate resource to return. */ async sslCertificatesGet(project: string, sslCertificate: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslCertificates/${ sslCertificate }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslCertificate(data); } /** * Creates a SslCertificate resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async sslCertificatesInsert(project: string, req: SslCertificate, opts: SslCertificatesInsertOptions = {}): Promise { req = serializeSslCertificate(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslCertificates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of SslCertificate resources available to the specified * project. * * @param project Project ID for this request. */ async sslCertificatesList(project: string, opts: SslCertificatesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslCertificates`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslCertificateList(data); } /** * Retrieves the list of all SslPolicy resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async sslPoliciesAggregatedList(project: string, opts: SslPoliciesAggregatedListOptions = {}): Promise { opts = serializeSslPoliciesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/sslPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslPoliciesAggregatedList(data); } /** * Deletes the specified SSL policy. The SSL policy resource can be deleted * only if it is not in use by any TargetHttpsProxy or TargetSslProxy * resources. * * @param project Project ID for this request. * @param sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. */ async sslPoliciesDelete(project: string, sslPolicy: string, opts: SslPoliciesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslPolicies/${ sslPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Lists all of the ordered rules present in a single specified policy. * * @param project Project ID for this request. * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. */ async sslPoliciesGet(project: string, sslPolicy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslPolicies/${ sslPolicy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslPolicy(data); } /** * Returns the specified SSL policy resource. * * @param project Project ID for this request. */ async sslPoliciesInsert(project: string, req: SslPolicy, opts: SslPoliciesInsertOptions = {}): Promise { req = serializeSslPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslPolicies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists all the SSL policies that have been configured for the specified * project. * * @param project Project ID for this request. */ async sslPoliciesList(project: string, opts: SslPoliciesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslPolicies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSslPoliciesList(data); } /** * Lists all features that can be specified in the SSL policy when using * custom profile. * * @param project Project ID for this request. */ async sslPoliciesListAvailableFeatures(project: string, opts: SslPoliciesListAvailableFeaturesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslPolicies/listAvailableFeatures`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SslPoliciesListAvailableFeaturesResponse; } /** * Patches the specified SSL policy with the data included in the request. * * @param project Project ID for this request. * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. */ async sslPoliciesPatch(project: string, sslPolicy: string, req: SslPolicy, opts: SslPoliciesPatchOptions = {}): Promise { req = serializeSslPolicy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/sslPolicies/${ sslPolicy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of storage pools. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async storagePoolsAggregatedList(project: string, opts: StoragePoolsAggregatedListOptions = {}): Promise { opts = serializeStoragePoolsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/storagePools`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePoolAggregatedList(data); } /** * Deletes the specified storage pool. Deleting a storagePool removes its * data permanently and is irreversible. However, deleting a storagePool does * not delete any snapshots previously made from the storagePool. You must * separately delete snapshots. * * @param project Project ID for this request. * @param storagePool Name of the storage pool to delete. * @param zone The name of the zone for this request. */ async storagePoolsDelete(project: string, storagePool: string, zone: string, opts: StoragePoolsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ storagePool }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns a specified storage pool. Gets a list of available storage pools * by making a list() request. * * @param project Project ID for this request. * @param storagePool Name of the storage pool to return. * @param zone The name of the zone for this request. */ async storagePoolsGet(project: string, storagePool: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ storagePool }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePool(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async storagePoolsGetIamPolicy(project: string, resource: string, zone: string, opts: StoragePoolsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a storage pool in the specified project using the data in the * request. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async storagePoolsInsert(project: string, zone: string, req: StoragePool, opts: StoragePoolsInsertOptions = {}): Promise { req = serializeStoragePool(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of storage pools contained within the specified zone. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async storagePoolsList(project: string, zone: string, opts: StoragePoolsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePoolList(data); } /** * Lists the disks in a specified storage pool. * * @param project Project ID for this request. * @param storagePool Name of the storage pool to list disks of. * @param zone The name of the zone for this request. */ async storagePoolsListDisks(project: string, storagePool: string, zone: string, opts: StoragePoolsListDisksOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ storagePool }/listDisks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePoolListDisks(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async storagePoolsSetIamPolicy(project: string, resource: string, zone: string, req: ZoneSetPolicyRequest): Promise { req = serializeZoneSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param resource Name or id of the resource for this request. * @param zone The name of the zone for this request. */ async storagePoolsTestIamPermissions(project: string, resource: string, zone: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Updates the specified storagePool with the data included in the request. * The update is performed only on selected fields included as part of * update-mask. Only the following fields can be modified: * pool_provisioned_capacity_gb, pool_provisioned_iops and * pool_provisioned_throughput. * * @param project Project ID for this request. * @param storagePool The storagePool name for this request. * @param zone The name of the zone for this request. */ async storagePoolsUpdate(project: string, storagePool: string, zone: string, req: StoragePool, opts: StoragePoolsUpdateOptions = {}): Promise { req = serializeStoragePool(req); opts = serializeStoragePoolsUpdateOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePools/${ storagePool }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of storage pool types. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async storagePoolTypesAggregatedList(project: string, opts: StoragePoolTypesAggregatedListOptions = {}): Promise { opts = serializeStoragePoolTypesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/storagePoolTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePoolTypeAggregatedList(data); } /** * Returns the specified storage pool type. * * @param project Project ID for this request. * @param storagePoolType Name of the storage pool type to return. * @param zone The name of the zone for this request. */ async storagePoolTypesGet(project: string, storagePoolType: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePoolTypes/${ storagePoolType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePoolType(data); } /** * Retrieves a list of storage pool types available to the specified project. * * @param project Project ID for this request. * @param zone The name of the zone for this request. */ async storagePoolTypesList(project: string, zone: string, opts: StoragePoolTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/storagePoolTypes`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeStoragePoolTypeList(data); } /** * Retrieves an aggregated list of subnetworks. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async subnetworksAggregatedList(project: string, opts: SubnetworksAggregatedListOptions = {}): Promise { opts = serializeSubnetworksAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/subnetworks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubnetworkAggregatedList(data); } /** * Deletes the specified subnetwork. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param subnetwork Name of the Subnetwork resource to delete. */ async subnetworksDelete(project: string, region: string, subnetwork: string, opts: SubnetworksDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ subnetwork }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Expands the IP CIDR range of the subnetwork to a specified value. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param subnetwork Name of the Subnetwork resource to update. */ async subnetworksExpandIpCidrRange(project: string, region: string, subnetwork: string, req: SubnetworksExpandIpCidrRangeRequest, opts: SubnetworksExpandIpCidrRangeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ subnetwork }/expandIpCidrRange`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns the specified subnetwork. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param subnetwork Name of the Subnetwork resource to return. */ async subnetworksGet(project: string, region: string, subnetwork: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ subnetwork }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubnetwork(data); } /** * Gets the access control policy for a resource. May be empty if no such * policy or resource exists. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async subnetworksGetIamPolicy(project: string, region: string, resource: string, opts: SubnetworksGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ resource }/getIamPolicy`); if (opts.optionsRequestedPolicyVersion !== undefined) { url.searchParams.append("optionsRequestedPolicyVersion", String(opts.optionsRequestedPolicyVersion)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Creates a subnetwork in the specified project using the data included in * the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async subnetworksInsert(project: string, region: string, req: Subnetwork, opts: SubnetworksInsertOptions = {}): Promise { req = serializeSubnetwork(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of subnetworks available to the specified project. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async subnetworksList(project: string, region: string, opts: SubnetworksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubnetworkList(data); } /** * Retrieves an aggregated list of all usable subnetworks in the project. * * @param project Project ID for this request. */ async subnetworksListUsable(project: string, opts: SubnetworksListUsableOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/subnetworks/listUsable`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as UsableSubnetworksAggregatedList; } /** * Patches the specified subnetwork with the data included in the request. * Only certain fields can be updated with a patch request as indicated in the * field descriptions. You must specify the current fingerprint of the * subnetwork resource being patched. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param subnetwork Name of the Subnetwork resource to patch. */ async subnetworksPatch(project: string, region: string, subnetwork: string, req: Subnetwork, opts: SubnetworksPatchOptions = {}): Promise { req = serializeSubnetwork(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ subnetwork }`); if (opts.drainTimeoutSeconds !== undefined) { url.searchParams.append("drainTimeoutSeconds", String(opts.drainTimeoutSeconds)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async subnetworksSetIamPolicy(project: string, region: string, resource: string, req: RegionSetPolicyRequest): Promise { req = serializeRegionSetPolicyRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ resource }/setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Set whether VMs in this subnet can access Google services without * assigning external IP addresses through Private Google Access. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param subnetwork Name of the Subnetwork resource. */ async subnetworksSetPrivateIpGoogleAccess(project: string, region: string, subnetwork: string, req: SubnetworksSetPrivateIpGoogleAccessRequest, opts: SubnetworksSetPrivateIpGoogleAccessOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ subnetwork }/setPrivateIpGoogleAccess`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async subnetworksTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/subnetworks/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Deletes the specified TargetGrpcProxy in the given scope * * @param project Project ID for this request. * @param targetGrpcProxy Name of the TargetGrpcProxy resource to delete. */ async targetGrpcProxiesDelete(project: string, targetGrpcProxy: string, opts: TargetGrpcProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetGrpcProxies/${ targetGrpcProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetGrpcProxy resource in the given scope. * * @param project Project ID for this request. * @param targetGrpcProxy Name of the TargetGrpcProxy resource to return. */ async targetGrpcProxiesGet(project: string, targetGrpcProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetGrpcProxies/${ targetGrpcProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetGrpcProxy(data); } /** * Creates a TargetGrpcProxy in the specified project in the given scope * using the parameters that are included in the request. * * @param project Project ID for this request. */ async targetGrpcProxiesInsert(project: string, req: TargetGrpcProxy, opts: TargetGrpcProxiesInsertOptions = {}): Promise { req = serializeTargetGrpcProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetGrpcProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Lists the TargetGrpcProxies for a project in the given scope. * * @param project Project ID for this request. */ async targetGrpcProxiesList(project: string, opts: TargetGrpcProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetGrpcProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetGrpcProxyList(data); } /** * Patches the specified TargetGrpcProxy resource with the data included in * the request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param targetGrpcProxy Name of the TargetGrpcProxy resource to patch. */ async targetGrpcProxiesPatch(project: string, targetGrpcProxy: string, req: TargetGrpcProxy, opts: TargetGrpcProxiesPatchOptions = {}): Promise { req = serializeTargetGrpcProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetGrpcProxies/${ targetGrpcProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Retrieves the list of all TargetHttpProxy resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async targetHttpProxiesAggregatedList(project: string, opts: TargetHttpProxiesAggregatedListOptions = {}): Promise { opts = serializeTargetHttpProxiesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/targetHttpProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpProxyAggregatedList(data); } /** * Deletes the specified TargetHttpProxy resource. * * @param project Project ID for this request. * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. */ async targetHttpProxiesDelete(project: string, targetHttpProxy: string, opts: TargetHttpProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpProxies/${ targetHttpProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetHttpProxy resource. * * @param project Project ID for this request. * @param targetHttpProxy Name of the TargetHttpProxy resource to return. */ async targetHttpProxiesGet(project: string, targetHttpProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpProxies/${ targetHttpProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpProxy(data); } /** * Creates a TargetHttpProxy resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async targetHttpProxiesInsert(project: string, req: TargetHttpProxy, opts: TargetHttpProxiesInsertOptions = {}): Promise { req = serializeTargetHttpProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of TargetHttpProxy resources available to the specified * project. * * @param project Project ID for this request. */ async targetHttpProxiesList(project: string, opts: TargetHttpProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpProxyList(data); } /** * Patches the specified TargetHttpProxy resource with the data included in * the request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param targetHttpProxy Name of the TargetHttpProxy resource to patch. */ async targetHttpProxiesPatch(project: string, targetHttpProxy: string, req: TargetHttpProxy, opts: TargetHttpProxiesPatchOptions = {}): Promise { req = serializeTargetHttpProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpProxies/${ targetHttpProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Changes the URL map for TargetHttpProxy. * * @param project Project ID for this request. * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. */ async targetHttpProxiesSetUrlMap(project: string, targetHttpProxy: string, req: UrlMapReference, opts: TargetHttpProxiesSetUrlMapOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/targetHttpProxies/${ targetHttpProxy }/setUrlMap`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of all TargetHttpsProxy resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async targetHttpsProxiesAggregatedList(project: string, opts: TargetHttpsProxiesAggregatedListOptions = {}): Promise { opts = serializeTargetHttpsProxiesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/targetHttpsProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpsProxyAggregatedList(data); } /** * Deletes the specified TargetHttpsProxy resource. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. */ async targetHttpsProxiesDelete(project: string, targetHttpsProxy: string, opts: TargetHttpsProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies/${ targetHttpsProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetHttpsProxy resource. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to return. */ async targetHttpsProxiesGet(project: string, targetHttpsProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies/${ targetHttpsProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpsProxy(data); } /** * Creates a TargetHttpsProxy resource in the specified project using the * data included in the request. * * @param project Project ID for this request. */ async targetHttpsProxiesInsert(project: string, req: TargetHttpsProxy, opts: TargetHttpsProxiesInsertOptions = {}): Promise { req = serializeTargetHttpsProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of TargetHttpsProxy resources available to the * specified project. * * @param project Project ID for this request. */ async targetHttpsProxiesList(project: string, opts: TargetHttpsProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetHttpsProxyList(data); } /** * Patches the specified TargetHttpsProxy resource with the data included in * the request. This method supports PATCH semantics and uses JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to patch. */ async targetHttpsProxiesPatch(project: string, targetHttpsProxy: string, req: TargetHttpsProxy, opts: TargetHttpsProxiesPatchOptions = {}): Promise { req = serializeTargetHttpsProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies/${ targetHttpsProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Changes the Certificate Map for TargetHttpsProxy. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. */ async targetHttpsProxiesSetCertificateMap(project: string, targetHttpsProxy: string, req: TargetHttpsProxiesSetCertificateMapRequest, opts: TargetHttpsProxiesSetCertificateMapOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies/${ targetHttpsProxy }/setCertificateMap`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the QUIC override policy for TargetHttpsProxy. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. */ async targetHttpsProxiesSetQuicOverride(project: string, targetHttpsProxy: string, req: TargetHttpsProxiesSetQuicOverrideRequest, opts: TargetHttpsProxiesSetQuicOverrideOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies/${ targetHttpsProxy }/setQuicOverride`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Replaces SslCertificates for TargetHttpsProxy. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. */ async targetHttpsProxiesSetSslCertificates(project: string, targetHttpsProxy: string, req: TargetHttpsProxiesSetSslCertificatesRequest, opts: TargetHttpsProxiesSetSslCertificatesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/targetHttpsProxies/${ targetHttpsProxy }/setSslCertificates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the * server-side support for SSL features. This affects connections between * clients and the HTTPS proxy load balancer. They do not affect the * connection between the load balancer and the backends. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. */ async targetHttpsProxiesSetSslPolicy(project: string, targetHttpsProxy: string, req: SslPolicyReference, opts: TargetHttpsProxiesSetSslPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetHttpsProxies/${ targetHttpsProxy }/setSslPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the URL map for TargetHttpsProxy. * * @param project Project ID for this request. * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. */ async targetHttpsProxiesSetUrlMap(project: string, targetHttpsProxy: string, req: UrlMapReference, opts: TargetHttpsProxiesSetUrlMapOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/targetHttpsProxies/${ targetHttpsProxy }/setUrlMap`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of target instances. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async targetInstancesAggregatedList(project: string, opts: TargetInstancesAggregatedListOptions = {}): Promise { opts = serializeTargetInstancesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/targetInstances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetInstanceAggregatedList(data); } /** * Deletes the specified TargetInstance resource. * * @param project Project ID for this request. * @param targetInstance Name of the TargetInstance resource to delete. * @param zone Name of the zone scoping this request. */ async targetInstancesDelete(project: string, targetInstance: string, zone: string, opts: TargetInstancesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/targetInstances/${ targetInstance }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetInstance resource. * * @param project Project ID for this request. * @param targetInstance Name of the TargetInstance resource to return. * @param zone Name of the zone scoping this request. */ async targetInstancesGet(project: string, targetInstance: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/targetInstances/${ targetInstance }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetInstance(data); } /** * Creates a TargetInstance resource in the specified project and zone using * the data included in the request. * * @param project Project ID for this request. * @param zone Name of the zone scoping this request. */ async targetInstancesInsert(project: string, zone: string, req: TargetInstance, opts: TargetInstancesInsertOptions = {}): Promise { req = serializeTargetInstance(req); const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/targetInstances`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of TargetInstance resources available to the specified * project and zone. * * @param project Project ID for this request. * @param zone Name of the zone scoping this request. */ async targetInstancesList(project: string, zone: string, opts: TargetInstancesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/targetInstances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetInstanceList(data); } /** * Sets the Google Cloud Armor security policy for the specified target * instance. For more information, see Google Cloud Armor Overview * * @param project Project ID for this request. * @param targetInstance Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. * @param zone Name of the zone scoping this request. */ async targetInstancesSetSecurityPolicy(project: string, targetInstance: string, zone: string, req: SecurityPolicyReference, opts: TargetInstancesSetSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/targetInstances/${ targetInstance }/setSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Adds health check URLs to a target pool. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the target pool to add a health check to. */ async targetPoolsAddHealthCheck(project: string, region: string, targetPool: string, req: TargetPoolsAddHealthCheckRequest, opts: TargetPoolsAddHealthCheckOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/addHealthCheck`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Adds an instance to a target pool. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to add instances to. */ async targetPoolsAddInstance(project: string, region: string, targetPool: string, req: TargetPoolsAddInstanceRequest, opts: TargetPoolsAddInstanceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/addInstance`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of target pools. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async targetPoolsAggregatedList(project: string, opts: TargetPoolsAggregatedListOptions = {}): Promise { opts = serializeTargetPoolsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/targetPools`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetPoolAggregatedList(data); } /** * Deletes the specified target pool. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to delete. */ async targetPoolsDelete(project: string, region: string, targetPool: string, opts: TargetPoolsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified target pool. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to return. */ async targetPoolsGet(project: string, region: string, targetPool: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetPool(data); } /** * Gets the most recent health check results for each IP for the instance * that is referenced by the given target pool. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to which the queried instance belongs. */ async targetPoolsGetHealth(project: string, region: string, targetPool: string, req: InstanceReference): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/getHealth`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TargetPoolInstanceHealth; } /** * Creates a target pool in the specified project and region using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async targetPoolsInsert(project: string, region: string, req: TargetPool, opts: TargetPoolsInsertOptions = {}): Promise { req = serializeTargetPool(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of target pools available to the specified project and * region. * * @param project Project ID for this request. * @param region Name of the region scoping this request. */ async targetPoolsList(project: string, region: string, opts: TargetPoolsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetPoolList(data); } /** * Removes health check URL from a target pool. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param targetPool Name of the target pool to remove health checks from. */ async targetPoolsRemoveHealthCheck(project: string, region: string, targetPool: string, req: TargetPoolsRemoveHealthCheckRequest, opts: TargetPoolsRemoveHealthCheckOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/removeHealthCheck`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Removes instance URL from a target pool. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to remove instances from. */ async targetPoolsRemoveInstance(project: string, region: string, targetPool: string, req: TargetPoolsRemoveInstanceRequest, opts: TargetPoolsRemoveInstanceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/removeInstance`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes a backup target pool's configurations. * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to set a backup pool for. */ async targetPoolsSetBackup(project: string, region: string, targetPool: string, req: TargetReference, opts: TargetPoolsSetBackupOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/setBackup`); if (opts.failoverRatio !== undefined) { url.searchParams.append("failoverRatio", String(opts.failoverRatio)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the Google Cloud Armor security policy for the specified target pool. * For more information, see Google Cloud Armor Overview * * @param project Project ID for this request. * @param region Name of the region scoping this request. * @param targetPool Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. */ async targetPoolsSetSecurityPolicy(project: string, region: string, targetPool: string, req: SecurityPolicyReference, opts: TargetPoolsSetSecurityPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetPools/${ targetPool }/setSecurityPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified TargetSslProxy resource. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource to delete. */ async targetSslProxiesDelete(project: string, targetSslProxy: string, opts: TargetSslProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetSslProxy resource. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource to return. */ async targetSslProxiesGet(project: string, targetSslProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetSslProxy(data); } /** * Creates a TargetSslProxy resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async targetSslProxiesInsert(project: string, req: TargetSslProxy, opts: TargetSslProxiesInsertOptions = {}): Promise { req = serializeTargetSslProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of TargetSslProxy resources available to the specified * project. * * @param project Project ID for this request. */ async targetSslProxiesList(project: string, opts: TargetSslProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetSslProxyList(data); } /** * Changes the BackendService for TargetSslProxy. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. */ async targetSslProxiesSetBackendService(project: string, targetSslProxy: string, req: TargetSslProxiesSetBackendServiceRequest, opts: TargetSslProxiesSetBackendServiceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }/setBackendService`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the Certificate Map for TargetSslProxy. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. */ async targetSslProxiesSetCertificateMap(project: string, targetSslProxy: string, req: TargetSslProxiesSetCertificateMapRequest, opts: TargetSslProxiesSetCertificateMapOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }/setCertificateMap`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the ProxyHeaderType for TargetSslProxy. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. */ async targetSslProxiesSetProxyHeader(project: string, targetSslProxy: string, req: TargetSslProxiesSetProxyHeaderRequest, opts: TargetSslProxiesSetProxyHeaderOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }/setProxyHeader`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes SslCertificates for TargetSslProxy. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. */ async targetSslProxiesSetSslCertificates(project: string, targetSslProxy: string, req: TargetSslProxiesSetSslCertificatesRequest, opts: TargetSslProxiesSetSslCertificatesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }/setSslCertificates`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the * server-side support for SSL features. This affects connections between * clients and the load balancer. They do not affect the connection between * the load balancer and the backends. * * @param project Project ID for this request. * @param targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. */ async targetSslProxiesSetSslPolicy(project: string, targetSslProxy: string, req: SslPolicyReference, opts: TargetSslProxiesSetSslPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetSslProxies/${ targetSslProxy }/setSslPolicy`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of all TargetTcpProxy resources, regional and global, * available to the specified project. To prevent failure, Google recommends * that you set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async targetTcpProxiesAggregatedList(project: string, opts: TargetTcpProxiesAggregatedListOptions = {}): Promise { opts = serializeTargetTcpProxiesAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/targetTcpProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetTcpProxyAggregatedList(data); } /** * Deletes the specified TargetTcpProxy resource. * * @param project Project ID for this request. * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. */ async targetTcpProxiesDelete(project: string, targetTcpProxy: string, opts: TargetTcpProxiesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetTcpProxies/${ targetTcpProxy }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified TargetTcpProxy resource. * * @param project Project ID for this request. * @param targetTcpProxy Name of the TargetTcpProxy resource to return. */ async targetTcpProxiesGet(project: string, targetTcpProxy: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetTcpProxies/${ targetTcpProxy }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetTcpProxy(data); } /** * Creates a TargetTcpProxy resource in the specified project using the data * included in the request. * * @param project Project ID for this request. */ async targetTcpProxiesInsert(project: string, req: TargetTcpProxy, opts: TargetTcpProxiesInsertOptions = {}): Promise { req = serializeTargetTcpProxy(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetTcpProxies`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of TargetTcpProxy resources available to the specified * project. * * @param project Project ID for this request. */ async targetTcpProxiesList(project: string, opts: TargetTcpProxiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetTcpProxies`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetTcpProxyList(data); } /** * Changes the BackendService for TargetTcpProxy. * * @param project Project ID for this request. * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. */ async targetTcpProxiesSetBackendService(project: string, targetTcpProxy: string, req: TargetTcpProxiesSetBackendServiceRequest, opts: TargetTcpProxiesSetBackendServiceOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetTcpProxies/${ targetTcpProxy }/setBackendService`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Changes the ProxyHeaderType for TargetTcpProxy. * * @param project Project ID for this request. * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. */ async targetTcpProxiesSetProxyHeader(project: string, targetTcpProxy: string, req: TargetTcpProxiesSetProxyHeaderRequest, opts: TargetTcpProxiesSetProxyHeaderOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/targetTcpProxies/${ targetTcpProxy }/setProxyHeader`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves an aggregated list of target VPN gateways. To prevent failure, * Google recommends that you set the `returnPartialSuccess` parameter to * `true`. * * @param project Project ID for this request. */ async targetVpnGatewaysAggregatedList(project: string, opts: TargetVpnGatewaysAggregatedListOptions = {}): Promise { opts = serializeTargetVpnGatewaysAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/targetVpnGateways`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetVpnGatewayAggregatedList(data); } /** * Deletes the specified target VPN gateway. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param targetVpnGateway Name of the target VPN gateway to delete. */ async targetVpnGatewaysDelete(project: string, region: string, targetVpnGateway: string, opts: TargetVpnGatewaysDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetVpnGateways/${ targetVpnGateway }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified target VPN gateway. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param targetVpnGateway Name of the target VPN gateway to return. */ async targetVpnGatewaysGet(project: string, region: string, targetVpnGateway: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetVpnGateways/${ targetVpnGateway }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetVpnGateway(data); } /** * Creates a target VPN gateway in the specified project and region using the * data included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async targetVpnGatewaysInsert(project: string, region: string, req: TargetVpnGateway, opts: TargetVpnGatewaysInsertOptions = {}): Promise { req = serializeTargetVpnGateway(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetVpnGateways`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of target VPN gateways available to the specified project * and region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async targetVpnGatewaysList(project: string, region: string, opts: TargetVpnGatewaysListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetVpnGateways`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTargetVpnGatewayList(data); } /** * Sets the labels on a TargetVpnGateway. To learn more about labels, read * the Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async targetVpnGatewaysSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: TargetVpnGatewaysSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/targetVpnGateways/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of all UrlMap resources, regional and global, available * to the specified project. To prevent failure, Google recommends that you * set the `returnPartialSuccess` parameter to `true`. * * @param project Name of the project scoping this request. */ async urlMapsAggregatedList(project: string, opts: UrlMapsAggregatedListOptions = {}): Promise { opts = serializeUrlMapsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/urlMaps`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeUrlMapsAggregatedList(data); } /** * Deletes the specified UrlMap resource. * * @param project Project ID for this request. * @param urlMap Name of the UrlMap resource to delete. */ async urlMapsDelete(project: string, urlMap: string, opts: UrlMapsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps/${ urlMap }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified UrlMap resource. * * @param project Project ID for this request. * @param urlMap Name of the UrlMap resource to return. */ async urlMapsGet(project: string, urlMap: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps/${ urlMap }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeUrlMap(data); } /** * Creates a UrlMap resource in the specified project using the data included * in the request. * * @param project Project ID for this request. */ async urlMapsInsert(project: string, req: UrlMap, opts: UrlMapsInsertOptions = {}): Promise { req = serializeUrlMap(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Initiates a cache invalidation operation, invalidating the specified path, * scoped to the specified UrlMap. For more information, see [Invalidating * cached content](/cdn/docs/invalidating-cached-content). * * @param project Project ID for this request. * @param urlMap Name of the UrlMap scoping this request. */ async urlMapsInvalidateCache(project: string, urlMap: string, req: CacheInvalidationRule, opts: UrlMapsInvalidateCacheOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps/${ urlMap }/invalidateCache`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves the list of UrlMap resources available to the specified project. * * @param project Project ID for this request. */ async urlMapsList(project: string, opts: UrlMapsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeUrlMapList(data); } /** * Patches the specified UrlMap resource with the data included in the * request. This method supports PATCH semantics and uses the JSON merge patch * format and processing rules. * * @param project Project ID for this request. * @param urlMap Name of the UrlMap resource to patch. */ async urlMapsPatch(project: string, urlMap: string, req: UrlMap, opts: UrlMapsPatchOptions = {}): Promise { req = serializeUrlMap(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps/${ urlMap }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOperation(data); } /** * Updates the specified UrlMap resource with the data included in the * request. * * @param project Project ID for this request. * @param urlMap Name of the UrlMap resource to update. */ async urlMapsUpdate(project: string, urlMap: string, req: UrlMap, opts: UrlMapsUpdateOptions = {}): Promise { req = serializeUrlMap(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps/${ urlMap }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOperation(data); } /** * Runs static validation for the UrlMap. In particular, the tests of the * provided UrlMap will be run. Calling this method does NOT create the * UrlMap. * * @param project Project ID for this request. * @param urlMap Name of the UrlMap resource to be validated as. */ async urlMapsValidate(project: string, urlMap: string, req: UrlMapsValidateRequest): Promise { req = serializeUrlMapsValidateRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/global/urlMaps/${ urlMap }/validate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UrlMapsValidateResponse; } /** * Retrieves an aggregated list of VPN gateways. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async vpnGatewaysAggregatedList(project: string, opts: VpnGatewaysAggregatedListOptions = {}): Promise { opts = serializeVpnGatewaysAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/vpnGateways`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVpnGatewayAggregatedList(data); } /** * Deletes the specified VPN gateway. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param vpnGateway Name of the VPN gateway to delete. */ async vpnGatewaysDelete(project: string, region: string, vpnGateway: string, opts: VpnGatewaysDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways/${ vpnGateway }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified VPN gateway. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param vpnGateway Name of the VPN gateway to return. */ async vpnGatewaysGet(project: string, region: string, vpnGateway: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways/${ vpnGateway }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVpnGateway(data); } /** * Returns the status for the specified VPN gateway. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param vpnGateway Name of the VPN gateway to return. */ async vpnGatewaysGetStatus(project: string, region: string, vpnGateway: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways/${ vpnGateway }/getStatus`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as VpnGatewaysGetStatusResponse; } /** * Creates a VPN gateway in the specified project and region using the data * included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async vpnGatewaysInsert(project: string, region: string, req: VpnGateway, opts: VpnGatewaysInsertOptions = {}): Promise { req = serializeVpnGateway(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of VPN gateways available to the specified project and * region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async vpnGatewaysList(project: string, region: string, opts: VpnGatewaysListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVpnGatewayList(data); } /** * Sets the labels on a VpnGateway. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async vpnGatewaysSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: VpnGatewaysSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Returns permissions that a caller has on the specified resource. * * @param project Project ID for this request. * @param region The name of the region for this request. * @param resource Name or id of the resource for this request. */ async vpnGatewaysTestIamPermissions(project: string, region: string, resource: string, req: TestPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnGateways/${ resource }/testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestPermissionsResponse; } /** * Retrieves an aggregated list of VPN tunnels. To prevent failure, Google * recommends that you set the `returnPartialSuccess` parameter to `true`. * * @param project Project ID for this request. */ async vpnTunnelsAggregatedList(project: string, opts: VpnTunnelsAggregatedListOptions = {}): Promise { opts = serializeVpnTunnelsAggregatedListOptions(opts); const url = new URL(`${this.#baseUrl}projects/${ project }/aggregated/vpnTunnels`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeAllScopes !== undefined) { url.searchParams.append("includeAllScopes", String(opts.includeAllScopes)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } if (opts.serviceProjectNumber !== undefined) { url.searchParams.append("serviceProjectNumber", String(opts.serviceProjectNumber)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVpnTunnelAggregatedList(data); } /** * Deletes the specified VpnTunnel resource. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param vpnTunnel Name of the VpnTunnel resource to delete. */ async vpnTunnelsDelete(project: string, region: string, vpnTunnel: string, opts: VpnTunnelsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnTunnels/${ vpnTunnel }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return deserializeOperation(data); } /** * Returns the specified VpnTunnel resource. * * @param project Project ID for this request. * @param region Name of the region for this request. * @param vpnTunnel Name of the VpnTunnel resource to return. */ async vpnTunnelsGet(project: string, region: string, vpnTunnel: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnTunnels/${ vpnTunnel }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVpnTunnel(data); } /** * Creates a VpnTunnel resource in the specified project and region using the * data included in the request. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async vpnTunnelsInsert(project: string, region: string, req: VpnTunnel, opts: VpnTunnelsInsertOptions = {}): Promise { req = serializeVpnTunnel(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnTunnels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Retrieves a list of VpnTunnel resources contained in the specified project * and region. * * @param project Project ID for this request. * @param region Name of the region for this request. */ async vpnTunnelsList(project: string, region: string, opts: VpnTunnelsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnTunnels`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVpnTunnelList(data); } /** * Sets the labels on a VpnTunnel. To learn more about labels, read the * Labeling Resources documentation. * * @param project Project ID for this request. * @param region The region for this request. * @param resource Name or id of the resource for this request. */ async vpnTunnelsSetLabels(project: string, region: string, resource: string, req: RegionSetLabelsRequest, opts: VpnTunnelsSetLabelsOptions = {}): Promise { req = serializeRegionSetLabelsRequest(req); const url = new URL(`${this.#baseUrl}projects/${ project }/regions/${ region }/vpnTunnels/${ resource }/setLabels`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOperation(data); } /** * Deletes the specified zone-specific Operations resource. * * @param operation Name of the Operations resource to delete, or its unique numeric identifier. * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async zoneOperationsDelete(operation: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/operations/${ operation }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Retrieves the specified zone-specific Operations resource. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async zoneOperationsGet(operation: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/operations/${ operation }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperation(data); } /** * Retrieves a list of Operation resources contained within the specified * zone. * * @param project Project ID for this request. * @param zone Name of the zone for request. */ async zoneOperationsList(project: string, zone: string, opts: ZoneOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOperationList(data); } /** * Waits for the specified Operation resource to return as `DONE` or for the * request to approach the 2 minute deadline, and retrieves the specified * Operation resource. This method waits for no more than the 2 minutes and * then returns the current state of the operation, which might be `DONE` or * still in progress. This method is called on a best-effort basis. * Specifically: - In uncommon cases, when the server is overloaded, the * request might return before the default deadline is reached, or might * return after zero seconds. - If the default deadline is reached, there is * no guarantee that the operation is actually done when the method returns. * Be prepared to retry if the operation is not `DONE`. * * @param operation Name of the Operations resource to return, or its unique numeric identifier. * @param project Project ID for this request. * @param zone Name of the zone for this request. */ async zoneOperationsWait(operation: string, project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }/operations/${ operation }/wait`); const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeOperation(data); } /** * Returns the specified Zone resource. * * @param project Project ID for this request. * @param zone Name of the zone resource to return. */ async zonesGet(project: string, zone: string): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones/${ zone }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeZone(data); } /** * Retrieves the list of Zone resources available to the specified project. * * @param project Project ID for this request. */ async zonesList(project: string, opts: ZonesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}projects/${ project }/zones`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeZoneList(data); } } /** * A specification of the type and number of accelerator cards attached to the * instance. */ export interface AcceleratorConfig { /** * The number of the guest accelerator cards exposed to this instance. */ acceleratorCount?: number; /** * Full or partial URL of the accelerator type resource to attach to this * instance. For example: * projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 * If you are creating an instance template, specify only the accelerator * name. See GPUs on Compute Engine for a full list of accelerator types. */ acceleratorType?: string; } /** * Represents an Accelerator Type resource. Google Cloud Platform provides * graphics processing units (accelerators) that you can add to VM instances to * improve or accelerate performance when working with intensive workloads. For * more information, read GPUs on Compute Engine. */ export interface AcceleratorType { /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * [Output Only] The deprecation status associated with this accelerator * type. */ deprecated?: DeprecationStatus; /** * [Output Only] An optional textual description of the resource. */ description?: string; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * [Output Only] The type of the resource. Always compute#acceleratorType for * accelerator types. */ kind?: string; /** * [Output Only] Maximum number of accelerator cards allowed per instance. */ maximumCardsPerInstance?: number; /** * [Output Only] Name of the resource. */ name?: string; /** * [Output Only] Server-defined, fully qualified URL for this resource. */ selfLink?: string; /** * [Output Only] The name of the zone where the accelerator type resides, * such as us-central1-a. You must specify this field as part of the HTTP * request URL. It is not settable as a field in the request body. */ zone?: string; } function serializeAcceleratorType(data: any): AcceleratorType { return { ...data, id: data["id"] !== undefined ? String(data["id"]) : undefined, }; } function deserializeAcceleratorType(data: any): AcceleratorType { return { ...data, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, }; } export interface AcceleratorTypeAggregatedList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of AcceleratorTypesScopedList resources. */ items?: { [key: string]: AcceleratorTypesScopedList }; /** * [Output Only] Type of resource. Always * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator * types. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Unreachable resources. */ unreachables?: string[]; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAcceleratorTypeAggregatedList(data: any): AcceleratorTypeAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, serializeAcceleratorTypesScopedList(v)]))) : undefined, }; } function deserializeAcceleratorTypeAggregatedList(data: any): AcceleratorTypeAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, deserializeAcceleratorTypesScopedList(v)]))) : undefined, }; } /** * Contains a list of accelerator types. */ export interface AcceleratorTypeList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of AcceleratorType resources. */ items?: AcceleratorType[]; /** * [Output Only] Type of resource. Always compute#acceleratorTypeList for * lists of accelerator types. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAcceleratorTypeList(data: any): AcceleratorTypeList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeAcceleratorType(item))) : undefined, }; } function deserializeAcceleratorTypeList(data: any): AcceleratorTypeList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeAcceleratorType(item))) : undefined, }; } /** * Additional options for Compute#acceleratorTypesAggregatedList. */ export interface AcceleratorTypesAggregatedListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * Indicates whether every visible scope for each scope type (zone, region, * global) should be included in the response. For new resource types added * after this field, the flag has no effect as new resource types will always * include every visible scope for each scope type in response. For resource * types which predate this field, if this flag is omitted or false, only * scopes of the scope types where the resource type is expected to be found * will be included. */ includeAllScopes?: boolean; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; /** * The Shared VPC service project id or service project number for which * aggregated list request is invoked for subnetworks list-usable api. */ serviceProjectNumber?: bigint; } function serializeAcceleratorTypesAggregatedListOptions(data: any): AcceleratorTypesAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? String(data["serviceProjectNumber"]) : undefined, }; } function deserializeAcceleratorTypesAggregatedListOptions(data: any): AcceleratorTypesAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? BigInt(data["serviceProjectNumber"]) : undefined, }; } /** * Additional options for Compute#acceleratorTypesList. */ export interface AcceleratorTypesListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } export interface AcceleratorTypesScopedList { /** * [Output Only] A list of accelerator types contained in this scope. */ acceleratorTypes?: AcceleratorType[]; /** * [Output Only] An informational warning that appears when the accelerator * types list is empty. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAcceleratorTypesScopedList(data: any): AcceleratorTypesScopedList { return { ...data, acceleratorTypes: data["acceleratorTypes"] !== undefined ? data["acceleratorTypes"].map((item: any) => (serializeAcceleratorType(item))) : undefined, }; } function deserializeAcceleratorTypesScopedList(data: any): AcceleratorTypesScopedList { return { ...data, acceleratorTypes: data["acceleratorTypes"] !== undefined ? data["acceleratorTypes"].map((item: any) => (deserializeAcceleratorType(item))) : undefined, }; } /** * An access configuration attached to an instance's network interface. Only * one access config per instance is supported. */ export interface AccessConfig { /** * Applies to ipv6AccessConfigs only. The first IPv6 address of the external * IPv6 range associated with this instance, prefix length is stored in * externalIpv6PrefixLength in ipv6AccessConfig. To use a static external IP * address, it must be unused and in the same region as the instance's zone. * If not specified, Google Cloud will automatically assign an external IPv6 * address from the instance's subnetwork. */ externalIpv6?: string; /** * Applies to ipv6AccessConfigs only. The prefix length of the external IPv6 * range. */ externalIpv6PrefixLength?: number; /** * [Output Only] Type of the resource. Always compute#accessConfig for access * configs. */ kind?: string; /** * The name of this access configuration. In accessConfigs (IPv4), the * default and recommended name is External NAT, but you can use any arbitrary * string, such as My external IP or Network Access. In ipv6AccessConfigs, the * recommend name is External IPv6. */ name?: string; /** * Applies to accessConfigs (IPv4) only. An external IP address associated * with this instance. Specify an unused static external IP address available * to the project or leave this field undefined to use an IP from a shared * ephemeral IP address pool. If you specify a static external IP address, it * must live in the same region as the zone of the instance. */ natIP?: string; /** * This signifies the networking tier used for configuring this access * configuration and can only take the following values: PREMIUM, STANDARD. If * an AccessConfig is specified without a valid external IP address, an * ephemeral IP will be created with this networkTier. If an AccessConfig with * a valid external IP address is specified, it must match that of the * networkTier associated with the Address resource owning that IP. */ networkTier?: | "FIXED_STANDARD" | "PREMIUM" | "STANDARD" | "STANDARD_OVERRIDES_FIXED_STANDARD"; /** * The DNS domain name for the public PTR record. You can set this field only * if the `setPublicPtr` field is enabled in accessConfig. If this field is * unspecified in ipv6AccessConfig, a default PTR record will be created for * first IP in associated external IPv6 range. */ publicPtrDomainName?: string; /** * [Output Only] The resource URL for the security policy associated with * this access config. */ securityPolicy?: string; /** * Specifies whether a public DNS 'PTR' record should be created to map the * external IP address of the instance to a DNS domain name. This field is not * used in ipv6AccessConfig. A default PTR record will be created if the VM * has external IPv6 range associated. */ setPublicPtr?: boolean; /** * The type of configuration. In accessConfigs (IPv4), the default and only * option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default and only option * is DIRECT_IPV6. */ type?: | "DIRECT_IPV6" | "ONE_TO_ONE_NAT"; } /** * Represents an IP Address resource. Google Compute Engine has two IP Address * resources: * [Global (external and * internal)](https://cloud.google.com/compute/docs/reference/rest/v1/globalAddresses) * * [Regional (external and * internal)](https://cloud.google.com/compute/docs/reference/rest/v1/addresses) * For more information, see Reserving a static external IP address. */ export interface Address { /** * The static IP address represented by this resource. */ address?: string; /** * The type of address to reserve, either INTERNAL or EXTERNAL. If * unspecified, defaults to EXTERNAL. */ addressType?: | "EXTERNAL" | "INTERNAL" | "UNSPECIFIED_TYPE"; /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * An optional description of this resource. Provide this field when you * create the resource. */ description?: string; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * The endpoint type of this address, which should be VM or NETLB. This is * used for deciding which type of endpoint this address can be used after the * external IPv6 address reservation. */ ipv6EndpointType?: | "NETLB" | "VM"; /** * The IP version that will be used by this address. Valid options are IPV4 * or IPV6. */ ipVersion?: | "IPV4" | "IPV6" | "UNSPECIFIED_VERSION"; /** * [Output Only] Type of the resource. Always compute#address for addresses. */ kind?: string; /** * A fingerprint for the labels being applied to this Address, which is * essentially a hash of the labels set used for optimistic locking. The * fingerprint is initially generated by Compute Engine and changes after * every request to modify or update labels. You must always provide an * up-to-date fingerprint hash in order to update or change labels, otherwise * the request will fail with error 412 conditionNotMet. To see the latest * fingerprint, make a get() request to retrieve an Address. */ labelFingerprint?: Uint8Array; /** * Labels for this resource. These can only be added or modified by the * setLabels method. Each label key/value pair must comply with RFC1035. Label * values may be empty. */ labels?: { [key: string]: string }; /** * Name 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])?`. The first character must be a * lowercase letter, and all following characters (except for the last * character) must be a dash, lowercase letter, or digit. The last character * must be a lowercase letter or digit. */ name?: string; /** * The URL of the network in which to reserve the address. This field can * only be used with INTERNAL type with the VPC_PEERING purpose. */ network?: string; /** * This signifies the networking tier used for configuring this address and * can only take the following values: PREMIUM or STANDARD. Internal IP * addresses are always Premium Tier; global external IP addresses are always * Premium Tier; regional external IP addresses can be either Standard or * Premium Tier. If this field is not specified, it is assumed to be PREMIUM. */ networkTier?: | "FIXED_STANDARD" | "PREMIUM" | "STANDARD" | "STANDARD_OVERRIDES_FIXED_STANDARD"; /** * The prefix length if the resource represents an IP range. */ prefixLength?: number; /** * The purpose of this resource, which can be one of the following values: - * GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, * load balancers, and similar resources. - DNS_RESOLVER for a DNS resolver * address in a subnetwork for a Cloud DNS inbound forwarder IP addresses * (regional internal IP address in a subnet of a VPC network) - VPC_PEERING * for global internal IP addresses used for private services access allocated * ranges. - NAT_AUTO for the regional external IP addresses used by Cloud NAT * when allocating addresses using automatic NAT IP address allocation. - * IPSEC_INTERCONNECT for addresses created from a private IP range that are * reserved for a VLAN attachment in an *HA VPN over Cloud Interconnect* * configuration. These addresses are regional resources. - * `SHARED_LOADBALANCER_VIP` for an internal IP address that is assigned to * multiple internal forwarding rules. - `PRIVATE_SERVICE_CONNECT` for a * private network address that is used to configure Private Service Connect. * Only global internal addresses can use this purpose. */ purpose?: | "DNS_RESOLVER" | "GCE_ENDPOINT" | "IPSEC_INTERCONNECT" | "NAT_AUTO" | "PRIVATE_SERVICE_CONNECT" | "SERVERLESS" | "SHARED_LOADBALANCER_VIP" | "VPC_PEERING"; /** * [Output Only] The URL of the region where a regional address resides. For * regional addresses, you must specify the region as a path parameter in the * HTTP request URL. *This field is not applicable to global addresses.* */ region?: string; /** * [Output Only] Server-defined URL for the resource. */ selfLink?: string; /** * [Output Only] The status of the address, which can be one of RESERVING, * RESERVED, or IN_USE. An address that is RESERVING is currently in the * process of being reserved. A RESERVED address is currently reserved and * available to use. An IN_USE address is currently being used by another * resource and is not available. */ status?: | "IN_USE" | "RESERVED" | "RESERVING"; /** * The URL of the subnetwork in which to reserve the address. If an IP * address is specified, it must be within the subnetwork's IP range. This * field can only be used with INTERNAL type with a GCE_ENDPOINT or * DNS_RESOLVER purpose. */ subnetwork?: string; /** * [Output Only] The URLs of the resources that are using this address. */ users?: string[]; } function serializeAddress(data: any): Address { return { ...data, id: data["id"] !== undefined ? String(data["id"]) : undefined, labelFingerprint: data["labelFingerprint"] !== undefined ? encodeBase64(data["labelFingerprint"]) : undefined, }; } function deserializeAddress(data: any): Address { return { ...data, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, labelFingerprint: data["labelFingerprint"] !== undefined ? decodeBase64(data["labelFingerprint"] as string) : undefined, }; } export interface AddressAggregatedList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of AddressesScopedList resources. */ items?: { [key: string]: AddressesScopedList }; /** * [Output Only] Type of resource. Always compute#addressAggregatedList for * aggregated lists of addresses. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Unreachable resources. */ unreachables?: string[]; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAddressAggregatedList(data: any): AddressAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, serializeAddressesScopedList(v)]))) : undefined, }; } function deserializeAddressAggregatedList(data: any): AddressAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, deserializeAddressesScopedList(v)]))) : undefined, }; } /** * Additional options for Compute#addressesAggregatedList. */ export interface AddressesAggregatedListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * Indicates whether every visible scope for each scope type (zone, region, * global) should be included in the response. For new resource types added * after this field, the flag has no effect as new resource types will always * include every visible scope for each scope type in response. For resource * types which predate this field, if this flag is omitted or false, only * scopes of the scope types where the resource type is expected to be found * will be included. */ includeAllScopes?: boolean; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; /** * The Shared VPC service project id or service project number for which * aggregated list request is invoked for subnetworks list-usable api. */ serviceProjectNumber?: bigint; } function serializeAddressesAggregatedListOptions(data: any): AddressesAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? String(data["serviceProjectNumber"]) : undefined, }; } function deserializeAddressesAggregatedListOptions(data: any): AddressesAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? BigInt(data["serviceProjectNumber"]) : undefined, }; } /** * Additional options for Compute#addressesDelete. */ export interface AddressesDeleteOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#addressesInsert. */ export interface AddressesInsertOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#addressesList. */ export interface AddressesListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } /** * Additional options for Compute#addressesMove. */ export interface AddressesMoveOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface AddressesScopedList { /** * [Output Only] A list of addresses contained in this scope. */ addresses?: Address[]; /** * [Output Only] Informational warning which replaces the list of addresses * when the list is empty. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAddressesScopedList(data: any): AddressesScopedList { return { ...data, addresses: data["addresses"] !== undefined ? data["addresses"].map((item: any) => (serializeAddress(item))) : undefined, }; } function deserializeAddressesScopedList(data: any): AddressesScopedList { return { ...data, addresses: data["addresses"] !== undefined ? data["addresses"].map((item: any) => (deserializeAddress(item))) : undefined, }; } /** * Additional options for Compute#addressesSetLabels. */ export interface AddressesSetLabelsOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Contains a list of addresses. */ export interface AddressList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of Address resources. */ items?: Address[]; /** * [Output Only] Type of resource. Always compute#addressList for lists of * addresses. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAddressList(data: any): AddressList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeAddress(item))) : undefined, }; } function deserializeAddressList(data: any): AddressList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeAddress(item))) : undefined, }; } /** * Specifies options for controlling advanced machine features. Options that * would traditionally be configured in a BIOS belong here. Features that * require operating system support may have corresponding entries in the * GuestOsFeatures of an Image (e.g., whether or not the OS in the Image * supports nested virtualization being enabled or disabled). */ export interface AdvancedMachineFeatures { /** * Whether to enable nested virtualization or not (default is false). */ enableNestedVirtualization?: boolean; /** * Whether to enable UEFI networking for instance creation. */ enableUefiNetworking?: boolean; /** * Type of Performance Monitoring Unit requested on instance. */ performanceMonitoringUnit?: | "ARCHITECTURAL" | "ENHANCED" | "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED" | "STANDARD"; /** * The number of threads per physical core. To disable simultaneous * multithreading (SMT) set this to 1. If unset, the maximum number of threads * supported per core by the underlying processor is assumed. */ threadsPerCore?: number; /** * Turbo frequency mode to use for the instance. Supported modes include: * * ALL_CORE_MAX Using empty string or not setting this field will use the * platform-specific default turbo mode. */ turboMode?: string; /** * The number of physical cores to expose to an instance. Multiply by the * number of threads per core to compute the total number of virtual CPUs to * expose to the instance. If unset, the number of cores is inferred from the * instance's nominal CPU count and the underlying platform's SMT width. */ visibleCoreCount?: number; } /** * An alias IP range attached to an instance's network interface. */ export interface AliasIpRange { /** * The IP alias ranges to allocate for this interface. This IP CIDR range * must belong to the specified subnetwork and cannot contain IP addresses * reserved by system or used by other network interfaces. This range may be a * single IP address (such as 10.2.3.4), a netmask (such as /24) or a * CIDR-formatted string (such as 10.1.2.0/24). */ ipCidrRange?: string; /** * The name of a subnetwork secondary IP range from which to allocate an IP * alias range. If not specified, the primary range of the subnetwork is used. */ subnetworkRangeName?: string; } /** * This reservation type is specified by total resource amounts (e.g. total * count of CPUs) and can account for multiple instance SKUs. In other words, * one can create instances of varying shapes against this reservation. */ export interface AllocationAggregateReservation { /** * [Output only] List of resources currently in use. */ inUseResources?: AllocationAggregateReservationReservedResourceInfo[]; /** * List of reserved resources (CPUs, memory, accelerators). */ reservedResources?: AllocationAggregateReservationReservedResourceInfo[]; /** * The VM family that all instances scheduled against this reservation must * belong to. */ vmFamily?: | "VM_FAMILY_CLOUD_TPU_DEVICE_CT3" | "VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L" | "VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP" | "VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P" | "VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P"; /** * The workload type of the instances that will target this reservation. */ workloadType?: | "BATCH" | "SERVING" | "UNSPECIFIED"; } export interface AllocationAggregateReservationReservedResourceInfo { /** * Properties of accelerator resources in this reservation. */ accelerator?: AllocationAggregateReservationReservedResourceInfoAccelerator; } export interface AllocationAggregateReservationReservedResourceInfoAccelerator { /** * Number of accelerators of specified type. */ acceleratorCount?: number; /** * Full or partial URL to accelerator type. e.g. * "projects/{PROJECT}/zones/{ZONE}/acceleratorTypes/ct4l" */ acceleratorType?: string; } /** * [Output Only] Contains output only fields. */ export interface AllocationResourceStatus { /** * Allocation Properties of this reservation. */ specificSkuAllocation?: AllocationResourceStatusSpecificSKUAllocation; } /** * Contains Properties set for the reservation. */ export interface AllocationResourceStatusSpecificSKUAllocation { /** * ID of the instance template used to populate reservation properties. */ sourceInstanceTemplateId?: string; } export interface AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { /** * Specifies the size of the disk in base-2 GB. */ diskSizeGb?: bigint; /** * Specifies the disk interface to use for attaching this disk, which is * either SCSI or NVME. The default is SCSI. For performance characteristics * of SCSI over NVMe, see Local SSD performance. */ interface?: | "NVME" | "SCSI"; } function serializeAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(data: any): AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { return { ...data, diskSizeGb: data["diskSizeGb"] !== undefined ? String(data["diskSizeGb"]) : undefined, }; } function deserializeAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(data: any): AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { return { ...data, diskSizeGb: data["diskSizeGb"] !== undefined ? BigInt(data["diskSizeGb"]) : undefined, }; } /** * Properties of the SKU instances being reserved. Next ID: 9 */ export interface AllocationSpecificSKUAllocationReservedInstanceProperties { /** * Specifies accelerator type and count. */ guestAccelerators?: AcceleratorConfig[]; /** * Specifies amount of local ssd to reserve with each instance. The type of * disk is local-ssd. */ localSsds?: AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk[]; /** * An opaque location hint used to place the allocation close to other * resources. This field is for use by internal tools that use the public API. */ locationHint?: string; /** * Specifies type of machine (name only) which has fixed number of vCPUs and * fixed amount of memory. This also includes specifying custom machine type * following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. */ machineType?: string; /** * Minimum cpu platform the reservation. */ minCpuPlatform?: string; } function serializeAllocationSpecificSKUAllocationReservedInstanceProperties(data: any): AllocationSpecificSKUAllocationReservedInstanceProperties { return { ...data, localSsds: data["localSsds"] !== undefined ? data["localSsds"].map((item: any) => (serializeAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(item))) : undefined, }; } function deserializeAllocationSpecificSKUAllocationReservedInstanceProperties(data: any): AllocationSpecificSKUAllocationReservedInstanceProperties { return { ...data, localSsds: data["localSsds"] !== undefined ? data["localSsds"].map((item: any) => (deserializeAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(item))) : undefined, }; } /** * This reservation type allows to pre allocate specific instance * configuration. */ export interface AllocationSpecificSKUReservation { /** * [Output Only] Indicates how many instances are actually usable currently. */ assuredCount?: bigint; /** * Specifies the number of resources that are allocated. */ count?: bigint; /** * The instance properties for the reservation. */ instanceProperties?: AllocationSpecificSKUAllocationReservedInstanceProperties; /** * [Output Only] Indicates how many instances are in use. */ inUseCount?: bigint; /** * Specifies the instance template to create the reservation. If you use this * field, you must exclude the instanceProperties field. This field is * optional, and it can be a full or partial URL. For example, the following * are all valid URLs to an instance template: - * https://www.googleapis.com/compute/v1/projects/project * /global/instanceTemplates/instanceTemplate - * projects/project/global/instanceTemplates/instanceTemplate - * global/instanceTemplates/instanceTemplate */ sourceInstanceTemplate?: string; } function serializeAllocationSpecificSKUReservation(data: any): AllocationSpecificSKUReservation { return { ...data, assuredCount: data["assuredCount"] !== undefined ? String(data["assuredCount"]) : undefined, count: data["count"] !== undefined ? String(data["count"]) : undefined, instanceProperties: data["instanceProperties"] !== undefined ? serializeAllocationSpecificSKUAllocationReservedInstanceProperties(data["instanceProperties"]) : undefined, inUseCount: data["inUseCount"] !== undefined ? String(data["inUseCount"]) : undefined, }; } function deserializeAllocationSpecificSKUReservation(data: any): AllocationSpecificSKUReservation { return { ...data, assuredCount: data["assuredCount"] !== undefined ? BigInt(data["assuredCount"]) : undefined, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, instanceProperties: data["instanceProperties"] !== undefined ? deserializeAllocationSpecificSKUAllocationReservedInstanceProperties(data["instanceProperties"]) : undefined, inUseCount: data["inUseCount"] !== undefined ? BigInt(data["inUseCount"]) : undefined, }; } /** * An instance-attached disk resource. */ export interface AttachedDisk { /** * [Output Only] The architecture of the attached disk. Valid values are * ARM64 or X86_64. */ architecture?: | "ARCHITECTURE_UNSPECIFIED" | "ARM64" | "X86_64"; /** * Specifies whether the disk will be auto-deleted when the instance is * deleted (but not when the disk is detached from the instance). */ autoDelete?: boolean; /** * Indicates that this is a boot disk. The virtual machine will use the first * partition of the disk for its root filesystem. */ boot?: boolean; /** * Specifies a unique device name of your choice that is reflected into the * /dev/disk/by-id/google-* tree of a Linux operating system running within * the instance. This name can be used to reference the device for mounting, * resizing, and so on, from within the instance. If not specified, the server * chooses a default device name to apply to this disk, in the form * persistent-disk-x, where x is a number assigned by Google Compute Engine. * This field is only applicable for persistent disks. */ deviceName?: string; /** * Encrypts or decrypts a disk using a customer-supplied encryption key. If * you are creating a new disk, this field encrypts the new disk using an * encryption key that you provide. If you are attaching an existing disk that * is already encrypted, this field decrypts the disk using the * customer-supplied encryption key. If you encrypt a disk using a * customer-supplied key, you must provide the same key again when you attempt * to use this resource at a later time. For example, you must provide the key * when you create a snapshot or an image from the disk or when you attach the * disk to a virtual machine instance. If you do not provide an encryption * key, then the disk will be encrypted using an automatically generated key * and you do not need to provide a key to use the disk later. Note: Instance * templates do not store customer-supplied encryption keys, so you cannot use * your own keys to encrypt disks in a managed instance group. You cannot * create VMs that have disks with customer-supplied keys using the bulk * insert method. */ diskEncryptionKey?: CustomerEncryptionKey; /** * The size of the disk in GB. */ diskSizeGb?: bigint; /** * [Input Only] Whether to force attach the regional disk even if it's * currently attached to another instance. If you try to force attach a zonal * disk to an instance, you will receive an error. */ forceAttach?: boolean; /** * A list of features to enable on the guest operating system. Applicable * only for bootable images. Read Enabling guest operating system features to * see a list of available options. */ guestOsFeatures?: GuestOsFeature[]; /** * [Output Only] A zero-based index to this disk, where 0 is reserved for the * boot disk. If you have many disks attached to an instance, each disk would * have a unique index number. */ index?: number; /** * [Input Only] Specifies the parameters for a new disk that will be created * alongside the new instance. Use initialization parameters to create boot * disks or local SSDs attached to the new instance. This property is mutually * exclusive with the source property; you can only define one or the other, * but not both. */ initializeParams?: AttachedDiskInitializeParams; /** * Specifies the disk interface to use for attaching this disk, which is * either SCSI or NVME. For most machine types, the default is SCSI. Local * SSDs can use either NVME or SCSI. In certain configurations, persistent * disks can use NVMe. For more information, see About persistent disks. */ interface?: | "NVME" | "SCSI"; /** * [Output Only] Type of the resource. Always compute#attachedDisk for * attached disks. */ kind?: string; /** * [Output Only] Any valid publicly visible licenses. */ licenses?: string[]; /** * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If * not specified, the default is to attach the disk in READ_WRITE mode. */ mode?: | "READ_ONLY" | "READ_WRITE"; /** * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this * field is set to PRESERVED if the LocalSSD data has been saved to a * persistent location by customer request. (see the discard_local_ssd option * on Stop/Suspend). Read-only in the api. */ savedState?: | "DISK_SAVED_STATE_UNSPECIFIED" | "PRESERVED"; /** * [Output Only] shielded vm initial state stored on disk */ shieldedInstanceInitialState?: InitialStateConfig; /** * Specifies a valid partial or full URL to an existing Persistent Disk * resource. When creating a new instance boot disk, one of * initializeParams.sourceImage or initializeParams.sourceSnapshot or * disks.source is required. If desired, you can also attach existing non-root * persistent disks using this property. This field is only applicable for * persistent disks. Note that for InstanceTemplate, specify the disk name for * zonal disk, and the URL for regional disk. */ source?: string; /** * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not * specified, the default is PERSISTENT. */ type?: | "PERSISTENT" | "SCRATCH"; } function serializeAttachedDisk(data: any): AttachedDisk { return { ...data, diskSizeGb: data["diskSizeGb"] !== undefined ? String(data["diskSizeGb"]) : undefined, initializeParams: data["initializeParams"] !== undefined ? serializeAttachedDiskInitializeParams(data["initializeParams"]) : undefined, shieldedInstanceInitialState: data["shieldedInstanceInitialState"] !== undefined ? serializeInitialStateConfig(data["shieldedInstanceInitialState"]) : undefined, }; } function deserializeAttachedDisk(data: any): AttachedDisk { return { ...data, diskSizeGb: data["diskSizeGb"] !== undefined ? BigInt(data["diskSizeGb"]) : undefined, initializeParams: data["initializeParams"] !== undefined ? deserializeAttachedDiskInitializeParams(data["initializeParams"]) : undefined, shieldedInstanceInitialState: data["shieldedInstanceInitialState"] !== undefined ? deserializeInitialStateConfig(data["shieldedInstanceInitialState"]) : undefined, }; } /** * [Input Only] Specifies the parameters for a new disk that will be created * alongside the new instance. Use initialization parameters to create boot * disks or local SSDs attached to the new instance. This field is persisted and * returned for instanceTemplate and not returned in the context of instance. * This property is mutually exclusive with the source property; you can only * define one or the other, but not both. */ export interface AttachedDiskInitializeParams { /** * The architecture of the attached disk. Valid values are arm64 or x86_64. */ architecture?: | "ARCHITECTURE_UNSPECIFIED" | "ARM64" | "X86_64"; /** * An optional description. Provide this property when creating the disk. */ description?: string; /** * Specifies the disk name. If not specified, the default is to use the name * of the instance. If a disk with the same name already exists in the given * region, the existing disk is attached to the new instance and the new disk * is not created. */ diskName?: string; /** * Specifies the size of the disk in base-2 GB. The size must be at least 10 * GB. If you specify a sourceImage, which is required for boot disks, the * default size is the size of the sourceImage. If you do not specify a * sourceImage, the default disk size is 500 GB. */ diskSizeGb?: bigint; /** * Specifies the disk type to use to create the instance. If not specified, * the default is pd-standard, specified using the full URL. For example: * https://www.googleapis.com/compute/v1/projects/project/zones/zone * /diskTypes/pd-standard For a full list of acceptable values, see Persistent * disk types. If you specify this field when creating a VM, you can provide * either the full or partial URL. For example, the following values are * valid: - https://www.googleapis.com/compute/v1/projects/project/zones/zone * /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - * zones/zone/diskTypes/diskType If you specify this field when creating or * updating an instance template or all-instances configuration, specify the * type of the disk, not the URL. For example: pd-standard. */ diskType?: string; /** * Whether this disk is using confidential compute mode. */ enableConfidentialCompute?: boolean; /** * Labels to apply to this disk. These can be later modified by the * disks.setLabels method. This field is only applicable for persistent disks. */ labels?: { [key: string]: string }; /** * A list of publicly visible licenses. Reserved for Google's use. */ licenses?: string[]; /** * Specifies which action to take on instance update with this disk. Default * is to use the existing disk. */ onUpdateAction?: | "RECREATE_DISK" | "RECREATE_DISK_IF_SOURCE_CHANGED" | "USE_EXISTING_DISK"; /** * Indicates how many IOPS to provision for the disk. This sets the number of * I/O operations per second that the disk can handle. Values must be between * 10,000 and 120,000. For more details, see the Extreme persistent disk * documentation. */ provisionedIops?: bigint; /** * Indicates how much throughput to provision for the disk. This sets the * number of throughput mb per second that the disk can handle. Values must * greater than or equal to 1. */ provisionedThroughput?: bigint; /** * Required for each regional disk associated with the instance. Specify the * URLs of the zones where the disk should be replicated to. You must provide * exactly two replica zones, and one zone must be the same as the instance * zone. */ replicaZones?: string[]; /** * Resource manager tags to be bound to the disk. Tag keys and values have * the same definition as resource manager tags. Keys must be in the format * `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The * field is ignored (both PUT & PATCH) when empty. */ resourceManagerTags?: { [key: string]: string }; /** * Resource policies applied to this disk for automatic snapshot creations. * Specified using the full or partial URL. For instance template, specify * only the resource policy name. */ resourcePolicies?: string[]; /** * The source image to create this disk. When creating a new instance boot * disk, one of initializeParams.sourceImage or * initializeParams.sourceSnapshot or disks.source is required. To create a * disk with one of the public operating system images, specify the image by * its family name. For example, specify family/debian-9 to use the latest * Debian 9 image: projects/debian-cloud/global/images/family/debian-9 * Alternatively, use a specific version of a public operating system image: * projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a * disk with a custom image that you created, specify the image name in the * following format: global/images/my-custom-image You can also specify a * custom image by its image family, which returns the latest version of the * image in that family. Replace the image name with family/family-name: * global/images/family/my-image-family If the source image is deleted later, * this field will not be set. */ sourceImage?: string; /** * The customer-supplied encryption key of the source image. Required if the * source image is protected by a customer-supplied encryption key. * InstanceTemplate and InstancePropertiesPatch do not store customer-supplied * encryption keys, so you cannot create disks for instances in a managed * instance group if the source images are encrypted with your own keys. */ sourceImageEncryptionKey?: CustomerEncryptionKey; /** * The source snapshot to create this disk. When creating a new instance boot * disk, one of initializeParams.sourceSnapshot or * initializeParams.sourceImage or disks.source is required. To create a disk * with a snapshot that you created, specify the snapshot name in the * following format: global/snapshots/my-backup If the source snapshot is * deleted later, this field will not be set. */ sourceSnapshot?: string; /** * The customer-supplied encryption key of the source snapshot. */ sourceSnapshotEncryptionKey?: CustomerEncryptionKey; /** * The storage pool in which the new disk is created. You can provide this as * a partial or full URL to the resource. For example, the following are valid * values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone * /storagePools/storagePool - * projects/project/zones/zone/storagePools/storagePool - * zones/zone/storagePools/storagePool */ storagePool?: string; } function serializeAttachedDiskInitializeParams(data: any): AttachedDiskInitializeParams { return { ...data, diskSizeGb: data["diskSizeGb"] !== undefined ? String(data["diskSizeGb"]) : undefined, provisionedIops: data["provisionedIops"] !== undefined ? String(data["provisionedIops"]) : undefined, provisionedThroughput: data["provisionedThroughput"] !== undefined ? String(data["provisionedThroughput"]) : undefined, }; } function deserializeAttachedDiskInitializeParams(data: any): AttachedDiskInitializeParams { return { ...data, diskSizeGb: data["diskSizeGb"] !== undefined ? BigInt(data["diskSizeGb"]) : undefined, provisionedIops: data["provisionedIops"] !== undefined ? BigInt(data["provisionedIops"]) : undefined, provisionedThroughput: data["provisionedThroughput"] !== undefined ? BigInt(data["provisionedThroughput"]) : undefined, }; } /** * Specifies the audit configuration for a service. The configuration * determines which permission types are logged, and what identities, if any, * are exempted from logging. An AuditConfig must have one or more * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a * specific service, the union of the two AuditConfigs is used for that service: * the log_types specified in each AuditConfig are enabled, and the * exempted_members in each AuditLogConfig are exempted. Example Policy with * multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", * "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ * "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": * "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", * "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": * "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For * sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ * logging. It also exempts `jose@example.com` from DATA_READ logging, and * `aliya@example.com` from DATA_WRITE logging. */ export interface AuditConfig { /** * The configuration for logging of each type of permission. */ auditLogConfigs?: AuditLogConfig[]; /** * Specifies a service that will be enabled for audit logging. For example, * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a * special value that covers all services. */ service?: string; } /** * Provides the configuration for logging a type of permissions. Example: { * "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ * "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables * 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from * DATA_READ logging. */ export interface AuditLogConfig { /** * Specifies the identities that do not cause logging for this type of * permission. Follows the same format of Binding.members. */ exemptedMembers?: string[]; /** * The log type that this config enables. */ logType?: | "ADMIN_READ" | "DATA_READ" | "DATA_WRITE" | "LOG_TYPE_UNSPECIFIED"; } /** * Represents an Autoscaler resource. Google Compute Engine has two Autoscaler * resources: * [Zonal](/compute/docs/reference/rest/v1/autoscalers) * * [Regional](/compute/docs/reference/rest/v1/regionAutoscalers) Use autoscalers * to automatically add or delete instances from a managed instance group * according to your defined autoscaling policy. For more information, read * Autoscaling Groups of Instances. For zonal managed instance groups resource, * use the autoscaler resource. For regional managed instance groups, use the * regionAutoscalers resource. */ export interface Autoscaler { /** * The configuration parameters for the autoscaling algorithm. You can define * one or more signals for an autoscaler: cpuUtilization, * customMetricUtilizations, and loadBalancingUtilization. If none of these * are specified, the default will be to autoscale based on cpuUtilization to * 0.6 or 60%. */ autoscalingPolicy?: AutoscalingPolicy; /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * An optional description of this resource. Provide this property when you * create the resource. */ description?: string; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * [Output Only] Type of the resource. Always compute#autoscaler for * autoscalers. */ kind?: string; /** * Name 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. */ name?: string; /** * [Output Only] Target recommended MIG size (number of instances) computed * by autoscaler. Autoscaler calculates the recommended MIG size even when the * autoscaling policy mode is different from ON. This field is empty when * autoscaler is not connected to an existing managed instance group or * autoscaler did not generate its prediction. */ recommendedSize?: number; /** * [Output Only] URL of the region where the instance group resides (for * autoscalers living in regional scope). */ region?: string; /** * [Output Only] Status information of existing scaling schedules. */ scalingScheduleStatus?: { [key: string]: ScalingScheduleStatus }; /** * [Output Only] Server-defined URL for the resource. */ selfLink?: string; /** * [Output Only] The status of the autoscaler configuration. Current set of * possible values: - PENDING: Autoscaler backend hasn't read new/updated * configuration. - DELETING: Configuration is being deleted. - ACTIVE: * Configuration is acknowledged to be effective. Some warnings might be * present in the statusDetails field. - ERROR: Configuration has errors. * Actionable for users. Details are present in the statusDetails field. New * values might be added in the future. */ status?: | "ACTIVE" | "DELETING" | "ERROR" | "PENDING"; /** * [Output Only] Human-readable details about the current state of the * autoscaler. Read the documentation for Commonly returned status messages * for examples of status messages you might encounter. */ statusDetails?: AutoscalerStatusDetails[]; /** * URL of the managed instance group that this autoscaler will scale. This * field is required when creating an autoscaler. */ target?: string; /** * [Output Only] URL of the zone where the instance group resides (for * autoscalers living in zonal scope). */ zone?: string; } function serializeAutoscaler(data: any): Autoscaler { return { ...data, id: data["id"] !== undefined ? String(data["id"]) : undefined, }; } function deserializeAutoscaler(data: any): Autoscaler { return { ...data, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, }; } export interface AutoscalerAggregatedList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of AutoscalersScopedList resources. */ items?: { [key: string]: AutoscalersScopedList }; /** * [Output Only] Type of resource. Always compute#autoscalerAggregatedList * for aggregated lists of autoscalers. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Unreachable resources. end_interface: * MixerListResponseWithEtagBuilder */ unreachables?: string[]; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAutoscalerAggregatedList(data: any): AutoscalerAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, serializeAutoscalersScopedList(v)]))) : undefined, }; } function deserializeAutoscalerAggregatedList(data: any): AutoscalerAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, deserializeAutoscalersScopedList(v)]))) : undefined, }; } /** * Contains a list of Autoscaler resources. */ export interface AutoscalerList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of Autoscaler resources. */ items?: Autoscaler[]; /** * [Output Only] Type of resource. Always compute#autoscalerList for lists of * autoscalers. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAutoscalerList(data: any): AutoscalerList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeAutoscaler(item))) : undefined, }; } function deserializeAutoscalerList(data: any): AutoscalerList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeAutoscaler(item))) : undefined, }; } /** * Additional options for Compute#autoscalersAggregatedList. */ export interface AutoscalersAggregatedListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * Indicates whether every visible scope for each scope type (zone, region, * global) should be included in the response. For new resource types added * after this field, the flag has no effect as new resource types will always * include every visible scope for each scope type in response. For resource * types which predate this field, if this flag is omitted or false, only * scopes of the scope types where the resource type is expected to be found * will be included. */ includeAllScopes?: boolean; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; /** * The Shared VPC service project id or service project number for which * aggregated list request is invoked for subnetworks list-usable api. */ serviceProjectNumber?: bigint; } function serializeAutoscalersAggregatedListOptions(data: any): AutoscalersAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? String(data["serviceProjectNumber"]) : undefined, }; } function deserializeAutoscalersAggregatedListOptions(data: any): AutoscalersAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? BigInt(data["serviceProjectNumber"]) : undefined, }; } /** * Additional options for Compute#autoscalersDelete. */ export interface AutoscalersDeleteOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#autoscalersInsert. */ export interface AutoscalersInsertOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#autoscalersList. */ export interface AutoscalersListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } /** * Additional options for Compute#autoscalersPatch. */ export interface AutoscalersPatchOptions { /** * Name of the autoscaler to patch. */ autoscaler?: string; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface AutoscalersScopedList { /** * [Output Only] A list of autoscalers contained in this scope. */ autoscalers?: Autoscaler[]; /** * [Output Only] Informational warning which replaces the list of autoscalers * when the list is empty. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeAutoscalersScopedList(data: any): AutoscalersScopedList { return { ...data, autoscalers: data["autoscalers"] !== undefined ? data["autoscalers"].map((item: any) => (serializeAutoscaler(item))) : undefined, }; } function deserializeAutoscalersScopedList(data: any): AutoscalersScopedList { return { ...data, autoscalers: data["autoscalers"] !== undefined ? data["autoscalers"].map((item: any) => (deserializeAutoscaler(item))) : undefined, }; } export interface AutoscalerStatusDetails { /** * The status message. */ message?: string; /** * The type of error, warning, or notice returned. Current set of possible * values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance * group are unhealthy (not in RUNNING state). - * BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service * attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): * Autoscaler recommends a size greater than maxNumReplicas. - * CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples * are not exported often enough to be a credible base for autoscaling. - * CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does * not exist or does not have the necessary labels. - MIN_EQUALS_MAX * (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the * autoscaler cannot add or remove instances from the instance group. - * MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive * any data from the custom metric configured for autoscaling. - * MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured * to scale based on a load balancing signal but the instance group has not * received any requests from the load balancer. - MODE_OFF (WARNING): * Autoscaling is turned off. The number of instances in the group won't * change automatically. The autoscaling configuration is preserved. - * MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. * The autoscaler can add instances but not remove any. - * MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be * autoscaled because it has more than one backend service attached to it. - * NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the * necessary resources, such as CPU or number of instances. - * REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: * there is a resource stockout in the chosen region. - * SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not * exist. - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): * Autoscaling does not work with an HTTP/S load balancer that has been * configured for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal * autoscalers: there is a resource stockout in the chosen zone. For regional * autoscalers: in at least one of the zones you're using there is a resource * stockout. New values might be added in the future. Some of the values might * not be available in all API versions. */ type?: | "ALL_INSTANCES_UNHEALTHY" | "BACKEND_SERVICE_DOES_NOT_EXIST" | "CAPPED_AT_MAX_NUM_REPLICAS" | "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE" | "CUSTOM_METRIC_INVALID" | "MIN_EQUALS_MAX" | "MISSING_CUSTOM_METRIC_DATA_POINTS" | "MISSING_LOAD_BALANCING_DATA_POINTS" | "MODE_OFF" | "MODE_ONLY_SCALE_OUT" | "MODE_ONLY_UP" | "MORE_THAN_ONE_BACKEND_SERVICE" | "NOT_ENOUGH_QUOTA_AVAILABLE" | "REGION_RESOURCE_STOCKOUT" | "SCALING_TARGET_DOES_NOT_EXIST" | "SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX" | "SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN" | "UNKNOWN" | "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION" | "ZONE_RESOURCE_STOCKOUT"; } /** * Additional options for Compute#autoscalersUpdate. */ export interface AutoscalersUpdateOptions { /** * Name of the autoscaler to update. */ autoscaler?: string; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Cloud Autoscaler policy. */ export interface AutoscalingPolicy { /** * The number of seconds that your application takes to initialize on a VM * instance. This is referred to as the [initialization * period](/compute/docs/autoscaler#cool_down_period). Specifying an accurate * initialization period improves autoscaler decisions. For example, when * scaling out, the autoscaler ignores data from VMs that are still * initializing because those VMs might not yet represent normal usage of your * application. The default initialization period is 60 seconds. * Initialization periods might vary because of numerous factors. We recommend * that you test how long your application takes to initialize. To do this, * create a VM and time your application's startup process. */ coolDownPeriodSec?: number; /** * Defines the CPU utilization policy that allows the autoscaler to scale * based on the average CPU utilization of a managed instance group. */ cpuUtilization?: AutoscalingPolicyCpuUtilization; /** * Configuration parameters of autoscaling based on a custom metric. */ customMetricUtilizations?: AutoscalingPolicyCustomMetricUtilization[]; /** * Configuration parameters of autoscaling based on load balancer. */ loadBalancingUtilization?: AutoscalingPolicyLoadBalancingUtilization; /** * The maximum number of instances that the autoscaler can scale out to. This * is required when creating or updating an autoscaler. The maximum number of * replicas must not be lower than minimal number of replicas. */ maxNumReplicas?: number; /** * The minimum number of replicas that the autoscaler can scale in to. This * cannot be less than 0. If not provided, autoscaler chooses a default value * depending on maximum number of instances allowed. */ minNumReplicas?: number; /** * Defines the operating mode for this policy. The following modes are * available: - OFF: Disables the autoscaler but maintains its configuration. * - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: * Enables all autoscaler activities according to its policy. For more * information, see "Turning off or restricting an autoscaler" */ mode?: | "OFF" | "ON" | "ONLY_SCALE_OUT" | "ONLY_UP"; scaleInControl?: AutoscalingPolicyScaleInControl; /** * Scaling schedules defined for an autoscaler. Multiple schedules can be set * on an autoscaler, and they can overlap. During overlapping periods the * greatest min_required_replicas of all scaling schedules is applied. Up to * 128 scaling schedules are allowed. */ scalingSchedules?: { [key: string]: AutoscalingPolicyScalingSchedule }; } /** * CPU utilization policy. */ export interface AutoscalingPolicyCpuUtilization { /** * Indicates whether predictive autoscaling based on CPU metric is enabled. * Valid values are: * NONE (default). No predictive method is used. The * autoscaler scales the group to meet current demand based on real-time * metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves * availability by monitoring daily and weekly load patterns and scaling out * ahead of anticipated demand. */ predictiveMethod?: | "NONE" | "OPTIMIZE_AVAILABILITY"; /** * The target CPU utilization that the autoscaler maintains. Must be a float * value in the range (0, 1]. If not specified, the default is 0.6. If the CPU * level is below the target utilization, the autoscaler scales in the number * of instances until it reaches the minimum number of instances you specified * or until the average CPU of your instances reaches the target utilization. * If the average CPU is above the target utilization, the autoscaler scales * out until it reaches the maximum number of instances you specified or until * the average utilization reaches the target utilization. */ utilizationTarget?: number; } /** * Custom utilization metric policy. */ export interface AutoscalingPolicyCustomMetricUtilization { /** * A filter string, compatible with a Stackdriver Monitoring filter string * for TimeSeries.list API call. This filter is used to select a specific * TimeSeries for the purpose of autoscaling and to determine whether the * metric is exporting per-instance or per-group data. For the filter to be * valid for autoscaling purposes, the following rules apply: - You can only * use the AND operator for joining selectors. - You can only use direct * equality comparison operator (=) without any functions for each selector. - * You can specify the metric in both the filter string and in the metric * field. However, if specified in both places, the metric must be identical. * - The monitored resource type determines what kind of values are expected * for the metric. If it is a gce_instance, the autoscaler expects the metric * to include a separate TimeSeries for each instance in a group. In such a * case, you cannot filter on resource labels. If the resource type is any * other value, the autoscaler expects this metric to contain values that * apply to the entire autoscaled instance group and resource label filtering * can be performed to point autoscaler at the correct TimeSeries to scale * upon. This is called a *per-group metric* for the purpose of autoscaling. * If not specified, the type defaults to gce_instance. Try to provide a * filter that is selective enough to pick just one TimeSeries for the * autoscaled group or for each of the instances (if you are using * gce_instance resource type). If multiple TimeSeries are returned upon the * query execution, the autoscaler will sum their respective values to obtain * its scaling value. */ filter?: string; /** * The identifier (type) of the Stackdriver Monitoring metric. The metric * cannot have negative values. The metric must have a value type of INT64 or * DOUBLE. */ metric?: string; /** * If scaling is based on a per-group metric value that represents the total * amount of work to be done or resource usage, set this value to an amount * assigned for a single instance of the scaled group. Autoscaler keeps the * number of instances proportional to the value of this metric. The metric * itself does not change value due to group resizing. A good metric to use * with the target is for example * pubsub.googleapis.com/subscription/num_undelivered_messages or a custom * metric exporting the total number of requests coming to your instances. A * bad example would be a metric exporting an average or median latency, since * this value can't include a chunk assignable to a single instance, it could * be better used with utilization_target instead. */ singleInstanceAssignment?: number; /** * The target value of the metric that autoscaler maintains. This must be a * positive value. A utilization metric scales number of virtual machines * handling requests to increase or decrease proportionally to the metric. For * example, a good metric to use as a utilization_target is * https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. * The autoscaler works to keep this value constant for each of the instances. */ utilizationTarget?: number; /** * Defines how target utilization value is expressed for a Stackdriver * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. */ utilizationTargetType?: | "DELTA_PER_MINUTE" | "DELTA_PER_SECOND" | "GAUGE"; } /** * Configuration parameters of autoscaling based on load balancing. */ export interface AutoscalingPolicyLoadBalancingUtilization { /** * Fraction of backend capacity utilization (set in HTTP(S) load balancing * configuration) that the autoscaler maintains. Must be a positive float * value. If not defined, the default is 0.8. */ utilizationTarget?: number; } /** * Configuration that allows for slower scale in so that even if Autoscaler * recommends an abrupt scale in of a MIG, it will be throttled as specified by * the parameters below. */ export interface AutoscalingPolicyScaleInControl { /** * Maximum allowed number (or %) of VMs that can be deducted from the peak * recommendation during the window autoscaler looks at when computing * recommendations. Possibly all these VMs can be deleted at once so user * service needs to be prepared to lose that many VMs in one step. */ maxScaledInReplicas?: FixedOrPercent; /** * How far back autoscaling looks when computing recommendations to include * directives regarding slower scale in, as described above. */ timeWindowSec?: number; } /** * Scaling based on user-defined schedule. The message describes a single * scaling schedule. A scaling schedule changes the minimum number of VM * instances an autoscaler can recommend, which can trigger scaling out. */ export interface AutoscalingPolicyScalingSchedule { /** * A description of a scaling schedule. */ description?: string; /** * A boolean value that specifies whether a scaling schedule can influence * autoscaler recommendations. If set to true, then a scaling schedule has no * effect. This field is optional, and its value is false by default. */ disabled?: boolean; /** * The duration of time intervals, in seconds, for which this scaling * schedule is to run. The minimum allowed value is 300. This field is * required. */ durationSec?: number; /** * The minimum number of VM instances that the autoscaler will recommend in * time intervals starting according to schedule. This field is required. */ minRequiredReplicas?: number; /** * The start timestamps of time intervals when this scaling schedule is to * provide a scaling signal. This field uses the extended cron format (with an * optional year field). The expression can describe a single timestamp if the * optional year is set, in which case the scaling schedule runs once. The * schedule is interpreted with respect to time_zone. This field is required. * Note: These timestamps only describe when autoscaler starts providing the * scaling signal. The VMs need additional time to become serving. */ schedule?: string; /** * The time zone to use when interpreting the schedule. The value of this * field must be a time zone name from the tz database: * https://en.wikipedia.org/wiki/Tz_database. This field is assigned a default * value of "UTC" if left empty. */ timeZone?: string; } /** * Contains the configurations necessary to generate a signature for access to * private storage buckets that support Signature Version 4 for authentication. * The service name for generating the authentication header will always default * to 's3'. */ export interface AWSV4Signature { /** * The access key used for s3 bucket authentication. Required for updating or * creating a backend that uses AWS v4 signature authentication, but will not * be returned as part of the configuration when queried with a REST API GET * request. @InputOnly */ accessKey?: string; /** * The identifier of an access key used for s3 bucket authentication. */ accessKeyId?: string; /** * The optional version identifier for the access key. You can use this to * keep track of different iterations of your access key. */ accessKeyVersion?: string; /** * The name of the cloud region of your origin. This is a free-form field * with the name of the region your cloud uses to host your origin. For * example, "us-east-1" for AWS or "us-ashburn-1" for OCI. */ originRegion?: string; } /** * Message containing information of one individual backend. */ export interface Backend { /** * Specifies how to determine whether the backend of a load balancer can * handle additional traffic or is fully loaded. For usage guidelines, see * Connection balancing mode. Backends must use compatible balancing modes. * For more information, see Supported balancing modes and target capacity * settings and Restrictions and guidance for instance groups. Note: * Currently, if you use the API to configure incompatible balancing modes, * the configuration might be accepted even though it has no impact and is * ignored. Specifically, Backend.maxUtilization is ignored when * Backend.balancingMode is RATE. In the future, this incompatible combination * will be rejected. */ balancingMode?: | "CONNECTION" | "RATE" | "UTILIZATION"; /** * A multiplier applied to the backend's target capacity of its balancing * mode. The default value is 1, which means the group serves up to 100% of * its configured capacity (depending on balancingMode). A setting of 0 means * the group is completely drained, offering 0% of its available capacity. The * valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger * than 0 and smaller than 0.1. You cannot configure a setting of 0 when there * is only one backend attached to the backend service. Not available with * backends that don't support using a balancingMode. This includes backends * such as global internet NEGs, regional serverless NEGs, and PSC NEGs. */ capacityScaler?: number; /** * An optional description of this resource. Provide this property when you * create the resource. */ description?: string; /** * This field designates whether this is a failover backend. More than one * failover backend can be configured for a given BackendService. */ failover?: boolean; /** * The fully-qualified URL of an instance group or network endpoint group * (NEG) resource. To determine what types of backends a load balancer * supports, see the [Backend services * overview](https://cloud.google.com/load-balancing/docs/backend-service#backends). * You must use the *fully-qualified* URL (starting with * https://www.googleapis.com/) to specify the instance group or NEG. Partial * URLs are not supported. */ group?: string; /** * Defines a target maximum number of simultaneous connections. For usage * guidelines, see Connection balancing mode and Utilization balancing mode. * Not available if the backend's balancingMode is RATE. */ maxConnections?: number; /** * Defines a target maximum number of simultaneous connections. For usage * guidelines, see Connection balancing mode and Utilization balancing mode. * Not available if the backend's balancingMode is RATE. */ maxConnectionsPerEndpoint?: number; /** * Defines a target maximum number of simultaneous connections. For usage * guidelines, see Connection balancing mode and Utilization balancing mode. * Not available if the backend's balancingMode is RATE. */ maxConnectionsPerInstance?: number; /** * Defines a maximum number of HTTP requests per second (RPS). For usage * guidelines, see Rate balancing mode and Utilization balancing mode. Not * available if the backend's balancingMode is CONNECTION. */ maxRate?: number; /** * Defines a maximum target for requests per second (RPS). For usage * guidelines, see Rate balancing mode and Utilization balancing mode. Not * available if the backend's balancingMode is CONNECTION. */ maxRatePerEndpoint?: number; /** * Defines a maximum target for requests per second (RPS). For usage * guidelines, see Rate balancing mode and Utilization balancing mode. Not * available if the backend's balancingMode is CONNECTION. */ maxRatePerInstance?: number; /** * Optional parameter to define a target capacity for the UTILIZATION * balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see * Utilization balancing mode. */ maxUtilization?: number; /** * This field indicates whether this backend should be fully utilized before * sending traffic to backends with default preference. The possible values * are: - PREFERRED: Backends with this preference level will be filled up to * their capacity limits first, based on RTT. - DEFAULT: If preferred backends * don't have enough capacity, backends in this layer would be used and * traffic would be assigned based on the load balancing algorithm you use. * This is the default */ preference?: | "DEFAULT" | "PREFERENCE_UNSPECIFIED" | "PREFERRED"; } /** * Represents a Cloud Storage Bucket resource. This Cloud Storage bucket * resource is referenced by a URL map of a load balancer. For more information, * read Backend Buckets. */ export interface BackendBucket { /** * Cloud Storage bucket name. */ bucketName?: string; /** * Cloud CDN configuration for this BackendBucket. */ cdnPolicy?: BackendBucketCdnPolicy; /** * Compress text responses using Brotli or gzip compression, based on the * client's Accept-Encoding header. */ compressionMode?: | "AUTOMATIC" | "DISABLED"; /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * Headers that the Application Load Balancer should add to proxied * responses. */ customResponseHeaders?: string[]; /** * An optional textual description of the resource; provided by the client * when the resource is created. */ description?: string; /** * [Output Only] The resource URL for the edge security policy associated * with this backend bucket. */ edgeSecurityPolicy?: string; /** * If true, enable Cloud CDN for this BackendBucket. */ enableCdn?: boolean; /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: bigint; /** * Type of the resource. */ kind?: string; /** * Name 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. */ name?: string; /** * [Output Only] Server-defined URL for the resource. */ selfLink?: string; /** * [Output Only] List of resources referencing that backend bucket. */ usedBy?: BackendBucketUsedBy[]; } function serializeBackendBucket(data: any): BackendBucket { return { ...data, cdnPolicy: data["cdnPolicy"] !== undefined ? serializeBackendBucketCdnPolicy(data["cdnPolicy"]) : undefined, id: data["id"] !== undefined ? String(data["id"]) : undefined, }; } function deserializeBackendBucket(data: any): BackendBucket { return { ...data, cdnPolicy: data["cdnPolicy"] !== undefined ? deserializeBackendBucketCdnPolicy(data["cdnPolicy"]) : undefined, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, }; } /** * Message containing Cloud CDN configuration for a backend bucket. */ export interface BackendBucketCdnPolicy { /** * Bypass the cache when the specified request headers are matched - e.g. * Pragma or Authorization headers. Up to 5 headers can be specified. The * cache is bypassed for all cdnPolicy.cacheMode settings. */ bypassCacheOnRequestHeaders?: BackendBucketCdnPolicyBypassCacheOnRequestHeader[]; /** * The CacheKeyPolicy for this CdnPolicy. */ cacheKeyPolicy?: BackendBucketCdnPolicyCacheKeyPolicy; /** * Specifies the cache setting for all responses from this backend. The * possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid * caching headers to cache content. Responses without these headers will not * be cached at Google's edge, and will require a full trip to the origin on * every request, potentially impacting performance and increasing load on the * origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", * "no-store" or "no-cache" directives in Cache-Control response headers. * Warning: this may result in Cloud CDN caching private, per-user (user * identifiable) content. CACHE_ALL_STATIC Automatically cache static content, * including common image formats, media (video and audio), and web assets * (JavaScript and CSS). Requests and responses that are marked as * uncacheable, as well as dynamic content (including HTML), will not be * cached. */ cacheMode?: | "CACHE_ALL_STATIC" | "FORCE_CACHE_ALL" | "INVALID_CACHE_MODE" | "USE_ORIGIN_HEADERS"; /** * Specifies a separate client (e.g. browser client) maximum TTL. This is * used to clamp the max-age (or Expires) value sent to the client. With * FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the * response max-age directive, along with a "public" directive. For cacheable * content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the * origin (if specified), or else sets the response max-age directive to the * lesser of the client_ttl and default_ttl, and also ensures a "public" * cache-control directive is present. If a client TTL is not specified, a * default value (1 hour) will be used. The maximum allowed value is * 31,622,400s (1 year). */ clientTtl?: number; /** * Specifies the default TTL for cached content served by this origin for * responses that do not have an existing valid TTL (max-age or s-max-age). * Setting a TTL of "0" means "always revalidate". The value of defaultTTL * cannot be set to a value greater than that of maxTTL, but can be equal. * When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite * the TTL set in all responses. The maximum allowed value is 31,622,400s (1 * year), noting that infrequently accessed objects may be evicted from the * cache before the defined TTL. */ defaultTtl?: number; /** * Specifies the maximum allowed TTL for cached content served by this * origin. Cache directives that attempt to set a max-age or s-maxage higher * than this, or an Expires header more than maxTTL seconds in the future will * be capped at the value of maxTTL, as if it were the value of an s-maxage * Cache-Control directive. Headers sent to the client will not be modified. * Setting a TTL of "0" means "always revalidate". The maximum allowed value * is 31,622,400s (1 year), noting that infrequently accessed objects may be * evicted from the cache before the defined TTL. */ maxTtl?: number; /** * Negative caching allows per-status code TTLs to be set, in order to apply * fine-grained caching for common errors or redirects. This can reduce the * load on your origin and improve end-user experience by reducing response * latency. When the cache mode is set to CACHE_ALL_STATIC or * USE_ORIGIN_HEADERS, negative caching applies to responses with the * specified response code that lack any Cache-Control, Expires, or Pragma: * no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, * negative caching applies to all responses with the specified response code, * and override any caching headers. By default, Cloud CDN will apply the * following default TTLs to these status codes: HTTP 300 (Multiple Choice), * 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 * (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 * (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be * overridden in negative_caching_policy. */ negativeCaching?: boolean; /** * Sets a cache TTL for the specified HTTP status code. negative_caching must * be enabled to configure negative_caching_policy. Omitting the policy and * leaving negative_caching enabled will use Cloud CDN's default cache TTLs. * Note that when specifying an explicit negative_caching_policy, you should * take care to specify a cache TTL for all response codes that you wish to * cache. Cloud CDN will not apply any default negative caching when a policy * exists. */ negativeCachingPolicy?: BackendBucketCdnPolicyNegativeCachingPolicy[]; /** * If true then Cloud CDN will combine multiple concurrent cache fill * requests into a small number of requests to the origin. */ requestCoalescing?: boolean; /** * Serve existing content from the cache (if available) when revalidating * content with the origin, or when an error is encountered when refreshing * the cache. This setting defines the default "max-stale" duration for any * cached responses that do not specify a max-stale directive. Stale responses * that exceed the TTL configured here will not be served. The default limit * (max-stale) is 86400s (1 day), which will allow stale content to be served * up to this limit beyond the max-age (or s-max-age) of a cached response. * The maximum allowed value is 604800 (1 week). Set this to zero (0) to * disable serve-while-stale. */ serveWhileStale?: number; /** * Maximum number of seconds the response to a signed URL request will be * considered fresh. After this time period, the response will be revalidated * before being served. Defaults to 1hr (3600s). When serving responses to * signed URL requests, Cloud CDN will internally behave as though all * responses from this backend had a "Cache-Control: public, max-age=[TTL]" * header, regardless of any existing Cache-Control header. The actual headers * served in responses will not be altered. */ signedUrlCacheMaxAgeSec?: bigint; /** * [Output Only] Names of the keys for signing request URLs. */ signedUrlKeyNames?: string[]; } function serializeBackendBucketCdnPolicy(data: any): BackendBucketCdnPolicy { return { ...data, signedUrlCacheMaxAgeSec: data["signedUrlCacheMaxAgeSec"] !== undefined ? String(data["signedUrlCacheMaxAgeSec"]) : undefined, }; } function deserializeBackendBucketCdnPolicy(data: any): BackendBucketCdnPolicy { return { ...data, signedUrlCacheMaxAgeSec: data["signedUrlCacheMaxAgeSec"] !== undefined ? BigInt(data["signedUrlCacheMaxAgeSec"]) : undefined, }; } /** * Bypass the cache when the specified request headers are present, e.g. Pragma * or Authorization headers. Values are case insensitive. The presence of such a * header overrides the cache_mode setting. */ export interface BackendBucketCdnPolicyBypassCacheOnRequestHeader { /** * The header field name to match on when bypassing cache. Values are * case-insensitive. */ headerName?: string; } /** * Message containing what to include in the cache key for a request for Cloud * CDN. */ export interface BackendBucketCdnPolicyCacheKeyPolicy { /** * Allows HTTP request headers (by name) to be used in the cache key. */ includeHttpHeaders?: string[]; /** * Names of query string parameters to include in cache keys. Default * parameters are always included. '&' and '=' will be percent encoded and not * treated as delimiters. */ queryStringWhitelist?: string[]; } /** * Specify CDN TTLs for response error codes. */ export interface BackendBucketCdnPolicyNegativeCachingPolicy { /** * The HTTP status code to define a TTL against. Only HTTP status codes 300, * 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as * values, and you cannot specify a status code more than once. */ code?: number; /** * The TTL (in seconds) for which to cache responses with the corresponding * status code. The maximum allowed value is 1800s (30 minutes), noting that * infrequently accessed objects may be evicted from the cache before the * defined TTL. */ ttl?: number; } /** * Contains a list of BackendBucket resources. */ export interface BackendBucketList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of BackendBucket resources. */ items?: BackendBucket[]; /** * Type of resource. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeBackendBucketList(data: any): BackendBucketList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeBackendBucket(item))) : undefined, }; } function deserializeBackendBucketList(data: any): BackendBucketList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeBackendBucket(item))) : undefined, }; } /** * Additional options for Compute#backendBucketsAddSignedUrlKey. */ export interface BackendBucketsAddSignedUrlKeyOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendBucketsDelete. */ export interface BackendBucketsDeleteOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendBucketsDeleteSignedUrlKey. */ export interface BackendBucketsDeleteSignedUrlKeyOptions { /** * The name of the Signed URL Key to delete. */ keyName: string; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendBucketsGetIamPolicy. */ export interface BackendBucketsGetIamPolicyOptions { /** * Requested IAM Policy version. */ optionsRequestedPolicyVersion?: number; } /** * Additional options for Compute#backendBucketsInsert. */ export interface BackendBucketsInsertOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendBucketsList. */ export interface BackendBucketsListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } /** * Additional options for Compute#backendBucketsPatch. */ export interface BackendBucketsPatchOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendBucketsSetEdgeSecurityPolicy. */ export interface BackendBucketsSetEdgeSecurityPolicyOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendBucketsUpdate. */ export interface BackendBucketsUpdateOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface BackendBucketUsedBy { /** * [Output Only] Server-defined URL for UrlMaps referencing that * BackendBucket. */ reference?: string; } /** * Represents a Backend Service resource. A backend service defines how Google * Cloud load balancers distribute traffic. The backend service configuration * contains a set of values, such as the protocol used to connect to backends, * various distribution and session settings, health checks, and timeouts. These * settings provide fine-grained control over how your load balancer behaves. * Most of the settings have default values that allow for easy configuration if * you need to get started quickly. Backend services in Google Compute Engine * can be either regionally or globally scoped. * * [Global](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) * * * [Regional](https://cloud.google.com/compute/docs/reference/rest/v1/regionBackendServices) * For more information, see Backend Services. */ export interface BackendService { /** * Lifetime of cookies in seconds. This setting is applicable to Application * Load Balancers and Traffic Director and requires GENERATED_COOKIE or * HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and * lasts only until the end of the browser session (or equivalent). The * maximum allowed value is two weeks (1,209,600). Not supported when the * backend service is referenced by a URL map that is bound to target gRPC * proxy that has validateForProxyless field set to true. */ affinityCookieTtlSec?: number; /** * The list of backends that serve this BackendService. */ backends?: Backend[]; /** * Cloud CDN configuration for this BackendService. Only available for * specified load balancer types. */ cdnPolicy?: BackendServiceCdnPolicy; circuitBreakers?: CircuitBreakers; /** * Compress text responses using Brotli or gzip compression, based on the * client's Accept-Encoding header. */ compressionMode?: | "AUTOMATIC" | "DISABLED"; connectionDraining?: ConnectionDraining; /** * Connection Tracking configuration for this BackendService. Connection * tracking policy settings are only available for external passthrough * Network Load Balancers and internal passthrough Network Load Balancers. */ connectionTrackingPolicy?: BackendServiceConnectionTrackingPolicy; /** * Consistent Hash-based load balancing can be used to provide soft session * affinity based on HTTP headers, cookies or other properties. This load * balancing policy is applicable only for HTTP connections. The affinity to a * particular destination host will be lost when one or more hosts are * added/removed from the destination service. This field specifies parameters * that control consistent hashing. This field is only applicable when * localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to * either: - A regional backend service with the service_protocol set to HTTP, * HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A * global backend service with the load_balancing_scheme set to * INTERNAL_SELF_MANAGED. */ consistentHash?: ConsistentHashLoadBalancerSettings; /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * Headers that the load balancer adds to proxied requests. See [Creating * custom * headers](https://cloud.google.com/load-balancing/docs/custom-headers). */ customRequestHeaders?: string[]; /** * Headers that the load balancer adds to proxied responses. See [Creating * custom * headers](https://cloud.google.com/load-balancing/docs/custom-headers). */ customResponseHeaders?: string[]; /** * An optional description of this resource. Provide this property when you * create the resource. */ description?: string; /** * [Output Only] The resource URL for the edge security policy associated * with this backend service. */ edgeSecurityPolicy?: string; /** * If true, enables Cloud CDN for the backend service of a global external * Application Load Balancer. */ enableCDN?: boolean; /** * Requires at least one backend instance group to be defined as a backup * (failover) backend. For load balancers that have configurable failover: * [Internal passthrough Network Load * Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) * and [external passthrough Network Load * Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). */ failoverPolicy?: BackendServiceFailoverPolicy; /** * Fingerprint of this resource. A hash of the contents stored in this * object. This field is used in optimistic locking. This field will be * ignored when inserting a BackendService. An up-to-date fingerprint must be * provided in order to update the BackendService, otherwise the request will * fail with error 412 conditionNotMet. To see the latest fingerprint, make a * get() request to retrieve a BackendService. */ fingerprint?: Uint8Array; /** * The list of URLs to the healthChecks, httpHealthChecks (legacy), or * httpsHealthChecks (legacy) resource for health checking this backend * service. Not all backend services support legacy health checks. See Load * balancer guide. Currently, at most one health check can be specified for * each backend service. Backend services with instance group or zonal NEG * backends must have a health check. Backend services with internet or * serverless NEG backends must not have a health check. */ healthChecks?: string[]; /** * The configurations for Identity-Aware Proxy on this resource. Not * available for internal passthrough Network Load Balancers and external * passthrough Network Load Balancers. */ iap?: BackendServiceIAP; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * Specifies a preference for traffic sent from the proxy to the backend (or * from the client to the backend for proxyless gRPC). The possible values * are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend * service (Instance Group, Managed Instance Group, Network Endpoint Group), * regardless of traffic from the client to the proxy. Only IPv4 health checks * are used to check the health of the backends. This is the default setting. * - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address * over its IPv4 address (provided there is a healthy IPv6 address). - * IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service * (Instance Group, Managed Instance Group, Network Endpoint Group), * regardless of traffic from the client to the proxy. Only IPv6 health checks * are used to check the health of the backends. This field is applicable to * either: - Advanced global external Application Load Balancer (load * balancing scheme EXTERNAL_MANAGED), - Regional external Application Load * Balancer, - Internal proxy Network Load Balancer (load balancing scheme * INTERNAL_MANAGED), - Regional internal Application Load Balancer (load * balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies * and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). */ ipAddressSelectionPolicy?: | "IPV4_ONLY" | "IPV6_ONLY" | "IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED" | "PREFER_IPV6"; /** * [Output Only] Type of resource. Always compute#backendService for backend * services. */ kind?: string; /** * Specifies the load balancer type. A backend service created for one type * of load balancer cannot be used with another. For more information, refer * to Choosing a load balancer. */ loadBalancingScheme?: | "EXTERNAL" | "EXTERNAL_MANAGED" | "INTERNAL" | "INTERNAL_MANAGED" | "INTERNAL_SELF_MANAGED" | "INVALID_LOAD_BALANCING_SCHEME"; /** * A list of locality load-balancing policies to be used in order of * preference. When you use localityLbPolicies, you must set at least one * value for either the localityLbPolicies[].policy or the * localityLbPolicies[].customPolicy field. localityLbPolicies overrides any * value set in the localityLbPolicy field. For an example of how to use this * field, see Define a list of preferred policies. Caution: This field and its * children are intended for use in a service mesh that includes gRPC clients * only. Envoy proxies can't use backend services that have this * configuration. */ localityLbPolicies?: BackendServiceLocalityLoadBalancingPolicyConfig[]; /** * The load balancing algorithm used within the scope of the locality. The * possible values are: - ROUND_ROBIN: This is a simple policy in which each * healthy backend is selected in round robin order. This is the default. - * LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and * picks the host which has fewer active requests. - RING_HASH: The * ring/modulo hash load balancer implements consistent hashing to backends. * The algorithm has the property that the addition/removal of a host from a * set of N hosts only affects 1/N of the requests. - RANDOM: The load * balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend * host is selected based on the client connection metadata, i.e., connections * are opened to the same address as the destination address of the incoming * connection before the connection was redirected to the load balancer. - * MAGLEV: used as a drop in replacement for the ring hash load balancer. * Maglev is not as stable as ring hash but has faster table lookup build * times and host selection times. For more information about Maglev, see * https://ai.google/research/pubs/pub44824 This field is applicable to * either: - A regional backend service with the service_protocol set to HTTP, * HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A * global backend service with the load_balancing_scheme set to * INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If * sessionAffinity is not configured—that is, if session affinity remains at * the default value of NONE—then the default value for localityLbPolicy is * ROUND_ROBIN. If session affinity is set to a value other than NONE, then * the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and * RING_HASH are supported when the backend service is referenced by a URL map * that is bound to target gRPC proxy that has validateForProxyless field set * to true. */ localityLbPolicy?: | "INVALID_LB_POLICY" | "LEAST_REQUEST" | "MAGLEV" | "ORIGINAL_DESTINATION" | "RANDOM" | "RING_HASH" | "ROUND_ROBIN" | "WEIGHTED_MAGLEV"; /** * This field denotes the logging options for the load balancer traffic * served by this backend service. If logging is enabled, logs will be * exported to Stackdriver. */ logConfig?: BackendServiceLogConfig; /** * Specifies the default maximum duration (timeout) for streams to this * service. Duration is computed from the beginning of the stream until the * response has been completely processed, including all retries. A stream * that does not complete in this duration is closed. If not specified, there * will be no timeout limit, i.e. the maximum duration is infinite. This value * can be overridden in the PathMatcher configuration of the UrlMap that * references this backend service. This field is only allowed when the * loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. */ maxStreamDuration?: Duration; /** * Deployment metadata associated with the resource to be set by a GKE hub * controller and read by the backend RCTH */ metadatas?: { [key: string]: string }; /** * Name 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. */ name?: string; /** * The URL of the network to which this backend service belongs. This field * can only be specified when the load balancing scheme is set to INTERNAL. */ network?: string; /** * Settings controlling the ejection of unhealthy backend endpoints from the * load balancing pool of each individual proxy instance that processes the * traffic for the given backend service. If not set, this feature is * considered disabled. Results of the outlier detection algorithm (ejection * of endpoints from the load balancing pool and returning them back to the * pool) are executed independently by each proxy instance of the load * balancer. In most cases, more than one proxy instance handles the traffic * received by a backend service. Thus, it is possible that an unhealthy * endpoint is detected and ejected by only some of the proxies, and while * this happens, other proxies may continue to send requests to the same * unhealthy endpoint until they detect and eject the unhealthy endpoint. * Applicable backend endpoints can be: - VM instances in an Instance Group - * Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a * Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that * resolve to Cloud Run, App Engine, or Cloud Functions Services - Private * Service Connect NEGs, that resolve to Google-managed regional API endpoints * or managed services published using Private Service Connect Applicable * backend service types can be: - A global backend service with the * loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A * regional backend service with the serviceProtocol set to HTTP, HTTPS, or * HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. * Not supported for Serverless NEGs. Not supported when the backend service * is referenced by a URL map that is bound to target gRPC proxy that has * validateForProxyless field set to true. */ outlierDetection?: OutlierDetection; /** * Deprecated in favor of portName. The TCP port to connect on the backend. * The default value is 80. For internal passthrough Network Load Balancers * and external passthrough Network Load Balancers, omit port. */ port?: number; /** * A named port on a backend instance group representing the port for * communication to the backend VMs in that group. The named port must be * [defined on each backend instance * group](https://cloud.google.com/load-balancing/docs/backend-service#named_ports). * This parameter has no meaning if the backends are NEGs. For internal * passthrough Network Load Balancers and external passthrough Network Load * Balancers, omit port_name. */ portName?: string; /** * The protocol this BackendService uses to communicate with backends. * Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on * the chosen load balancer or Traffic Director configuration. Refer to the * documentation for the load balancers or for Traffic Director for more * information. Must be set to GRPC when the backend service is referenced by * a URL map that is bound to target gRPC proxy. */ protocol?: | "GRPC" | "HTTP" | "HTTP2" | "HTTPS" | "SSL" | "TCP" | "UDP" | "UNSPECIFIED"; /** * [Output Only] URL of the region where the regional backend service * resides. This field is not applicable to global backend services. You must * specify this field as part of the HTTP request URL. It is not settable as a * field in the request body. */ region?: string; /** * [Output Only] The resource URL for the security policy associated with * this backend service. */ securityPolicy?: string; /** * This field specifies the security settings that apply to this backend * service. This field is applicable to a global backend service with the * load_balancing_scheme set to INTERNAL_SELF_MANAGED. */ securitySettings?: SecuritySettings; /** * [Output Only] Server-defined URL for the resource. */ selfLink?: string; /** * URLs of networkservices.ServiceBinding resources. Can only be set if load * balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and * health checks must be both empty. */ serviceBindings?: string[]; /** * URL to networkservices.ServiceLbPolicy resource. Can only be set if load * balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or * INTERNAL_SELF_MANAGED and the scope is global. */ serviceLbPolicy?: string; /** * Type of session affinity to use. The default is NONE. Only NONE and * HEADER_FIELD are supported when the backend service is referenced by a URL * map that is bound to target gRPC proxy that has validateForProxyless field * set to true. For more details, see: [Session * Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity). */ sessionAffinity?: | "CLIENT_IP" | "CLIENT_IP_NO_DESTINATION" | "CLIENT_IP_PORT_PROTO" | "CLIENT_IP_PROTO" | "GENERATED_COOKIE" | "HEADER_FIELD" | "HTTP_COOKIE" | "NONE" | "STRONG_COOKIE_AFFINITY"; /** * Describes the HTTP cookie used for stateful session affinity. This field * is applicable and required if the sessionAffinity is set to * STRONG_COOKIE_AFFINITY. */ strongSessionAffinityCookie?: BackendServiceHttpCookie; subsetting?: Subsetting; /** * The backend service timeout has a different meaning depending on the type * of load balancer. For more information see, Backend service settings. The * default is 30 seconds. The full range of timeout values allowed goes from 1 * through 2,147,483,647 seconds. This value can be overridden in the * PathMatcher configuration of the UrlMap that references this backend * service. Not supported when the backend service is referenced by a URL map * that is bound to target gRPC proxy that has validateForProxyless field set * to true. Instead, use maxStreamDuration. */ timeoutSec?: number; /** * [Output Only] List of resources referencing given backend service. */ usedBy?: BackendServiceUsedBy[]; } function serializeBackendService(data: any): BackendService { return { ...data, cdnPolicy: data["cdnPolicy"] !== undefined ? serializeBackendServiceCdnPolicy(data["cdnPolicy"]) : undefined, consistentHash: data["consistentHash"] !== undefined ? serializeConsistentHashLoadBalancerSettings(data["consistentHash"]) : undefined, fingerprint: data["fingerprint"] !== undefined ? encodeBase64(data["fingerprint"]) : undefined, id: data["id"] !== undefined ? String(data["id"]) : undefined, maxStreamDuration: data["maxStreamDuration"] !== undefined ? serializeDuration(data["maxStreamDuration"]) : undefined, outlierDetection: data["outlierDetection"] !== undefined ? serializeOutlierDetection(data["outlierDetection"]) : undefined, strongSessionAffinityCookie: data["strongSessionAffinityCookie"] !== undefined ? serializeBackendServiceHttpCookie(data["strongSessionAffinityCookie"]) : undefined, }; } function deserializeBackendService(data: any): BackendService { return { ...data, cdnPolicy: data["cdnPolicy"] !== undefined ? deserializeBackendServiceCdnPolicy(data["cdnPolicy"]) : undefined, consistentHash: data["consistentHash"] !== undefined ? deserializeConsistentHashLoadBalancerSettings(data["consistentHash"]) : undefined, fingerprint: data["fingerprint"] !== undefined ? decodeBase64(data["fingerprint"] as string) : undefined, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, maxStreamDuration: data["maxStreamDuration"] !== undefined ? deserializeDuration(data["maxStreamDuration"]) : undefined, outlierDetection: data["outlierDetection"] !== undefined ? deserializeOutlierDetection(data["outlierDetection"]) : undefined, strongSessionAffinityCookie: data["strongSessionAffinityCookie"] !== undefined ? deserializeBackendServiceHttpCookie(data["strongSessionAffinityCookie"]) : undefined, }; } /** * Contains a list of BackendServicesScopedList. */ export interface BackendServiceAggregatedList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of BackendServicesScopedList resources. */ items?: { [key: string]: BackendServicesScopedList }; /** * Type of resource. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Unreachable resources. */ unreachables?: string[]; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeBackendServiceAggregatedList(data: any): BackendServiceAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, serializeBackendServicesScopedList(v)]))) : undefined, }; } function deserializeBackendServiceAggregatedList(data: any): BackendServiceAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, deserializeBackendServicesScopedList(v)]))) : undefined, }; } /** * Message containing Cloud CDN configuration for a backend service. */ export interface BackendServiceCdnPolicy { /** * Bypass the cache when the specified request headers are matched - e.g. * Pragma or Authorization headers. Up to 5 headers can be specified. The * cache is bypassed for all cdnPolicy.cacheMode settings. */ bypassCacheOnRequestHeaders?: BackendServiceCdnPolicyBypassCacheOnRequestHeader[]; /** * The CacheKeyPolicy for this CdnPolicy. */ cacheKeyPolicy?: CacheKeyPolicy; /** * Specifies the cache setting for all responses from this backend. The * possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid * caching headers to cache content. Responses without these headers will not * be cached at Google's edge, and will require a full trip to the origin on * every request, potentially impacting performance and increasing load on the * origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", * "no-store" or "no-cache" directives in Cache-Control response headers. * Warning: this may result in Cloud CDN caching private, per-user (user * identifiable) content. CACHE_ALL_STATIC Automatically cache static content, * including common image formats, media (video and audio), and web assets * (JavaScript and CSS). Requests and responses that are marked as * uncacheable, as well as dynamic content (including HTML), will not be * cached. */ cacheMode?: | "CACHE_ALL_STATIC" | "FORCE_CACHE_ALL" | "INVALID_CACHE_MODE" | "USE_ORIGIN_HEADERS"; /** * Specifies a separate client (e.g. browser client) maximum TTL. This is * used to clamp the max-age (or Expires) value sent to the client. With * FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the * response max-age directive, along with a "public" directive. For cacheable * content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the * origin (if specified), or else sets the response max-age directive to the * lesser of the client_ttl and default_ttl, and also ensures a "public" * cache-control directive is present. If a client TTL is not specified, a * default value (1 hour) will be used. The maximum allowed value is * 31,622,400s (1 year). */ clientTtl?: number; /** * Specifies the default TTL for cached content served by this origin for * responses that do not have an existing valid TTL (max-age or s-max-age). * Setting a TTL of "0" means "always revalidate". The value of defaultTTL * cannot be set to a value greater than that of maxTTL, but can be equal. * When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite * the TTL set in all responses. The maximum allowed value is 31,622,400s (1 * year), noting that infrequently accessed objects may be evicted from the * cache before the defined TTL. */ defaultTtl?: number; /** * Specifies the maximum allowed TTL for cached content served by this * origin. Cache directives that attempt to set a max-age or s-maxage higher * than this, or an Expires header more than maxTTL seconds in the future will * be capped at the value of maxTTL, as if it were the value of an s-maxage * Cache-Control directive. Headers sent to the client will not be modified. * Setting a TTL of "0" means "always revalidate". The maximum allowed value * is 31,622,400s (1 year), noting that infrequently accessed objects may be * evicted from the cache before the defined TTL. */ maxTtl?: number; /** * Negative caching allows per-status code TTLs to be set, in order to apply * fine-grained caching for common errors or redirects. This can reduce the * load on your origin and improve end-user experience by reducing response * latency. When the cache mode is set to CACHE_ALL_STATIC or * USE_ORIGIN_HEADERS, negative caching applies to responses with the * specified response code that lack any Cache-Control, Expires, or Pragma: * no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, * negative caching applies to all responses with the specified response code, * and override any caching headers. By default, Cloud CDN will apply the * following default TTLs to these status codes: HTTP 300 (Multiple Choice), * 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 * (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 * (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be * overridden in negative_caching_policy. */ negativeCaching?: boolean; /** * Sets a cache TTL for the specified HTTP status code. negative_caching must * be enabled to configure negative_caching_policy. Omitting the policy and * leaving negative_caching enabled will use Cloud CDN's default cache TTLs. * Note that when specifying an explicit negative_caching_policy, you should * take care to specify a cache TTL for all response codes that you wish to * cache. Cloud CDN will not apply any default negative caching when a policy * exists. */ negativeCachingPolicy?: BackendServiceCdnPolicyNegativeCachingPolicy[]; /** * If true then Cloud CDN will combine multiple concurrent cache fill * requests into a small number of requests to the origin. */ requestCoalescing?: boolean; /** * Serve existing content from the cache (if available) when revalidating * content with the origin, or when an error is encountered when refreshing * the cache. This setting defines the default "max-stale" duration for any * cached responses that do not specify a max-stale directive. Stale responses * that exceed the TTL configured here will not be served. The default limit * (max-stale) is 86400s (1 day), which will allow stale content to be served * up to this limit beyond the max-age (or s-max-age) of a cached response. * The maximum allowed value is 604800 (1 week). Set this to zero (0) to * disable serve-while-stale. */ serveWhileStale?: number; /** * Maximum number of seconds the response to a signed URL request will be * considered fresh. After this time period, the response will be revalidated * before being served. Defaults to 1hr (3600s). When serving responses to * signed URL requests, Cloud CDN will internally behave as though all * responses from this backend had a "Cache-Control: public, max-age=[TTL]" * header, regardless of any existing Cache-Control header. The actual headers * served in responses will not be altered. */ signedUrlCacheMaxAgeSec?: bigint; /** * [Output Only] Names of the keys for signing request URLs. */ signedUrlKeyNames?: string[]; } function serializeBackendServiceCdnPolicy(data: any): BackendServiceCdnPolicy { return { ...data, signedUrlCacheMaxAgeSec: data["signedUrlCacheMaxAgeSec"] !== undefined ? String(data["signedUrlCacheMaxAgeSec"]) : undefined, }; } function deserializeBackendServiceCdnPolicy(data: any): BackendServiceCdnPolicy { return { ...data, signedUrlCacheMaxAgeSec: data["signedUrlCacheMaxAgeSec"] !== undefined ? BigInt(data["signedUrlCacheMaxAgeSec"]) : undefined, }; } /** * Bypass the cache when the specified request headers are present, e.g. Pragma * or Authorization headers. Values are case insensitive. The presence of such a * header overrides the cache_mode setting. */ export interface BackendServiceCdnPolicyBypassCacheOnRequestHeader { /** * The header field name to match on when bypassing cache. Values are * case-insensitive. */ headerName?: string; } /** * Specify CDN TTLs for response error codes. */ export interface BackendServiceCdnPolicyNegativeCachingPolicy { /** * The HTTP status code to define a TTL against. Only HTTP status codes 300, * 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as * values, and you cannot specify a status code more than once. */ code?: number; /** * The TTL (in seconds) for which to cache responses with the corresponding * status code. The maximum allowed value is 1800s (30 minutes), noting that * infrequently accessed objects may be evicted from the cache before the * defined TTL. */ ttl?: number; } /** * Connection Tracking configuration for this BackendService. */ export interface BackendServiceConnectionTrackingPolicy { /** * Specifies connection persistence when backends are unhealthy. The default * value is DEFAULT_FOR_PROTOCOL. If set to DEFAULT_FOR_PROTOCOL, the existing * connections persist on unhealthy backends only for connection-oriented * protocols (TCP and SCTP) and only if the Tracking Mode is PER_CONNECTION * (default tracking mode) or the Session Affinity is configured for 5-tuple. * They do not persist for UDP. If set to NEVER_PERSIST, after a backend * becomes unhealthy, the existing connections on the unhealthy backend are * never persisted on the unhealthy backend. They are always diverted to newly * selected healthy backends (unless all backends are unhealthy). If set to * ALWAYS_PERSIST, existing connections always persist on unhealthy backends * regardless of protocol and session affinity. It is generally not * recommended to use this mode overriding the default. For more details, see * [Connection Persistence for Network Load * Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence) * and [Connection Persistence for Internal TCP/UDP Load * Balancing](https://cloud.google.com/load-balancing/docs/internal#connection-persistence). */ connectionPersistenceOnUnhealthyBackends?: | "ALWAYS_PERSIST" | "DEFAULT_FOR_PROTOCOL" | "NEVER_PERSIST"; /** * Enable Strong Session Affinity for external passthrough Network Load * Balancers. This option is not available publicly. */ enableStrongAffinity?: boolean; /** * Specifies how long to keep a Connection Tracking entry while there is no * matching traffic (in seconds). For internal passthrough Network Load * Balancers: - The minimum (default) is 10 minutes and the maximum is 16 * hours. - It can be set only if Connection Tracking is less than 5-tuple * (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION, CLIENT_IP or * CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION). For external * passthrough Network Load Balancers the default is 60 seconds. This option * is not available publicly. */ idleTimeoutSec?: number; /** * Specifies the key used for connection tracking. There are two options: - * PER_CONNECTION: This is the default mode. The Connection Tracking is * performed as per the Connection Key (default Hash Method) for the specific * protocol. - PER_SESSION: The Connection Tracking is performed as per the * configured Session Affinity. It matches the configured Session Affinity. * For more details, see [Tracking Mode for Network Load * Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#tracking-mode) * and [Tracking Mode for Internal TCP/UDP Load * Balancing](https://cloud.google.com/load-balancing/docs/internal#tracking-mode). */ trackingMode?: | "INVALID_TRACKING_MODE" | "PER_CONNECTION" | "PER_SESSION"; } /** * For load balancers that have configurable failover: [Internal passthrough * Network Load * Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) * and [external passthrough Network Load * Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). * On failover or failback, this field indicates whether connection draining * will be honored. Google Cloud has a fixed connection draining timeout of 10 * minutes. A setting of true terminates existing TCP connections to the active * pool during failover and failback, immediately draining traffic. A setting of * false allows existing TCP connections to persist, even on VMs no longer in * the active pool, for up to the duration of the connection draining timeout * (10 minutes). */ export interface BackendServiceFailoverPolicy { /** * This can be set to true only if the protocol is TCP. The default is false. */ disableConnectionDrainOnFailover?: boolean; /** * If set to true, connections to the load balancer are dropped when all * primary and all backup backend VMs are unhealthy.If set to false, * connections are distributed among all primary VMs when all primary and all * backup backend VMs are unhealthy. For load balancers that have configurable * failover: [Internal passthrough Network Load * Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) * and [external passthrough Network Load * Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). * The default is false. */ dropTrafficIfUnhealthy?: boolean; /** * The value of the field must be in the range [0, 1]. If the value is 0, the * load balancer performs a failover when the number of healthy primary VMs * equals zero. For all other values, the load balancer performs a failover * when the total number of healthy primary VMs is less than this ratio. For * load balancers that have configurable failover: [Internal TCP/UDP Load * Balancing](https://cloud.google.com/load-balancing/docs/internal/failover-overview) * and [external TCP/UDP Load * Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). */ failoverRatio?: number; } export interface BackendServiceGroupHealth { /** * Metadata defined as annotations on the network endpoint group. */ annotations?: { [key: string]: string }; /** * Health state of the backend instances or endpoints in requested instance * or network endpoint group, determined based on configured health checks. */ healthStatus?: HealthStatus[]; /** * [Output Only] Type of resource. Always compute#backendServiceGroupHealth * for the health of backend services. */ kind?: string; } /** * The HTTP cookie used for stateful session affinity. */ export interface BackendServiceHttpCookie { /** * Name of the cookie. */ name?: string; /** * Path to set for the cookie. */ path?: string; /** * Lifetime of the cookie. */ ttl?: Duration; } function serializeBackendServiceHttpCookie(data: any): BackendServiceHttpCookie { return { ...data, ttl: data["ttl"] !== undefined ? serializeDuration(data["ttl"]) : undefined, }; } function deserializeBackendServiceHttpCookie(data: any): BackendServiceHttpCookie { return { ...data, ttl: data["ttl"] !== undefined ? deserializeDuration(data["ttl"]) : undefined, }; } /** * Identity-Aware Proxy */ export interface BackendServiceIAP { /** * Whether the serving infrastructure will authenticate and authorize all * incoming requests. */ enabled?: boolean; /** * OAuth2 client ID to use for the authentication flow. */ oauth2ClientId?: string; /** * OAuth2 client secret to use for the authentication flow. For security * reasons, this value cannot be retrieved via the API. Instead, the SHA-256 * hash of the value is returned in the oauth2ClientSecretSha256 field. * @InputOnly */ oauth2ClientSecret?: string; /** * [Output Only] SHA256 hash value for the field oauth2_client_secret above. */ oauth2ClientSecretSha256?: string; } /** * Contains a list of BackendService resources. */ export interface BackendServiceList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of BackendService resources. */ items?: BackendService[]; /** * [Output Only] Type of resource. Always compute#backendServiceList for * lists of backend services. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeBackendServiceList(data: any): BackendServiceList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeBackendService(item))) : undefined, }; } function deserializeBackendServiceList(data: any): BackendServiceList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeBackendService(item))) : undefined, }; } /** * Contains a list of usable BackendService resources. */ export interface BackendServiceListUsable { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of BackendService resources. */ items?: BackendService[]; /** * [Output Only] Type of resource. Always compute#usableBackendServiceList * for lists of usable backend services. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeBackendServiceListUsable(data: any): BackendServiceListUsable { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeBackendService(item))) : undefined, }; } function deserializeBackendServiceListUsable(data: any): BackendServiceListUsable { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeBackendService(item))) : undefined, }; } /** * Container for either a built-in LB policy supported by gRPC or Envoy or a * custom one implemented by the end user. */ export interface BackendServiceLocalityLoadBalancingPolicyConfig { customPolicy?: BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy; policy?: BackendServiceLocalityLoadBalancingPolicyConfigPolicy; } /** * The configuration for a custom policy implemented by the user and deployed * with the client. */ export interface BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy { /** * An optional, arbitrary JSON object with configuration data, understood by * a locally installed custom policy implementation. */ data?: string; /** * Identifies the custom policy. The value should match the name of a custom * implementation registered on the gRPC clients. It should follow protocol * buffer message naming conventions and include the full path (for example, * myorg.CustomLbPolicy). The maximum length is 256 characters. Do not specify * the same custom policy more than once for a backend. If you do, the * configuration is rejected. For an example of how to use this field, see Use * a custom policy. */ name?: string; } /** * The configuration for a built-in load balancing policy. */ export interface BackendServiceLocalityLoadBalancingPolicyConfigPolicy { /** * The name of a locality load-balancing policy. Valid values include * ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about * these values, see the description of localityLbPolicy. Do not specify the * same policy more than once for a backend. If you do, the configuration is * rejected. */ name?: | "INVALID_LB_POLICY" | "LEAST_REQUEST" | "MAGLEV" | "ORIGINAL_DESTINATION" | "RANDOM" | "RING_HASH" | "ROUND_ROBIN" | "WEIGHTED_MAGLEV"; } /** * The available logging options for the load balancer traffic served by this * backend service. */ export interface BackendServiceLogConfig { /** * Denotes whether to enable logging for the load balancer traffic served by * this backend service. The default value is false. */ enable?: boolean; /** * This field can only be specified if logging is enabled for this backend * service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of * optional fields you want to include in the logs. For example: * serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace */ optionalFields?: string[]; /** * This field can only be specified if logging is enabled for this backend * service. Configures whether all, none or a subset of optional fields should * be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL, * EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL. */ optionalMode?: | "CUSTOM" | "EXCLUDE_ALL_OPTIONAL" | "INCLUDE_ALL_OPTIONAL"; /** * This field can only be specified if logging is enabled for this backend * service. The value of the field must be in [0, 1]. This configures the * sampling rate of requests to the load balancer where 1.0 means all logged * requests are reported and 0.0 means no logged requests are reported. The * default value is 1.0. */ sampleRate?: number; } export interface BackendServiceReference { backendService?: string; } /** * Additional options for Compute#backendServicesAddSignedUrlKey. */ export interface BackendServicesAddSignedUrlKeyOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendServicesAggregatedList. */ export interface BackendServicesAggregatedListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * Indicates whether every visible scope for each scope type (zone, region, * global) should be included in the response. For new resource types added * after this field, the flag has no effect as new resource types will always * include every visible scope for each scope type in response. For resource * types which predate this field, if this flag is omitted or false, only * scopes of the scope types where the resource type is expected to be found * will be included. */ includeAllScopes?: boolean; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; /** * The Shared VPC service project id or service project number for which * aggregated list request is invoked for subnetworks list-usable api. */ serviceProjectNumber?: bigint; } function serializeBackendServicesAggregatedListOptions(data: any): BackendServicesAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? String(data["serviceProjectNumber"]) : undefined, }; } function deserializeBackendServicesAggregatedListOptions(data: any): BackendServicesAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? BigInt(data["serviceProjectNumber"]) : undefined, }; } /** * Additional options for Compute#backendServicesDelete. */ export interface BackendServicesDeleteOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendServicesDeleteSignedUrlKey. */ export interface BackendServicesDeleteSignedUrlKeyOptions { /** * The name of the Signed URL Key to delete. */ keyName: string; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendServicesGetIamPolicy. */ export interface BackendServicesGetIamPolicyOptions { /** * Requested IAM Policy version. */ optionsRequestedPolicyVersion?: number; } /** * Additional options for Compute#backendServicesInsert. */ export interface BackendServicesInsertOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendServicesList. */ export interface BackendServicesListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } /** * Additional options for Compute#backendServicesListUsable. */ export interface BackendServicesListUsableOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } /** * Additional options for Compute#backendServicesPatch. */ export interface BackendServicesPatchOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface BackendServicesScopedList { /** * A list of BackendServices contained in this scope. */ backendServices?: BackendService[]; /** * Informational warning which replaces the list of backend services when the * list is empty. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeBackendServicesScopedList(data: any): BackendServicesScopedList { return { ...data, backendServices: data["backendServices"] !== undefined ? data["backendServices"].map((item: any) => (serializeBackendService(item))) : undefined, }; } function deserializeBackendServicesScopedList(data: any): BackendServicesScopedList { return { ...data, backendServices: data["backendServices"] !== undefined ? data["backendServices"].map((item: any) => (deserializeBackendService(item))) : undefined, }; } /** * Additional options for Compute#backendServicesSetEdgeSecurityPolicy. */ export interface BackendServicesSetEdgeSecurityPolicyOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendServicesSetSecurityPolicy. */ export interface BackendServicesSetSecurityPolicyOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#backendServicesUpdate. */ export interface BackendServicesUpdateOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface BackendServiceUsedBy { /** * [Output Only] Server-defined URL for resources referencing given * BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and * ForwardingRule. */ reference?: string; } export interface BfdPacket { /** * The Authentication Present bit of the BFD packet. This is specified in * section 4.1 of RFC5880 */ authenticationPresent?: boolean; /** * The Control Plane Independent bit of the BFD packet. This is specified in * section 4.1 of RFC5880 */ controlPlaneIndependent?: boolean; /** * The demand bit of the BFD packet. This is specified in section 4.1 of * RFC5880 */ demand?: boolean; /** * The diagnostic code specifies the local system's reason for the last * change in session state. This allows remote systems to determine the reason * that the previous session failed, for example. These diagnostic codes are * specified in section 4.1 of RFC5880 */ diagnostic?: | "ADMINISTRATIVELY_DOWN" | "CONCATENATED_PATH_DOWN" | "CONTROL_DETECTION_TIME_EXPIRED" | "DIAGNOSTIC_UNSPECIFIED" | "ECHO_FUNCTION_FAILED" | "FORWARDING_PLANE_RESET" | "NEIGHBOR_SIGNALED_SESSION_DOWN" | "NO_DIAGNOSTIC" | "PATH_DOWN" | "REVERSE_CONCATENATED_PATH_DOWN"; /** * The Final bit of the BFD packet. This is specified in section 4.1 of * RFC5880 */ final?: boolean; /** * The length of the BFD Control packet in bytes. This is specified in * section 4.1 of RFC5880 */ length?: number; /** * The Required Min Echo RX Interval value in the BFD packet. This is * specified in section 4.1 of RFC5880 */ minEchoRxIntervalMs?: number; /** * The Required Min RX Interval value in the BFD packet. This is specified in * section 4.1 of RFC5880 */ minRxIntervalMs?: number; /** * The Desired Min TX Interval value in the BFD packet. This is specified in * section 4.1 of RFC5880 */ minTxIntervalMs?: number; /** * The detection time multiplier of the BFD packet. This is specified in * section 4.1 of RFC5880 */ multiplier?: number; /** * The multipoint bit of the BFD packet. This is specified in section 4.1 of * RFC5880 */ multipoint?: boolean; /** * The My Discriminator value in the BFD packet. This is specified in section * 4.1 of RFC5880 */ myDiscriminator?: number; /** * The Poll bit of the BFD packet. This is specified in section 4.1 of * RFC5880 */ poll?: boolean; /** * The current BFD session state as seen by the transmitting system. These * states are specified in section 4.1 of RFC5880 */ state?: | "ADMIN_DOWN" | "DOWN" | "INIT" | "STATE_UNSPECIFIED" | "UP"; /** * The version number of the BFD protocol, as specified in section 4.1 of * RFC5880. */ version?: number; /** * The Your Discriminator value in the BFD packet. This is specified in * section 4.1 of RFC5880 */ yourDiscriminator?: number; } /** * Next free: 15 */ export interface BfdStatus { /** * The BFD session initialization mode for this BGP peer. If set to ACTIVE, * the Cloud Router will initiate the BFD session for this BGP peer. If set to * PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD * session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP * peer. */ bfdSessionInitializationMode?: | "ACTIVE" | "DISABLED" | "PASSIVE"; /** * Unix timestamp of the most recent config update. */ configUpdateTimestampMicros?: bigint; /** * Control packet counts for the current BFD session. */ controlPacketCounts?: BfdStatusPacketCounts; /** * Inter-packet time interval statistics for control packets. */ controlPacketIntervals?: PacketIntervals[]; /** * The diagnostic code specifies the local system's reason for the last * change in session state. This allows remote systems to determine the reason * that the previous session failed, for example. These diagnostic codes are * specified in section 4.1 of RFC5880 */ localDiagnostic?: | "ADMINISTRATIVELY_DOWN" | "CONCATENATED_PATH_DOWN" | "CONTROL_DETECTION_TIME_EXPIRED" | "DIAGNOSTIC_UNSPECIFIED" | "ECHO_FUNCTION_FAILED" | "FORWARDING_PLANE_RESET" | "NEIGHBOR_SIGNALED_SESSION_DOWN" | "NO_DIAGNOSTIC" | "PATH_DOWN" | "REVERSE_CONCATENATED_PATH_DOWN"; /** * The current BFD session state as seen by the transmitting system. These * states are specified in section 4.1 of RFC5880 */ localState?: | "ADMIN_DOWN" | "DOWN" | "INIT" | "STATE_UNSPECIFIED" | "UP"; /** * Negotiated transmit interval for control packets. */ negotiatedLocalControlTxIntervalMs?: number; /** * The most recent Rx control packet for this BFD session. */ rxPacket?: BfdPacket; /** * The most recent Tx control packet for this BFD session. */ txPacket?: BfdPacket; /** * Session uptime in milliseconds. Value will be 0 if session is not up. */ uptimeMs?: bigint; } function serializeBfdStatus(data: any): BfdStatus { return { ...data, configUpdateTimestampMicros: data["configUpdateTimestampMicros"] !== undefined ? String(data["configUpdateTimestampMicros"]) : undefined, controlPacketIntervals: data["controlPacketIntervals"] !== undefined ? data["controlPacketIntervals"].map((item: any) => (serializePacketIntervals(item))) : undefined, uptimeMs: data["uptimeMs"] !== undefined ? String(data["uptimeMs"]) : undefined, }; } function deserializeBfdStatus(data: any): BfdStatus { return { ...data, configUpdateTimestampMicros: data["configUpdateTimestampMicros"] !== undefined ? BigInt(data["configUpdateTimestampMicros"]) : undefined, controlPacketIntervals: data["controlPacketIntervals"] !== undefined ? data["controlPacketIntervals"].map((item: any) => (deserializePacketIntervals(item))) : undefined, uptimeMs: data["uptimeMs"] !== undefined ? BigInt(data["uptimeMs"]) : undefined, }; } export interface BfdStatusPacketCounts { /** * Number of packets received since the beginning of the current BFD session. */ numRx?: number; /** * Number of packets received that were rejected because of errors since the * beginning of the current BFD session. */ numRxRejected?: number; /** * Number of packets received that were successfully processed since the * beginning of the current BFD session. */ numRxSuccessful?: number; /** * Number of packets transmitted since the beginning of the current BFD * session. */ numTx?: number; } /** * Associates `members`, or principals, with a `role`. */ export interface Binding { /** * The condition that is associated with this binding. If the condition * evaluates to `true`, then this binding applies to the current request. If * the condition evaluates to `false`, then this binding does not apply to the * current request. However, a different role binding might grant the same * role to one or more of the principals in this binding. To learn which * resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ condition?: Expr; /** * Specifies the principals requesting access for a Google Cloud resource. * `members` can have the following values: * `allUsers`: A special identifier * that represents anyone who is on the internet; with or without a Google * account. * `allAuthenticatedUsers`: A special identifier that represents * anyone who is authenticated with a Google account or a service account. * Does not include identities that come from external identity providers * (IdPs) through identity federation. * `user:{emailid}`: An email address * that represents a specific Google account. For example, `alice@example.com` * . * `serviceAccount:{emailid}`: An email address that represents a Google * service account. For example, `my-other-app@appspot.gserviceaccount.com`. * * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An * identifier for a [Kubernetes service * account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). * For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * * `group:{emailid}`: An email address that represents a Google group. For * example, `admins@example.com`. * `domain:{domain}`: The G Suite domain * (primary) that represents all the users of that domain. For example, * `google.com` or `example.com`. * * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workforce identity pool. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: * All workforce identities in a group. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All workforce identities with a specific attribute value. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: * All identities in a workforce identity pool. * * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workload identity pool. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: * A workload identity pool group. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All identities in a workload identity pool with a certain attribute. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: * All identities in a workload identity pool. * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique * identifier) representing a user that has been recently deleted. For * example, `alice@example.com?uid=123456789012345678901`. If the user is * recovered, this value reverts to `user:{emailid}` and the recovered user * retains the role in the binding. * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus * unique identifier) representing a service account that has been recently * deleted. For example, * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If * the service account is undeleted, this value reverts to * `serviceAccount:{emailid}` and the undeleted service account retains the * role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email * address (plus unique identifier) representing a Google group that has been * recently deleted. For example, * `admins@example.com?uid=123456789012345678901`. If the group is recovered, * this value reverts to `group:{emailid}` and the recovered group retains the * role in the binding. * * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * Deleted single identity in a workforce identity pool. For example, * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. */ members?: string[]; /** * Role that is assigned to the list of `members`, or principals. For * example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview * of the IAM roles and permissions, see the [IAM * documentation](https://cloud.google.com/iam/docs/roles-overview). For a * list of the available pre-defined roles, see * [here](https://cloud.google.com/iam/docs/understanding-roles). */ role?: string; } /** * A transient resource used in compute.disks.bulkInsert and * compute.regionDisks.bulkInsert. It is only used to process requests and is * not persisted. */ export interface BulkInsertDiskResource { /** * The URL of the DiskConsistencyGroupPolicy for the group of disks to clone. * This may be a full or partial URL, such as: - * https://www.googleapis.com/compute/v1/projects/project/regions/region * /resourcePolicies/resourcePolicy - * projects/project/regions/region/resourcePolicies/resourcePolicy - * regions/region/resourcePolicies/resourcePolicy */ sourceConsistencyGroupPolicy?: string; } /** * A transient resource used in compute.instances.bulkInsert and * compute.regionInstances.bulkInsert . This resource is not persisted anywhere, * it is used only for processing the requests. */ export interface BulkInsertInstanceResource { /** * The maximum number of instances to create. */ count?: bigint; /** * The instance properties defining the VM instances to be created. Required * if sourceInstanceTemplate is not provided. */ instanceProperties?: InstanceProperties; /** * Policy for choosing target zone. For more information, see Create VMs in * bulk. */ locationPolicy?: LocationPolicy; /** * The minimum number of instances to create. If no min_count is specified * then count is used as the default value. If min_count instances cannot be * created, then no instances will be created and instances already created * will be deleted. */ minCount?: bigint; /** * The string pattern used for the names of the VMs. Either name_pattern or * per_instance_properties must be set. The pattern must contain one * continuous sequence of placeholder hash characters (#) with each character * corresponding to one digit of the generated instance name. Example: a * name_pattern of inst-#### generates instance names such as inst-0001 and * inst-0002. If existing instances in the same project and zone have names * that match the name pattern then the generated instance numbers start after * the biggest existing number. For example, if there exists an instance with * name inst-0050, then instance names generated using the pattern inst-#### * begin with inst-0051. The name pattern placeholder #...# can contain up to * 18 characters. */ namePattern?: string; /** * Per-instance properties to be set on individual instances. Keys of this * map specify requested instance names. Can be empty if name_pattern is used. */ perInstanceProperties?: { [key: string]: BulkInsertInstanceResourcePerInstanceProperties }; /** * Specifies the instance template from which to create instances. You may * combine sourceInstanceTemplate with instanceProperties to override specific * values from an existing instance template. Bulk API follows the semantics * of JSON Merge Patch described by RFC 7396. It can be a full or partial URL. * For example, the following are all valid URLs to an instance template: - * https://www.googleapis.com/compute/v1/projects/project * /global/instanceTemplates/instanceTemplate - * projects/project/global/instanceTemplates/instanceTemplate - * global/instanceTemplates/instanceTemplate This field is optional. */ sourceInstanceTemplate?: string; } function serializeBulkInsertInstanceResource(data: any): BulkInsertInstanceResource { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, instanceProperties: data["instanceProperties"] !== undefined ? serializeInstanceProperties(data["instanceProperties"]) : undefined, minCount: data["minCount"] !== undefined ? String(data["minCount"]) : undefined, }; } function deserializeBulkInsertInstanceResource(data: any): BulkInsertInstanceResource { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, instanceProperties: data["instanceProperties"] !== undefined ? deserializeInstanceProperties(data["instanceProperties"]) : undefined, minCount: data["minCount"] !== undefined ? BigInt(data["minCount"]) : undefined, }; } /** * Per-instance properties to be set on individual instances. To be extended in * the future. */ export interface BulkInsertInstanceResourcePerInstanceProperties { /** * Specifies the hostname of the instance. More details in: * https://cloud.google.com/compute/docs/instances/custom-hostname-vm#naming_convention */ hostname?: string; /** * This field is only temporary. It will be removed. Do not use it. */ name?: string; } export interface BulkInsertOperationStatus { /** * [Output Only] Count of VMs successfully created so far. */ createdVmCount?: number; /** * [Output Only] Count of VMs that got deleted during rollback. */ deletedVmCount?: number; /** * [Output Only] Count of VMs that started creating but encountered an error. */ failedToCreateVmCount?: number; /** * [Output Only] Creation status of BulkInsert operation - information if the * flow is rolling forward or rolling back. */ status?: | "CREATING" | "DONE" | "ROLLING_BACK" | "STATUS_UNSPECIFIED"; /** * [Output Only] Count of VMs originally planned to be created. */ targetVmCount?: number; } export interface CacheInvalidationRule { /** * If set, this invalidation rule will only apply to requests with a Host * header matching host. */ host?: string; path?: string; } /** * Message containing what to include in the cache key for a request for Cloud * CDN. */ export interface CacheKeyPolicy { /** * If true, requests to different hosts will be cached separately. */ includeHost?: boolean; /** * Allows HTTP request headers (by name) to be used in the cache key. */ includeHttpHeaders?: string[]; /** * Allows HTTP cookies (by name) to be used in the cache key. The name=value * pair will be used in the cache key Cloud CDN generates. */ includeNamedCookies?: string[]; /** * If true, http and https requests will be cached separately. */ includeProtocol?: boolean; /** * If true, include query string parameters in the cache key according to * query_string_whitelist and query_string_blacklist. If neither is set, the * entire query string will be included. If false, the query string will be * excluded from the cache key entirely. */ includeQueryString?: boolean; /** * Names of query string parameters to exclude in cache keys. All other * parameters will be included. Either specify query_string_whitelist or * query_string_blacklist, not both. '&' and '=' will be percent encoded and * not treated as delimiters. */ queryStringBlacklist?: string[]; /** * Names of query string parameters to include in cache keys. All other * parameters will be excluded. Either specify query_string_whitelist or * query_string_blacklist, not both. '&' and '=' will be percent encoded and * not treated as delimiters. */ queryStringWhitelist?: string[]; } /** * Settings controlling the volume of requests, connections and retries to this * backend service. */ export interface CircuitBreakers { /** * The maximum number of connections to the backend service. If not * specified, there is no limit. Not supported when the backend service is * referenced by a URL map that is bound to target gRPC proxy that has * validateForProxyless field set to true. */ maxConnections?: number; /** * The maximum number of pending requests allowed to the backend service. If * not specified, there is no limit. Not supported when the backend service is * referenced by a URL map that is bound to target gRPC proxy that has * validateForProxyless field set to true. */ maxPendingRequests?: number; /** * The maximum number of parallel requests that allowed to the backend * service. If not specified, there is no limit. */ maxRequests?: number; /** * Maximum requests for a single connection to the backend service. This * parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If * not specified, there is no limit. Setting this parameter to 1 will * effectively disable keep alive. Not supported when the backend service is * referenced by a URL map that is bound to target gRPC proxy that has * validateForProxyless field set to true. */ maxRequestsPerConnection?: number; /** * The maximum number of parallel retries allowed to the backend cluster. If * not specified, the default is 1. Not supported when the backend service is * referenced by a URL map that is bound to target gRPC proxy that has * validateForProxyless field set to true. */ maxRetries?: number; } /** * Represents a regional Commitment resource. Creating a commitment resource * means that you are purchasing a committed use contract with an explicit start * and end time. You can create commitments based on vCPUs and memory usage and * receive discounted rates. For full details, read Signing Up for Committed Use * Discounts. */ export interface Commitment { /** * Specifies whether to enable automatic renewal for the commitment. The * default value is false if not specified. The field can be updated until the * day of the commitment expiration at 12:00am PST. If the field is set to * true, the commitment will be automatically renewed for either one or three * years according to the terms of the existing commitment. */ autoRenew?: boolean; /** * The category of the commitment. Category MACHINE specifies commitments * composed of machine resources such as VCPU or MEMORY, listed in resources. * Category LICENSE specifies commitments composed of software licenses, * listed in licenseResources. Note that only MACHINE commitments should have * a Type specified. */ category?: | "CATEGORY_UNSPECIFIED" | "LICENSE" | "MACHINE"; /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * [Input Only] Optional, specifies the CUD end time requested by the * customer in RFC3339 text format. Needed when the customer wants CUD's end * date is later than the start date + term duration. */ customEndTimestamp?: string; /** * An optional description of this resource. Provide this property when you * create the resource. */ description?: string; /** * [Output Only] Commitment end time in RFC3339 text format. */ endTimestamp?: string; /** * Specifies the already existing reservations to attach to the Commitment. * This field is optional, and it can be a full or partial URL. For example, * the following are valid URLs to an reservation: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone * /reservations/reservation - * projects/project/zones/zone/reservations/reservation */ existingReservations?: string[]; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * [Output Only] Type of the resource. Always compute#commitment for * commitments. */ kind?: string; /** * The license specification required as part of a license commitment. */ licenseResource?: LicenseResourceCommitment; /** * List of source commitments to be merged into a new commitment. */ mergeSourceCommitments?: string[]; /** * Name 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. */ name?: string; /** * The plan for this commitment, which determines duration and discount rate. * The currently supported plans are TWELVE_MONTH (1 year), and * THIRTY_SIX_MONTH (3 years). */ plan?: | "INVALID" | "THIRTY_SIX_MONTH" | "TWELVE_MONTH"; /** * [Output Only] URL of the region where this commitment may be used. */ region?: string; /** * List of create-on-create reservations for this commitment. */ reservations?: Reservation[]; /** * A list of commitment amounts for particular resources. Note that VCPU and * MEMORY resource commitments must occur together. */ resources?: ResourceCommitment[]; /** * [Output Only] Status information for Commitment resource. */ resourceStatus?: CommitmentResourceStatus; /** * [Output Only] Server-defined URL for the resource. */ selfLink?: string; /** * Source commitment to be split into a new commitment. */ splitSourceCommitment?: string; /** * [Output Only] Commitment start time in RFC3339 text format. */ startTimestamp?: string; /** * [Output Only] Status of the commitment with regards to eventual expiration * (each commitment has an end date defined). One of the following values: * NOT_YET_ACTIVE, ACTIVE, EXPIRED. */ status?: | "ACTIVE" | "CANCELLED" | "CREATING" | "EXPIRED" | "NOT_YET_ACTIVE"; /** * [Output Only] An optional, human-readable explanation of the status. */ statusMessage?: string; /** * The type of commitment, which affects the discount rate and the eligible * resources. Type MEMORY_OPTIMIZED specifies a commitment that will only * apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a * commitment that will only apply to accelerator optimized machines. */ type?: | "ACCELERATOR_OPTIMIZED" | "ACCELERATOR_OPTIMIZED_A3" | "ACCELERATOR_OPTIMIZED_A3_MEGA" | "COMPUTE_OPTIMIZED" | "COMPUTE_OPTIMIZED_C2D" | "COMPUTE_OPTIMIZED_C3" | "COMPUTE_OPTIMIZED_C3D" | "COMPUTE_OPTIMIZED_H3" | "GENERAL_PURPOSE" | "GENERAL_PURPOSE_C4" | "GENERAL_PURPOSE_C4A" | "GENERAL_PURPOSE_E2" | "GENERAL_PURPOSE_N2" | "GENERAL_PURPOSE_N2D" | "GENERAL_PURPOSE_N4" | "GENERAL_PURPOSE_T2D" | "GRAPHICS_OPTIMIZED" | "MEMORY_OPTIMIZED" | "MEMORY_OPTIMIZED_M3" | "STORAGE_OPTIMIZED_Z3" | "TYPE_UNSPECIFIED"; } function serializeCommitment(data: any): Commitment { return { ...data, id: data["id"] !== undefined ? String(data["id"]) : undefined, licenseResource: data["licenseResource"] !== undefined ? serializeLicenseResourceCommitment(data["licenseResource"]) : undefined, reservations: data["reservations"] !== undefined ? data["reservations"].map((item: any) => (serializeReservation(item))) : undefined, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeResourceCommitment(item))) : undefined, }; } function deserializeCommitment(data: any): Commitment { return { ...data, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, licenseResource: data["licenseResource"] !== undefined ? deserializeLicenseResourceCommitment(data["licenseResource"]) : undefined, reservations: data["reservations"] !== undefined ? data["reservations"].map((item: any) => (deserializeReservation(item))) : undefined, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeResourceCommitment(item))) : undefined, }; } export interface CommitmentAggregatedList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of CommitmentsScopedList resources. */ items?: { [key: string]: CommitmentsScopedList }; /** * [Output Only] Type of resource. Always compute#commitmentAggregatedList * for aggregated lists of commitments. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Unreachable resources. */ unreachables?: string[]; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeCommitmentAggregatedList(data: any): CommitmentAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, serializeCommitmentsScopedList(v)]))) : undefined, }; } function deserializeCommitmentAggregatedList(data: any): CommitmentAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, deserializeCommitmentsScopedList(v)]))) : undefined, }; } /** * Contains a list of Commitment resources. */ export interface CommitmentList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of Commitment resources. */ items?: Commitment[]; /** * [Output Only] Type of resource. Always compute#commitmentList for lists of * commitments. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeCommitmentList(data: any): CommitmentList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeCommitment(item))) : undefined, }; } function deserializeCommitmentList(data: any): CommitmentList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeCommitment(item))) : undefined, }; } /** * [Output Only] Contains output only fields. */ export interface CommitmentResourceStatus { /** * [Output Only] Indicates the end time of customer's eligibility to send * custom term requests in RFC3339 text format. Term extension requests that * (not the end time in the request) after this time will be rejected. */ customTermEligibilityEndTimestamp?: string; } export interface CommitmentsScopedList { /** * [Output Only] A list of commitments contained in this scope. */ commitments?: Commitment[]; /** * [Output Only] Informational warning which replaces the list of commitments * when the list is empty. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeCommitmentsScopedList(data: any): CommitmentsScopedList { return { ...data, commitments: data["commitments"] !== undefined ? data["commitments"].map((item: any) => (serializeCommitment(item))) : undefined, }; } function deserializeCommitmentsScopedList(data: any): CommitmentsScopedList { return { ...data, commitments: data["commitments"] !== undefined ? data["commitments"].map((item: any) => (deserializeCommitment(item))) : undefined, }; } /** * A set of Confidential Instance options. */ export interface ConfidentialInstanceConfig { /** * Defines the type of technology used by the confidential instance. */ confidentialInstanceType?: | "CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED" | "SEV" | "SEV_SNP" | "TDX"; /** * Defines whether the instance should have confidential compute enabled. */ enableConfidentialCompute?: boolean; } /** * Message containing connection draining configuration. */ export interface ConnectionDraining { /** * Configures a duration timeout for existing requests on a removed backend * instance. For supported load balancers and protocols, as described in * Enabling connection draining. */ drainingTimeoutSec?: number; } /** * This message defines settings for a consistent hash style load balancer. */ export interface ConsistentHashLoadBalancerSettings { /** * Hash is based on HTTP Cookie. This field describes a HTTP cookie that will * be used as the hash key for the consistent hash load balancer. If the * cookie is not present, it will be generated. This field is applicable if * the sessionAffinity is set to HTTP_COOKIE. Not supported when the backend * service is referenced by a URL map that is bound to target gRPC proxy that * has validateForProxyless field set to true. */ httpCookie?: ConsistentHashLoadBalancerSettingsHttpCookie; /** * The hash based on the value of the specified header field. This field is * applicable if the sessionAffinity is set to HEADER_FIELD. */ httpHeaderName?: string; /** * The minimum number of virtual nodes to use for the hash ring. Defaults to * 1024. Larger ring sizes result in more granular load distributions. If the * number of hosts in the load balancing pool is larger than the ring size, * each host will be assigned a single virtual node. */ minimumRingSize?: bigint; } function serializeConsistentHashLoadBalancerSettings(data: any): ConsistentHashLoadBalancerSettings { return { ...data, httpCookie: data["httpCookie"] !== undefined ? serializeConsistentHashLoadBalancerSettingsHttpCookie(data["httpCookie"]) : undefined, minimumRingSize: data["minimumRingSize"] !== undefined ? String(data["minimumRingSize"]) : undefined, }; } function deserializeConsistentHashLoadBalancerSettings(data: any): ConsistentHashLoadBalancerSettings { return { ...data, httpCookie: data["httpCookie"] !== undefined ? deserializeConsistentHashLoadBalancerSettingsHttpCookie(data["httpCookie"]) : undefined, minimumRingSize: data["minimumRingSize"] !== undefined ? BigInt(data["minimumRingSize"]) : undefined, }; } /** * The information about the HTTP Cookie on which the hash function is based * for load balancing policies that use a consistent hash. */ export interface ConsistentHashLoadBalancerSettingsHttpCookie { /** * Name of the cookie. */ name?: string; /** * Path to set for the cookie. */ path?: string; /** * Lifetime of the cookie. */ ttl?: Duration; } function serializeConsistentHashLoadBalancerSettingsHttpCookie(data: any): ConsistentHashLoadBalancerSettingsHttpCookie { return { ...data, ttl: data["ttl"] !== undefined ? serializeDuration(data["ttl"]) : undefined, }; } function deserializeConsistentHashLoadBalancerSettingsHttpCookie(data: any): ConsistentHashLoadBalancerSettingsHttpCookie { return { ...data, ttl: data["ttl"] !== undefined ? deserializeDuration(data["ttl"]) : undefined, }; } /** * The specification for allowing client-side cross-origin requests. For more * information about the W3C recommendation for cross-origin resource sharing * (CORS), see Fetch API Living Standard. */ export interface CorsPolicy { /** * In response to a preflight request, setting this to true indicates that * the actual request can include user credentials. This field translates to * the Access-Control-Allow-Credentials header. Default is false. */ allowCredentials?: boolean; /** * Specifies the content for the Access-Control-Allow-Headers header. */ allowHeaders?: string[]; /** * Specifies the content for the Access-Control-Allow-Methods header. */ allowMethods?: string[]; /** * Specifies a regular expression that matches allowed origins. For more * information, see regular expression syntax . An origin is allowed if it * matches either an item in allowOrigins or an item in allowOriginRegexes. * Regular expressions can only be used when the loadBalancingScheme is set to * INTERNAL_SELF_MANAGED. */ allowOriginRegexes?: string[]; /** * Specifies the list of origins that is allowed to do CORS requests. An * origin is allowed if it matches either an item in allowOrigins or an item * in allowOriginRegexes. */ allowOrigins?: string[]; /** * If true, disables the CORS policy. The default value is false, which * indicates that the CORS policy is in effect. */ disabled?: boolean; /** * Specifies the content for the Access-Control-Expose-Headers header. */ exposeHeaders?: string[]; /** * Specifies how long results of a preflight request can be cached in * seconds. This field translates to the Access-Control-Max-Age header. */ maxAge?: number; } export interface CustomerEncryptionKey { /** * The name of the encryption key that is stored in Google Cloud KMS. For * example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ * key_region/cryptoKeys/key The fully-qualifed key name may be returned for * resource GET requests. For example: "kmsKeyName": * "projects/kms_project_id/locations/region/keyRings/ * key_region/cryptoKeys/key /cryptoKeyVersions/1 */ kmsKeyName?: string; /** * The service account being used for the encryption request for the given * KMS key. If absent, the Compute Engine default service account is used. For * example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/ */ kmsKeyServiceAccount?: string; /** * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 * base64 to either encrypt or decrypt this resource. You can provide either * the rawKey or the rsaEncryptedKey. For example: "rawKey": * "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=" */ rawKey?: string; /** * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit * customer-supplied encryption key to either encrypt or decrypt this * resource. You can provide either the rawKey or the rsaEncryptedKey. For * example: "rsaEncryptedKey": * "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH * z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD * D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" * The key must meet the following requirements before you can provide it to * Compute Engine: 1. The key is wrapped using a RSA public key certificate * provided by Google. 2. After being wrapped, the key must be encoded in RFC * 4648 base64 encoding. Gets the RSA public key certificate provided by * Google at: * https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem */ rsaEncryptedKey?: string; /** * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the * customer-supplied encryption key that protects this resource. */ sha256?: string; } export interface CustomerEncryptionKeyProtectedDisk { /** * Decrypts data associated with the disk with a customer-supplied encryption * key. */ diskEncryptionKey?: CustomerEncryptionKey; /** * Specifies a valid partial or full URL to an existing Persistent Disk * resource. This field is only applicable for persistent disks. For example: * "source": "/compute/v1/projects/project_id/zones/zone/disks/ disk_name */ source?: string; } /** * Specifies the custom error response policy that must be applied when the * backend service or backend bucket responds with an error. */ export interface CustomErrorResponsePolicy { /** * Specifies rules for returning error responses. In a given policy, if you * specify rules for both a range of error codes as well as rules for specific * error codes then rules with specific error codes have a higher priority. * For example, assume that you configure a rule for 401 (Un-authorized) code, * and another for all 4 series error codes (4XX). If the backend service * returns a 401, then the rule for 401 will be applied. However if the * backend service returns a 403, the rule for 4xx takes effect. */ errorResponseRules?: CustomErrorResponsePolicyCustomErrorResponseRule[]; /** * The full or partial URL to the BackendBucket resource that contains the * custom error content. Examples are: - * https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket * - compute/v1/projects/project/global/backendBuckets/myBackendBucket - * global/backendBuckets/myBackendBucket If errorService is not specified at * lower levels like pathMatcher, pathRule and routeRule, an errorService * specified at a higher level in the UrlMap will be used. If * UrlMap.defaultCustomErrorResponsePolicy contains one or more * errorResponseRules[], it must specify errorService. If load balancer cannot * reach the backendBucket, a simple Not Found Error will be returned, with * the original response code (or overrideResponseCode if configured). * errorService is not supported for internal or regional HTTP/HTTPS load * balancers. */ errorService?: string; } /** * Specifies the mapping between the response code that will be returned along * with the custom error content and the response code returned by the backend * service. */ export interface CustomErrorResponsePolicyCustomErrorResponseRule { /** * Valid values include: - A number between 400 and 599: For example 401 or * 503, in which case the load balancer applies the policy if the error code * exactly matches this value. - 5xx: Load Balancer will apply the policy if * the backend service responds with any response code in the range of 500 to * 599. - 4xx: Load Balancer will apply the policy if the backend service * responds with any response code in the range of 400 to 499. Values must be * unique within matchResponseCodes and across all errorResponseRules of * CustomErrorResponsePolicy. */ matchResponseCodes?: string[]; /** * The HTTP status code returned with the response containing the custom * error content. If overrideResponseCode is not supplied, the same response * code returned by the original backend bucket or backend service is returned * to the client. */ overrideResponseCode?: number; /** * The full path to a file within backendBucket . For example: * /errors/defaultError.html path must start with a leading slash. path cannot * have trailing slashes. If the file is not available in backendBucket or the * load balancer cannot reach the BackendBucket, a simple Not Found Error is * returned to the client. The value must be from 1 to 1024 characters */ path?: string; } /** * Deprecation status for a public resource. */ export interface DeprecationStatus { /** * An optional RFC3339 timestamp on or after which the state of this resource * is intended to change to DELETED. This is only informational and the status * will not change unless the client explicitly changes it. */ deleted?: string; /** * An optional RFC3339 timestamp on or after which the state of this resource * is intended to change to DEPRECATED. This is only informational and the * status will not change unless the client explicitly changes it. */ deprecated?: string; /** * An optional RFC3339 timestamp on or after which the state of this resource * is intended to change to OBSOLETE. This is only informational and the * status will not change unless the client explicitly changes it. */ obsolete?: string; /** * The URL of the suggested replacement for a deprecated resource. The * suggested replacement resource must be the same kind of resource as the * deprecated resource. */ replacement?: string; /** * The deprecation state of this resource. This can be ACTIVE, DEPRECATED, * OBSOLETE, or DELETED. Operations which communicate the end of life date for * an image, can use ACTIVE. Operations which create a new resource using a * DEPRECATED resource will return successfully, but with a warning indicating * the deprecated resource and recommending its replacement. Operations which * use OBSOLETE or DELETED resources will be rejected and result in an error. */ state?: | "ACTIVE" | "DELETED" | "DEPRECATED" | "OBSOLETE"; } /** * Represents a Persistent Disk resource. Google Compute Engine has two Disk * resources: * [Zonal](/compute/docs/reference/rest/v1/disks) * * [Regional](/compute/docs/reference/rest/v1/regionDisks) Persistent disks are * required for running your VM instances. Create both boot and non-boot (data) * persistent disks. For more information, read Persistent Disks. For more * storage options, read Storage options. The disks resource represents a zonal * persistent disk. For more information, read Zonal persistent disks. The * regionDisks resource represents a regional persistent disk. For more * information, read Regional resources. */ export interface Disk { /** * The access mode of the disk. - READ_WRITE_SINGLE: The default AccessMode, * means the disk can be attached to single instance in RW mode. - * READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple * instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can * be attached to multiple instances in RO mode. The AccessMode is only valid * for Hyperdisk disk types. */ accessMode?: | "READ_ONLY_MANY" | "READ_WRITE_MANY" | "READ_WRITE_SINGLE"; /** * The architecture of the disk. Valid values are ARM64 or X86_64. */ architecture?: | "ARCHITECTURE_UNSPECIFIED" | "ARM64" | "X86_64"; /** * Disk asynchronously replicated into this disk. */ asyncPrimaryDisk?: DiskAsyncReplication; /** * [Output Only] A list of disks this disk is asynchronously replicated to. */ asyncSecondaryDisks?: { [key: string]: DiskAsyncReplicationList }; /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * An optional description of this resource. Provide this property when you * create the resource. */ description?: string; /** * Encrypts the disk using a customer-supplied encryption key or a * customer-managed encryption key. Encryption keys do not protect access to * metadata of the disk. After you encrypt a disk with a customer-supplied * key, you must provide the same key if you use the disk later. For example, * to create a disk snapshot, to create a disk image, to create a machine * image, or to attach the disk to a virtual machine. After you encrypt a disk * with a customer-managed key, the diskEncryptionKey.kmsKeyName is set to a * key *version* name once the disk is created. The disk is encrypted with * this version of the key. In the response, diskEncryptionKey.kmsKeyName * appears in the following format: "diskEncryptionKey.kmsKeyName": * "projects/kms_project_id/locations/region/keyRings/ * key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not provide * an encryption key when creating the disk, then the disk is encrypted using * an automatically generated key and you don't need to provide a key to use * the disk later. */ diskEncryptionKey?: CustomerEncryptionKey; /** * Whether this disk is using confidential compute mode. */ enableConfidentialCompute?: boolean; /** * A list of features to enable on the guest operating system. Applicable * only for bootable images. Read Enabling guest operating system features to * see a list of available options. */ guestOsFeatures?: GuestOsFeature[]; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * [Output Only] Type of the resource. Always compute#disk for disks. */ kind?: string; /** * A fingerprint for the labels being applied to this disk, which is * essentially a hash of the labels set used for optimistic locking. The * fingerprint is initially generated by Compute Engine and changes after * every request to modify or update labels. You must always provide an * up-to-date fingerprint hash in order to update or change labels, otherwise * the request will fail with error 412 conditionNotMet. To see the latest * fingerprint, make a get() request to retrieve a disk. */ labelFingerprint?: Uint8Array; /** * Labels to apply to this disk. These can be later modified by the setLabels * method. */ labels?: { [key: string]: string }; /** * [Output Only] Last attach timestamp in RFC3339 text format. */ lastAttachTimestamp?: string; /** * [Output Only] Last detach timestamp in RFC3339 text format. */ lastDetachTimestamp?: string; /** * Integer license codes indicating which licenses are attached to this disk. */ licenseCodes?: bigint[]; /** * A list of publicly visible licenses. Reserved for Google's use. */ licenses?: string[]; /** * An opaque location hint used to place the disk close to other resources. * This field is for use by internal tools that use the public API. */ locationHint?: string; /** * Name 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. */ name?: string; /** * Internal use only. */ options?: string; /** * Input only. [Input Only] Additional params passed with the request, but * not persisted as part of resource payload. */ params?: DiskParams; /** * Physical block size of the persistent disk, in bytes. If not present in a * request, a default value is used. The currently supported size is 4096, * other sizes may be added in the future. If an unsupported value is * requested, the error message will list the supported values for the * caller's project. */ physicalBlockSizeBytes?: bigint; /** * Indicates how many IOPS to provision for the disk. This sets the number of * I/O operations per second that the disk can handle. Values must be between * 10,000 and 120,000. For more details, see the Extreme persistent disk * documentation. */ provisionedIops?: bigint; /** * Indicates how much throughput to provision for the disk. This sets the * number of throughput mb per second that the disk can handle. Values must be * greater than or equal to 1. */ provisionedThroughput?: bigint; /** * [Output Only] URL of the region where the disk resides. Only applicable * for regional resources. You must specify this field as part of the HTTP * request URL. It is not settable as a field in the request body. */ region?: string; /** * URLs of the zones where the disk should be replicated to. Only applicable * for regional resources. */ replicaZones?: string[]; /** * Resource policies applied to this disk for automatic snapshot creations. */ resourcePolicies?: string[]; /** * [Output Only] Status information for the disk resource. */ resourceStatus?: DiskResourceStatus; /** * Output only. Reserved for future use. */ readonly satisfiesPzi?: boolean; /** * [Output Only] Reserved for future use. */ satisfiesPzs?: boolean; /** * [Output Only] Server-defined fully-qualified URL for this resource. */ selfLink?: string; /** * Size, in GB, of the persistent disk. You can specify this field when * creating a persistent disk using the sourceImage, sourceSnapshot, or * sourceDisk parameter, or specify it alone to create an empty persistent * disk. If you specify this field along with a source, the value of sizeGb * must not be less than the size of the source. Acceptable values are greater * than 0. */ sizeGb?: bigint; /** * [Output Only] URL of the DiskConsistencyGroupPolicy for a secondary disk * that was created using a consistency group. */ sourceConsistencyGroupPolicy?: string; /** * [Output Only] ID of the DiskConsistencyGroupPolicy for a secondary disk * that was created using a consistency group. */ sourceConsistencyGroupPolicyId?: string; /** * The source disk used to create this disk. You can provide this as a * partial or full URL to the resource. For example, the following are valid * values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone * /disks/disk - * https://www.googleapis.com/compute/v1/projects/project/regions/region * /disks/disk - projects/project/zones/zone/disks/disk - * projects/project/regions/region/disks/disk - zones/zone/disks/disk - * regions/region/disks/disk */ sourceDisk?: string; /** * [Output Only] The unique ID of the disk used to create this disk. This * value identifies the exact disk that was used to create this persistent * disk. For example, if you created the persistent disk from a disk that was * later deleted and recreated under the same name, the source disk ID would * identify the exact version of the disk that was used. */ sourceDiskId?: string; /** * The source image used to create this disk. If the source image is deleted, * this field will not be set. To create a disk with one of the public * operating system images, specify the image by its family name. For example, * specify family/debian-9 to use the latest Debian 9 image: * projects/debian-cloud/global/images/family/debian-9 Alternatively, use a * specific version of a public operating system image: * projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a * disk with a custom image that you created, specify the image name in the * following format: global/images/my-custom-image You can also specify a * custom image by its image family, which returns the latest version of the * image in that family. Replace the image name with family/family-name: * global/images/family/my-image-family */ sourceImage?: string; /** * The customer-supplied encryption key of the source image. Required if the * source image is protected by a customer-supplied encryption key. */ sourceImageEncryptionKey?: CustomerEncryptionKey; /** * [Output Only] The ID value of the image used to create this disk. This * value identifies the exact image that was used to create this persistent * disk. For example, if you created the persistent disk from an image that * was later deleted and recreated under the same name, the source image ID * would identify the exact version of the image that was used. */ sourceImageId?: string; /** * The source instant snapshot used to create this disk. You can provide this * as a partial or full URL to the resource. For example, the following are * valid values: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone * /instantSnapshots/instantSnapshot - * projects/project/zones/zone/instantSnapshots/instantSnapshot - * zones/zone/instantSnapshots/instantSnapshot */ sourceInstantSnapshot?: string; /** * [Output Only] The unique ID of the instant snapshot used to create this * disk. This value identifies the exact instant snapshot that was used to * create this persistent disk. For example, if you created the persistent * disk from an instant snapshot that was later deleted and recreated under * the same name, the source instant snapshot ID would identify the exact * version of the instant snapshot that was used. */ sourceInstantSnapshotId?: string; /** * The source snapshot used to create this disk. You can provide this as a * partial or full URL to the resource. For example, the following are valid * values: - https://www.googleapis.com/compute/v1/projects/project * /global/snapshots/snapshot - projects/project/global/snapshots/snapshot - * global/snapshots/snapshot */ sourceSnapshot?: string; /** * The customer-supplied encryption key of the source snapshot. Required if * the source snapshot is protected by a customer-supplied encryption key. */ sourceSnapshotEncryptionKey?: CustomerEncryptionKey; /** * [Output Only] The unique ID of the snapshot used to create this disk. This * value identifies the exact snapshot that was used to create this persistent * disk. For example, if you created the persistent disk from a snapshot that * was later deleted and recreated under the same name, the source snapshot ID * would identify the exact version of the snapshot that was used. */ sourceSnapshotId?: string; /** * The full Google Cloud Storage URI where the disk image is stored. This * file must be a gzip-compressed tarball whose name ends in .tar.gz or * virtual machine disk whose name ends in vmdk. Valid URIs may start with * gs:// or https://storage.googleapis.com/. This flag is not optimized for * creating multiple disks from a source storage object. To create many disks * from a source storage object, use gcloud compute images import instead. */ sourceStorageObject?: string; /** * [Output Only] The status of disk creation. - CREATING: Disk is * provisioning. - RESTORING: Source data is being copied into the disk. - * FAILED: Disk creation failed. - READY: Disk is ready for use. - DELETING: * Disk is deleting. */ status?: | "CREATING" | "DELETING" | "FAILED" | "READY" | "RESTORING" | "UNAVAILABLE"; /** * The storage pool in which the new disk is created. You can provide this as * a partial or full URL to the resource. For example, the following are valid * values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone * /storagePools/storagePool - * projects/project/zones/zone/storagePools/storagePool - * zones/zone/storagePools/storagePool */ storagePool?: string; /** * URL of the disk type resource describing which disk type to use to create * the disk. Provide this when creating the disk. For example: * projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types. */ type?: string; /** * [Output Only] Links to the users of the disk (attached instances) in form: * projects/project/zones/zone/instances/instance */ users?: string[]; /** * [Output Only] URL of the zone where the disk resides. You must specify * this field as part of the HTTP request URL. It is not settable as a field * in the request body. */ zone?: string; } function serializeDisk(data: any): Disk { return { ...data, id: data["id"] !== undefined ? String(data["id"]) : undefined, labelFingerprint: data["labelFingerprint"] !== undefined ? encodeBase64(data["labelFingerprint"]) : undefined, licenseCodes: data["licenseCodes"] !== undefined ? data["licenseCodes"].map((item: any) => (String(item))) : undefined, physicalBlockSizeBytes: data["physicalBlockSizeBytes"] !== undefined ? String(data["physicalBlockSizeBytes"]) : undefined, provisionedIops: data["provisionedIops"] !== undefined ? String(data["provisionedIops"]) : undefined, provisionedThroughput: data["provisionedThroughput"] !== undefined ? String(data["provisionedThroughput"]) : undefined, sizeGb: data["sizeGb"] !== undefined ? String(data["sizeGb"]) : undefined, }; } function deserializeDisk(data: any): Disk { return { ...data, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, labelFingerprint: data["labelFingerprint"] !== undefined ? decodeBase64(data["labelFingerprint"] as string) : undefined, licenseCodes: data["licenseCodes"] !== undefined ? data["licenseCodes"].map((item: any) => (BigInt(item))) : undefined, physicalBlockSizeBytes: data["physicalBlockSizeBytes"] !== undefined ? BigInt(data["physicalBlockSizeBytes"]) : undefined, provisionedIops: data["provisionedIops"] !== undefined ? BigInt(data["provisionedIops"]) : undefined, provisionedThroughput: data["provisionedThroughput"] !== undefined ? BigInt(data["provisionedThroughput"]) : undefined, sizeGb: data["sizeGb"] !== undefined ? BigInt(data["sizeGb"]) : undefined, }; } export interface DiskAggregatedList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of DisksScopedList resources. */ items?: { [key: string]: DisksScopedList }; /** * [Output Only] Type of resource. Always compute#diskAggregatedList for * aggregated lists of persistent disks. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Unreachable resources. */ unreachables?: string[]; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeDiskAggregatedList(data: any): DiskAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, serializeDisksScopedList(v)]))) : undefined, }; } function deserializeDiskAggregatedList(data: any): DiskAggregatedList { return { ...data, items: data["items"] !== undefined ? Object.fromEntries(Object.entries(data["items"]).map(([k, v]: [string, any]) => ([k, deserializeDisksScopedList(v)]))) : undefined, }; } export interface DiskAsyncReplication { /** * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was * started on the disk as a member of a group. */ consistencyGroupPolicy?: string; /** * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was * started on the disk as a member of a group. */ consistencyGroupPolicyId?: string; /** * The other disk asynchronously replicated to or from the current disk. You * can provide this as a partial or full URL to the resource. For example, the * following are valid values: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone * /disks/disk - projects/project/zones/zone/disks/disk - * zones/zone/disks/disk */ disk?: string; /** * [Output Only] The unique ID of the other disk asynchronously replicated to * or from the current disk. This value identifies the exact disk that was * used to create this replication. For example, if you started replicating * the persistent disk from a disk that was later deleted and recreated under * the same name, the disk ID would identify the exact version of the disk * that was used. */ diskId?: string; } export interface DiskAsyncReplicationList { asyncReplicationDisk?: DiskAsyncReplication; } /** * A specification of the desired way to instantiate a disk in the instance * template when its created from a source instance. */ export interface DiskInstantiationConfig { /** * Specifies whether the disk will be auto-deleted when the instance is * deleted (but not when the disk is detached from the instance). */ autoDelete?: boolean; /** * The custom source image to be used to restore this disk when instantiating * this instance template. */ customImage?: string; /** * Specifies the device name of the disk to which the configurations apply * to. */ deviceName?: string; /** * Specifies whether to include the disk and what image to use. Possible * values are: - source-image: to use the same image that was used to create * the source instance's corresponding disk. Applicable to the boot disk and * additional read-write disks. - source-image-family: to use the same image * family that was used to create the source instance's corresponding disk. * Applicable to the boot disk and additional read-write disks. - * custom-image: to use a user-provided image url for disk creation. * Applicable to the boot disk and additional read-write disks. - * attach-read-only: to attach a read-only disk. Applicable to read-only * disks. - do-not-include: to exclude a disk from the template. Applicable to * additional read-write disks, local SSDs, and read-only disks. */ instantiateFrom?: | "ATTACH_READ_ONLY" | "BLANK" | "CUSTOM_IMAGE" | "DEFAULT" | "DO_NOT_INCLUDE" | "SOURCE_IMAGE" | "SOURCE_IMAGE_FAMILY"; } /** * A list of Disk resources. */ export interface DiskList { /** * [Output Only] Unique identifier for the resource; defined by the server. */ id?: string; /** * A list of Disk resources. */ items?: Disk[]; /** * [Output Only] Type of resource. Always compute#diskList for lists of * disks. */ kind?: string; /** * [Output Only] This token allows you to get the next page of results for * list requests. If the number of results is larger than maxResults, use the * nextPageToken as a value for the query parameter pageToken in the next list * request. Subsequent list requests will have their own nextPageToken to * continue paging through the results. */ nextPageToken?: string; /** * [Output Only] Server-defined URL for this resource. */ selfLink?: string; /** * [Output Only] Informational warning message. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeDiskList(data: any): DiskList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeDisk(item))) : undefined, }; } function deserializeDiskList(data: any): DiskList { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeDisk(item))) : undefined, }; } export interface DiskMoveRequest { /** * The URL of the destination zone to move the disk. This can be a full or * partial URL. For example, the following are all valid URLs to a zone: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - * projects/project/zones/zone - zones/zone */ destinationZone?: string; /** * The URL of the target disk to move. This can be a full or partial URL. For * example, the following are all valid URLs to a disk: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone * /disks/disk - projects/project/zones/zone/disks/disk - * zones/zone/disks/disk */ targetDisk?: string; } /** * Additional disk params. */ export interface DiskParams { /** * Resource manager tags to be bound to the disk. Tag keys and values have * the same definition as resource manager tags. Keys must be in the format * `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The * field is ignored (both PUT & PATCH) when empty. */ resourceManagerTags?: { [key: string]: string }; } export interface DiskResourceStatus { asyncPrimaryDisk?: DiskResourceStatusAsyncReplicationStatus; /** * Key: disk, value: AsyncReplicationStatus message */ asyncSecondaryDisks?: { [key: string]: DiskResourceStatusAsyncReplicationStatus }; } export interface DiskResourceStatusAsyncReplicationStatus { state?: | "ACTIVE" | "CREATED" | "STARTING" | "STATE_UNSPECIFIED" | "STOPPED" | "STOPPING"; } /** * Additional options for Compute#disksAddResourcePolicies. */ export interface DisksAddResourcePoliciesOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface DisksAddResourcePoliciesRequest { /** * Full or relative path to the resource policy to be added to this disk. You * can only specify one resource policy. */ resourcePolicies?: string[]; } /** * Additional options for Compute#disksAggregatedList. */ export interface DisksAggregatedListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * Indicates whether every visible scope for each scope type (zone, region, * global) should be included in the response. For new resource types added * after this field, the flag has no effect as new resource types will always * include every visible scope for each scope type in response. For resource * types which predate this field, if this flag is omitted or false, only * scopes of the scope types where the resource type is expected to be found * will be included. */ includeAllScopes?: boolean; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; /** * The Shared VPC service project id or service project number for which * aggregated list request is invoked for subnetworks list-usable api. */ serviceProjectNumber?: bigint; } function serializeDisksAggregatedListOptions(data: any): DisksAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? String(data["serviceProjectNumber"]) : undefined, }; } function deserializeDisksAggregatedListOptions(data: any): DisksAggregatedListOptions { return { ...data, serviceProjectNumber: data["serviceProjectNumber"] !== undefined ? BigInt(data["serviceProjectNumber"]) : undefined, }; } /** * Additional options for Compute#disksBulkInsert. */ export interface DisksBulkInsertOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#disksCreateSnapshot. */ export interface DisksCreateSnapshotOptions { /** * [Input Only] Whether to attempt an application consistent snapshot by * informing the OS to prepare for the snapshot process. */ guestFlush?: boolean; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#disksDelete. */ export interface DisksDeleteOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#disksGetIamPolicy. */ export interface DisksGetIamPolicyOptions { /** * Requested IAM Policy version. */ optionsRequestedPolicyVersion?: number; } /** * Additional options for Compute#disksInsert. */ export interface DisksInsertOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Source image to restore onto a disk. This field is optional. */ sourceImage?: string; } /** * Additional options for Compute#disksList. */ export interface DisksListOptions { /** * A filter expression that filters resources listed in the response. Most * Compute resources support two types of filter expressions: expressions that * support regular expressions and expressions that follow API improvement * proposal AIP-160. These two types of filter expressions cannot be mixed in * one request. If you want to use AIP-160, your expression must specify the * field name, an operator, and the value that you want to use for filtering. * The value must be a string, a number, or a boolean. The operator must be * either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are * filtering Compute Engine instances, you can exclude instances named * `example-instance` by specifying `name != example-instance`. The `:*` * comparison can be used to test whether a key has been defined. For example, * to find all objects with `owner` label use: ``` labels.owner:* ``` You can * also filter nested fields. For example, you could specify * `scheduling.automaticRestart = false` to include instances only if they are * not scheduled for automatic restarts. You can use filtering on nested * fields to filter based on resource labels. To filter on multiple * expressions, provide each separate expression within parentheses. For * example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel * Skylake") ``` By default, each expression is an `AND` expression. However, * you can include `AND` and `OR` expressions explicitly. For example: ``` * (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true) ``` If you want to use a regular * expression, use the `eq` (equal) or `ne` (not equal) operator against a * single un-parenthesized expression with or without quotes or against * multiple parenthesized expressions. Examples: `fieldname eq unquoted * literal` `fieldname eq 'single quoted literal'` `fieldname eq "double * quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The * literal value is interpreted as a regular expression using Google RE2 * library syntax. The literal value must match the entire field. For example, * to filter for instances that do not end with name "instance", you would use * `name ne .*instance`. You cannot combine constraints on multiple fields * using regular expressions. */ filter?: string; /** * The maximum number of results per page that should be returned. If the * number of available results is larger than `maxResults`, Compute Engine * returns a `nextPageToken` that can be used to get the next page of results * in subsequent list requests. Acceptable values are `0` to `500`, inclusive. * (Default: `500`) */ maxResults?: number; /** * Sorts list results by a certain order. By default, results are returned in * alphanumerical order based on the resource name. You can also sort results * in descending order based on the creation timestamp using * `orderBy="creationTimestamp desc"`. This sorts results based on the * `creationTimestamp` field in reverse chronological order (newest result * first). Use this to sort resources like operations so that the newest * operation is returned first. Currently, only sorting by `name` or * `creationTimestamp desc` is supported. */ orderBy?: string; /** * Specifies a page token to use. Set `pageToken` to the `nextPageToken` * returned by a previous list request to get the next page of results. */ pageToken?: string; /** * Opt-in for partial success behavior which provides partial results in case * of failure. The default value is false. For example, when partial success * behavior is enabled, aggregatedList for a single zone scope either returns * all resources in the zone or no resources, with an error code. */ returnPartialSuccess?: boolean; } /** * Additional options for Compute#disksRemoveResourcePolicies. */ export interface DisksRemoveResourcePoliciesOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface DisksRemoveResourcePoliciesRequest { /** * Resource policies to be removed from this disk. */ resourcePolicies?: string[]; } /** * Additional options for Compute#disksResize. */ export interface DisksResizeOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface DisksResizeRequest { /** * The new size of the persistent disk, which is specified in GB. */ sizeGb?: bigint; } function serializeDisksResizeRequest(data: any): DisksResizeRequest { return { ...data, sizeGb: data["sizeGb"] !== undefined ? String(data["sizeGb"]) : undefined, }; } function deserializeDisksResizeRequest(data: any): DisksResizeRequest { return { ...data, sizeGb: data["sizeGb"] !== undefined ? BigInt(data["sizeGb"]) : undefined, }; } export interface DisksScopedList { /** * [Output Only] A list of disks contained in this scope. */ disks?: Disk[]; /** * [Output Only] Informational warning which replaces the list of disks when * the list is empty. */ warning?: { code?: | "CLEANUP_FAILED" | "DEPRECATED_RESOURCE_USED" | "DEPRECATED_TYPE_USED" | "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" | "EXPERIMENTAL_TYPE_USED" | "EXTERNAL_API_WARNING" | "FIELD_VALUE_OVERRIDEN" | "INJECTED_KERNELS_DEPRECATED" | "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" | "LARGE_DEPLOYMENT_WARNING" | "LIST_OVERHEAD_QUOTA_EXCEED" | "MISSING_TYPE_DEPENDENCY" | "NEXT_HOP_ADDRESS_NOT_ASSIGNED" | "NEXT_HOP_CANNOT_IP_FORWARD" | "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" | "NEXT_HOP_INSTANCE_NOT_FOUND" | "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" | "NEXT_HOP_NOT_RUNNING" | "NOT_CRITICAL_ERROR" | "NO_RESULTS_ON_PAGE" | "PARTIAL_SUCCESS" | "REQUIRED_TOS_AGREEMENT" | "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" | "RESOURCE_NOT_DELETED" | "SCHEMA_VALIDATION_IGNORED" | "SINGLE_INSTANCE_PROPERTY_TEMPLATE" | "UNDECLARED_PROPERTIES" | "UNREACHABLE"; data?: { key?: string; value?: string; }[]; message?: string; }; } function serializeDisksScopedList(data: any): DisksScopedList { return { ...data, disks: data["disks"] !== undefined ? data["disks"].map((item: any) => (serializeDisk(item))) : undefined, }; } function deserializeDisksScopedList(data: any): DisksScopedList { return { ...data, disks: data["disks"] !== undefined ? data["disks"].map((item: any) => (deserializeDisk(item))) : undefined, }; } /** * Additional options for Compute#disksSetLabels. */ export interface DisksSetLabelsOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#disksStartAsyncReplication. */ export interface DisksStartAsyncReplicationOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } export interface DisksStartAsyncReplicationRequest { /** * The secondary disk to start asynchronous replication to. You can provide * this as a partial or full URL to the resource. For example, the following * are valid values: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone * /disks/disk - * https://www.googleapis.com/compute/v1/projects/project/regions/region * /disks/disk - projects/project/zones/zone/disks/disk - * projects/project/regions/region/disks/disk - zones/zone/disks/disk - * regions/region/disks/disk */ asyncSecondaryDisk?: string; } /** * Additional options for Compute#disksStopAsyncReplication. */ export interface DisksStopAsyncReplicationOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for Compute#disksStopGroupAsyncReplication. */ export interface DisksStopGroupAsyncReplicationOptions { /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * A transient resource used in compute.disks.stopGroupAsyncReplication and * compute.regionDisks.stopGroupAsyncReplication. It is only used to process * requests and is not persisted. */ export interface DisksStopGroupAsyncReplicationResource { /** * The URL of the DiskConsistencyGroupPolicy for the group of disks to stop. * This may be a full or partial URL, such as: - * https://www.googleapis.com/compute/v1/projects/project/regions/region * /resourcePolicies/resourcePolicy - * projects/project/regions/region/resourcePolicies/resourcePolicy - * regions/region/resourcePolicies/resourcePolicy */ resourcePolicy?: string; } /** * Additional options for Compute#disksUpdate. */ export interface DisksUpdateOptions { paths?: string; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore the * request if it has already been completed. For example, consider a situation * where you make an initial request and the request times out. If you make * the request again with the same request ID, the server can check if * original operation with the same request ID was received, and if so, will * ignore the second request. This prevents clients from accidentally creating * duplicate commitments. The request ID must be a valid UUID with the * exception that zero UUID is not supported ( * 00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * update_mask indicates fields to be updated as part of this request. */ updateMask?: string /* FieldMask */; } function serializeDisksUpdateOptions(data: any): DisksUpdateOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeDisksUpdateOptions(data: any): DisksUpdateOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Represents a Disk Type resource. Google Compute Engine has two Disk Type * resources: * [Regional](/compute/docs/reference/rest/v1/regionDiskTypes) * * [Zonal](/compute/docs/reference/rest/v1/diskTypes) You can choose from a * variety of disk types based on your needs. For more information, read Storage * options. The diskTypes resource represents disk types for a zonal persistent * disk. For more information, read Zonal persistent disks. The regionDiskTypes * resource represents disk types for a regional persistent disk. For more * information, read Regional persistent disks. */ export interface DiskType { /** * [Output Only] Creation timestamp in RFC3339 text format. */ creationTimestamp?: string; /** * [Output Only] Server-defined default disk size in GB. */ defaultDiskSizeGb?: bigint; /** * [Output Only] The deprecation status associated with this disk type. */ deprecated?: DeprecationStatus; /** * [Output Only] An optional description of this resource. */ description?: string; /** * [Output Only] The unique identifier for the resource. This identifier is * defined by the server. */ id?: bigint; /** * [Output Only] Type of the resource. Always compute#diskType for disk * types. */ kind?: string; /** * [Output Only] Name of the resource. */ name?: string; /** * [Output Only] URL of the region where the disk type resides. Only * applicable for regional resources. You must specify this field as part of * the HTTP request URL. It is not settable as a field in the request body. */ region?: string; /** * [Output Only] Server-defined URL for the resource. */ selfLink?: string;