Files
old-slucajna-televizija/backend/node_modules/googleapis/apis/compute/beta.js
GotPPay a75ea978f9 ..
2017-10-16 20:21:19 +02:00

34481 lines
1.7 MiB

"use strict";
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* jshint maxlen: false */
const apirequest_1 = require("../../lib/apirequest");
/**
* Compute Engine API
*
* Creates and runs virtual machines on Google Cloud Platform.
*
* @example
* const google = require('googleapis');
* const compute = google.compute('beta');
*
* @namespace compute
* @type {Function}
* @version beta
* @variation beta
* @param {object=} options Options for Compute
*/
function Compute(options) {
const self = this;
self._options = options || {};
self.acceleratorTypes = {
/**
* compute.acceleratorTypes.aggregatedList
*
* @desc Retrieves an aggregated list of accelerator types.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.acceleratorTypes.aggregatedList(request, handlePage);
* }
* };
*
* compute.acceleratorTypes.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.acceleratorTypes.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/acceleratorTypes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.acceleratorTypes.get
*
* @desc Returns the specified accelerator type. Get a list of available accelerator types by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the accelerator type to return.
* acceleratorType: 'my-accelerator-type', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.acceleratorTypes.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.acceleratorTypes.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.acceleratorType Name of the accelerator type to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'acceleratorType'],
pathParams: ['acceleratorType', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.acceleratorTypes.list
*
* @desc Retrieves a list of accelerator types available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.acceleratorTypes.list(request, handlePage);
* }
* };
*
* compute.acceleratorTypes.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.acceleratorTypes.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/acceleratorTypes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.addresses = {
/**
* compute.addresses.aggregatedList
*
* @desc Retrieves an aggregated list of addresses.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.addresses.aggregatedList(request, handlePage);
* }
* };
*
* compute.addresses.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/addresses').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.addresses.delete
*
* @desc Deletes the specified address resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the address resource to delete.
* address: 'my-address', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.addresses.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.address Name of the address resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/addresses/{address}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'address'],
pathParams: ['address', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.addresses.get
*
* @desc Returns the specified address resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the address resource to return.
* address: 'my-address', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.addresses.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.address Name of the address resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/addresses/{address}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'address'],
pathParams: ['address', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.addresses.insert
*
* @desc Creates an address resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.addresses.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Address} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/addresses').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.addresses.list
*
* @desc Retrieves a list of addresses contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.addresses.list(request, handlePage);
* }
* };
*
* compute.addresses.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/addresses').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.addresses.setLabels
*
* @desc Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.addresses.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).RegionSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/addresses/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.addresses.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.addresses.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.addresses.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/addresses/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.autoscalers = {
/**
* compute.autoscalers.aggregatedList
*
* @desc Retrieves an aggregated list of autoscalers.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.autoscalers.aggregatedList(request, handlePage);
* }
* };
*
* compute.autoscalers.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.delete
*
* @desc Deletes the specified autoscaler.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the autoscaler to delete.
* autoscaler: 'my-autoscaler', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.autoscalers.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.autoscaler Name of the autoscaler to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone Name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{autoscaler}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'autoscaler'],
pathParams: ['autoscaler', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.get
*
* @desc Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the autoscaler to return.
* autoscaler: 'my-autoscaler', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.autoscalers.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.autoscaler Name of the autoscaler to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{autoscaler}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'autoscaler'],
pathParams: ['autoscaler', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.insert
*
* @desc Creates an autoscaler in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.autoscalers.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone Name of the zone for this request.
* @param {compute(beta).Autoscaler} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.list
*
* @desc Retrieves a list of autoscalers contained within the specified zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.autoscalers.list(request, handlePage);
* }
* };
*
* compute.autoscalers.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.autoscalers.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.autoscaler Name of the autoscaler to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone Name of the zone for this request.
* @param {compute(beta).Autoscaler} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.autoscalers.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.autoscalers.update
*
* @desc Updates an autoscaler in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.autoscalers.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.autoscalers.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.autoscaler Name of the autoscaler to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone Name of the zone for this request.
* @param {compute(beta).Autoscaler} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.backendBuckets = {
/**
* compute.backendBuckets.delete
*
* @desc Deletes the specified BackendBucket resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendBucket resource to delete.
* backendBucket: 'my-backend-bucket', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.backendBuckets.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendBuckets.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendBucket Name of the BackendBucket resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'backendBucket'],
pathParams: ['backendBucket', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendBuckets.get
*
* @desc Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendBucket resource to return.
* backendBucket: 'my-backend-bucket', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.backendBuckets.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendBuckets.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendBucket Name of the BackendBucket resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'backendBucket'],
pathParams: ['backendBucket', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendBuckets.insert
*
* @desc Creates a BackendBucket resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.backendBuckets.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendBuckets.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendBucket} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendBuckets').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendBuckets.list
*
* @desc Retrieves the list of BackendBucket resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.backendBuckets.list(request, handlePage);
* }
* };
*
* compute.backendBuckets.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendBuckets.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendBuckets').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendBuckets.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendBucket resource to patch.
* backendBucket: 'my-backend-bucket', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.backendBuckets.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendBuckets.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendBucket Name of the BackendBucket resource to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendBucket} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'backendBucket'],
pathParams: ['backendBucket', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendBuckets.update
*
* @desc Updates the specified BackendBucket resource with the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendBucket resource to update.
* backendBucket: 'my-backend-bucket', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.backendBuckets.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendBuckets.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendBucket Name of the BackendBucket resource to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendBucket} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'backendBucket'],
pathParams: ['backendBucket', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.backendServices = {
/**
* compute.backendServices.aggregatedList
*
* @desc Retrieves the list of all BackendService resources, regional and global, available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Name of the project scoping this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.backendServices.aggregatedList(request, handlePage);
* }
* };
*
* compute.backendServices.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Name of the project scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/backendServices').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.delete
*
* @desc Deletes the specified BackendService resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to delete.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.backendServices.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'backendService'],
pathParams: ['backendService', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.get
*
* @desc Returns the specified BackendService resource. Get a list of available backend services by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to return.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.backendServices.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'backendService'],
pathParams: ['backendService', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.getHealth
*
* @desc Gets the most recent health check results for this BackendService.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to which the queried instance belongs.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.backendServices.getHealth(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.getHealth
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs.
* @param {string} params.project
* @param {compute(beta).ResourceGroupReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getHealth: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{backendService}/getHealth').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'backendService'],
pathParams: ['backendService', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.insert
*
* @desc Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.backendServices.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendService} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.list
*
* @desc Retrieves the list of BackendService resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.backendServices.list(request, handlePage);
* }
* };
*
* compute.backendServices.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.patch
*
* @desc Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to patch.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.backendServices.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendService} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'backendService'],
pathParams: ['backendService', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.setSecurityPolicy
*
* @desc Sets the security policy for the specified backend service.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to which the security policy should be set. The name should
* // conform to RFC1035.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.backendServices.setSecurityPolicy(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.setSecurityPolicy
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).SecurityPolicyReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setSecurityPolicy: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{backendService}/setSecurityPolicy').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'backendService'],
pathParams: ['backendService', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.backendServices.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.backendServices.update
*
* @desc Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to update.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.backendServices.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.backendServices.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendService} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'backendService'],
pathParams: ['backendService', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.diskTypes = {
/**
* compute.diskTypes.aggregatedList
*
* @desc Retrieves an aggregated list of disk types.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.diskTypes.aggregatedList(request, handlePage);
* }
* };
*
* compute.diskTypes.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.diskTypes.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/diskTypes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.diskTypes.get
*
* @desc Returns the specified disk type. Get a list of available disk types by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the disk type to return.
* diskType: 'my-disk-type', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.diskTypes.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.diskTypes.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.diskType Name of the disk type to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/diskTypes/{diskType}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'diskType'],
pathParams: ['diskType', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.diskTypes.list
*
* @desc Retrieves a list of disk types available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.diskTypes.list(request, handlePage);
* }
* };
*
* compute.diskTypes.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.diskTypes.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/diskTypes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.disks = {
/**
* compute.disks.aggregatedList
*
* @desc Retrieves an aggregated list of persistent disks.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.disks.aggregatedList(request, handlePage);
* }
* };
*
* compute.disks.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/disks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.createSnapshot
*
* @desc Creates a snapshot of a specified persistent disk.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the persistent disk to snapshot.
* disk: 'my-disk', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.disks.createSnapshot(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.createSnapshot
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.disk Name of the persistent disk to snapshot.
* @param {boolean=} params.guestFlush
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).Snapshot} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
createSnapshot: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'disk'],
pathParams: ['disk', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.delete
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the persistent disk to delete.
* disk: 'my-disk', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.disks.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.disk Name of the persistent disk to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'disk'],
pathParams: ['disk', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.get
*
* @desc Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the persistent disk to return.
* disk: 'my-disk', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.disks.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.disk Name of the persistent disk to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'disk'],
pathParams: ['disk', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.insert
*
* @desc Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.disks.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string=} params.sourceImage Optional. Source image to restore onto a disk.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).Disk} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.list
*
* @desc Retrieves a list of persistent disks contained within the specified zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.disks.list(request, handlePage);
* }
* };
*
* compute.disks.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.resize
*
* @desc Resizes the specified persistent disk.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the persistent disk.
* disk: 'my-disk', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.disks.resize(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.resize
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.disk The name of the persistent disk.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).DisksResizeRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
resize: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}/resize').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'disk'],
pathParams: ['disk', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.setLabels
*
* @desc Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.disks.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).ZoneSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.disks.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.disks.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.disks.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.firewalls = {
/**
* compute.firewalls.delete
*
* @desc Deletes the specified firewall.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the firewall rule to delete.
* firewall: 'my-firewall', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.firewalls.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.firewall Name of the firewall rule to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls/{firewall}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'firewall'],
pathParams: ['firewall', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.firewalls.get
*
* @desc Returns the specified firewall.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the firewall rule to return.
* firewall: 'my-firewall', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.firewalls.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.firewall Name of the firewall rule to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls/{firewall}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'firewall'],
pathParams: ['firewall', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.firewalls.insert
*
* @desc Creates a firewall rule in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.firewalls.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Firewall} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.firewalls.list
*
* @desc Retrieves the list of firewall rules available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.firewalls.list(request, handlePage);
* }
* };
*
* compute.firewalls.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.firewalls.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the firewall rule to patch.
* firewall: 'my-firewall', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.firewalls.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.firewall Name of the firewall rule to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Firewall} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls/{firewall}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'firewall'],
pathParams: ['firewall', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.firewalls.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.firewalls.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.firewalls.update
*
* @desc Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the firewall rule to update.
* firewall: 'my-firewall', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.firewalls.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.firewalls.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.firewall Name of the firewall rule to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Firewall} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls/{firewall}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'firewall'],
pathParams: ['firewall', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.forwardingRules = {
/**
* compute.forwardingRules.aggregatedList
*
* @desc Retrieves an aggregated list of forwarding rules.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.forwardingRules.aggregatedList(request, handlePage);
* }
* };
*
* compute.forwardingRules.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/forwardingRules').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.delete
*
* @desc Deletes the specified ForwardingRule resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the ForwardingRule resource to delete.
* forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.forwardingRules.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.forwardingRule Name of the ForwardingRule resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'forwardingRule'],
pathParams: ['forwardingRule', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.get
*
* @desc Returns the specified ForwardingRule resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the ForwardingRule resource to return.
* forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.forwardingRules.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.forwardingRule Name of the ForwardingRule resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'forwardingRule'],
pathParams: ['forwardingRule', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.insert
*
* @desc Creates a ForwardingRule resource in the specified project and region using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.forwardingRules.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).ForwardingRule} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.list
*
* @desc Retrieves a list of ForwardingRule resources available to the specified project and region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.forwardingRules.list(request, handlePage);
* }
* };
*
* compute.forwardingRules.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.setLabels
*
* @desc Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.forwardingRules.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).RegionSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.setTarget
*
* @desc Changes target URL for forwarding rule. The new target should be of the same type as the old target.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the ForwardingRule resource in which target is to be set.
* forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.forwardingRules.setTarget(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.setTarget
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setTarget: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'forwardingRule'],
pathParams: ['forwardingRule', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.forwardingRules.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.forwardingRules.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.forwardingRules.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.globalAddresses = {
/**
* compute.globalAddresses.delete
*
* @desc Deletes the specified address resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the address resource to delete.
* address: 'my-address', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.globalAddresses.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalAddresses.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.address Name of the address resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/addresses/{address}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'address'],
pathParams: ['address', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalAddresses.get
*
* @desc Returns the specified address resource. Get a list of available addresses by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the address resource to return.
* address: 'my-address', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.globalAddresses.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalAddresses.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.address Name of the address resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/addresses/{address}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'address'],
pathParams: ['address', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalAddresses.insert
*
* @desc Creates an address resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalAddresses.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalAddresses.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Address} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/addresses').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalAddresses.list
*
* @desc Retrieves a list of global addresses.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.globalAddresses.list(request, handlePage);
* }
* };
*
* compute.globalAddresses.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalAddresses.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/addresses').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalAddresses.setLabels
*
* @desc Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalAddresses.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalAddresses.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).GlobalSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/addresses/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalAddresses.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalAddresses.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalAddresses.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/addresses/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.globalForwardingRules = {
/**
* compute.globalForwardingRules.delete
*
* @desc Deletes the specified GlobalForwardingRule resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the ForwardingRule resource to delete.
* forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.globalForwardingRules.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.forwardingRule Name of the ForwardingRule resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'forwardingRule'],
pathParams: ['forwardingRule', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalForwardingRules.get
*
* @desc Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the ForwardingRule resource to return.
* forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.globalForwardingRules.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.forwardingRule Name of the ForwardingRule resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'forwardingRule'],
pathParams: ['forwardingRule', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalForwardingRules.insert
*
* @desc Creates a GlobalForwardingRule resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalForwardingRules.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).ForwardingRule} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalForwardingRules.list
*
* @desc Retrieves a list of GlobalForwardingRule resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.globalForwardingRules.list(request, handlePage);
* }
* };
*
* compute.globalForwardingRules.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalForwardingRules.setLabels
*
* @desc Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalForwardingRules.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).GlobalSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalForwardingRules.setTarget
*
* @desc Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the ForwardingRule resource in which target is to be set.
* forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalForwardingRules.setTarget(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.setTarget
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setTarget: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'forwardingRule'],
pathParams: ['forwardingRule', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalForwardingRules.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.globalForwardingRules.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalForwardingRules.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/forwardingRules/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.globalOperations = {
/**
* compute.globalOperations.aggregatedList
*
* @desc Retrieves an aggregated list of all operations.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.globalOperations.aggregatedList(request, handlePage);
* }
* };
*
* compute.globalOperations.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalOperations.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/operations').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalOperations.delete
*
* @desc Deletes the specified Operations resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the Operations resource to delete.
* operation: 'my-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.globalOperations.delete(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalOperations.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.operation Name of the Operations resource to delete.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/operations/{operation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'operation'],
pathParams: ['operation', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalOperations.get
*
* @desc Retrieves the specified Operations resource. Get a list of operations by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the Operations resource to return.
* operation: 'my-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.globalOperations.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalOperations.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.operation Name of the Operations resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/operations/{operation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'operation'],
pathParams: ['operation', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.globalOperations.list
*
* @desc Retrieves a list of Operation resources contained within the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.globalOperations.list(request, handlePage);
* }
* };
*
* compute.globalOperations.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.globalOperations.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/operations').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.healthChecks = {
/**
* compute.healthChecks.delete
*
* @desc Deletes the specified HealthCheck resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HealthCheck resource to delete.
* healthCheck: 'my-health-check', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.healthChecks.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.healthCheck Name of the HealthCheck resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'healthCheck'],
pathParams: ['healthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.healthChecks.get
*
* @desc Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HealthCheck resource to return.
* healthCheck: 'my-health-check', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.healthChecks.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.healthCheck Name of the HealthCheck resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'healthCheck'],
pathParams: ['healthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.healthChecks.insert
*
* @desc Creates a HealthCheck resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.healthChecks.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.healthChecks.list
*
* @desc Retrieves the list of HealthCheck resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.healthChecks.list(request, handlePage);
* }
* };
*
* compute.healthChecks.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.healthChecks.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HealthCheck resource to patch.
* healthCheck: 'my-health-check', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.healthChecks.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.healthCheck Name of the HealthCheck resource to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'healthCheck'],
pathParams: ['healthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.healthChecks.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.healthChecks.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.healthChecks.update
*
* @desc Updates a HealthCheck resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HealthCheck resource to update.
* healthCheck: 'my-health-check', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.healthChecks.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.healthChecks.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.healthCheck Name of the HealthCheck resource to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'healthCheck'],
pathParams: ['healthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.httpHealthChecks = {
/**
* compute.httpHealthChecks.delete
*
* @desc Deletes the specified HttpHealthCheck resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpHealthCheck resource to delete.
* httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.httpHealthChecks.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'httpHealthCheck'],
pathParams: ['httpHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpHealthChecks.get
*
* @desc Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpHealthCheck resource to return.
* httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.httpHealthChecks.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'httpHealthCheck'],
pathParams: ['httpHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpHealthChecks.insert
*
* @desc Creates a HttpHealthCheck resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.httpHealthChecks.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HttpHealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpHealthChecks.list
*
* @desc Retrieves the list of HttpHealthCheck resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.httpHealthChecks.list(request, handlePage);
* }
* };
*
* compute.httpHealthChecks.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpHealthChecks.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpHealthCheck resource to patch.
* httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.httpHealthChecks.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HttpHealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'httpHealthCheck'],
pathParams: ['httpHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpHealthChecks.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.httpHealthChecks.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpHealthChecks.update
*
* @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpHealthCheck resource to update.
* httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.httpHealthChecks.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpHealthChecks.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HttpHealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'httpHealthCheck'],
pathParams: ['httpHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.httpsHealthChecks = {
/**
* compute.httpsHealthChecks.delete
*
* @desc Deletes the specified HttpsHealthCheck resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpsHealthCheck resource to delete.
* httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.httpsHealthChecks.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'httpsHealthCheck'],
pathParams: ['httpsHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpsHealthChecks.get
*
* @desc Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpsHealthCheck resource to return.
* httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.httpsHealthChecks.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'httpsHealthCheck'],
pathParams: ['httpsHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpsHealthChecks.insert
*
* @desc Creates a HttpsHealthCheck resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.httpsHealthChecks.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HttpsHealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpsHealthChecks.list
*
* @desc Retrieves the list of HttpsHealthCheck resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.httpsHealthChecks.list(request, handlePage);
* }
* };
*
* compute.httpsHealthChecks.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpsHealthChecks.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpsHealthCheck resource to patch.
* httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.httpsHealthChecks.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HttpsHealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'httpsHealthCheck'],
pathParams: ['httpsHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpsHealthChecks.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.httpsHealthChecks.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.httpsHealthChecks.update
*
* @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the HttpsHealthCheck resource to update.
* httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.httpsHealthChecks.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.httpsHealthChecks.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).HttpsHealthCheck} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'httpsHealthCheck'],
pathParams: ['httpsHealthCheck', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.images = {
/**
* compute.images.delete
*
* @desc Deletes the specified image.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the image resource to delete.
* image: 'my-image', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.images.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.image Name of the image resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images/{image}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'image'],
pathParams: ['image', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.deprecate
*
* @desc Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Image name.
* image: 'my-image', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.images.deprecate(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.deprecate
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.image Image name.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).DeprecationStatus} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
deprecate: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images/{image}/deprecate').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'image'],
pathParams: ['image', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.get
*
* @desc Returns the specified image. Get a list of available images by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the image resource to return.
* image: 'my-image', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.images.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.image Name of the image resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images/{image}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'image'],
pathParams: ['image', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.getFromFamily
*
* @desc Returns the latest image that is part of an image family and is not deprecated.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the image family to search for.
* family: 'my-family', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.images.getFromFamily(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.getFromFamily
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.family Name of the image family to search for.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getFromFamily: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images/family/{family}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'family'],
pathParams: ['family', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.insert
*
* @desc Creates an image in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.images.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {boolean=} params.forceCreate Force image creation if true.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Image} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.list
*
* @desc Retrieves the list of private images available to the specified project. Private 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.images.list(request, handlePage);
* }
* };
*
* compute.images.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.setLabels
*
* @desc Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.images.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).GlobalSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.images.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.images.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.images.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/images/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.instanceGroupManagers = {
/**
* compute.instanceGroupManagers.abandonInstances
*
* @desc Schedules a group action to remove the specified instances 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.abandonInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.abandonInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
abandonInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.aggregatedList
*
* @desc Retrieves the list of managed instance groups and groups them by zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceGroupManagers.aggregatedList(request, handlePage);
* }
* };
*
* compute.instanceGroupManagers.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/instanceGroupManagers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.delete
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group to delete.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.deleteInstances
*
* @desc Schedules a group action to delete the specified instances in the managed instance group. 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.deleteInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.deleteInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
deleteInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.get
*
* @desc Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.insert
*
* @desc Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where you want to create the managed instance group.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where you want to create the managed instance group.
* @param {compute(beta).InstanceGroupManager} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.list
*
* @desc Retrieves a list of managed instance groups that are contained within the specified project and zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceGroupManagers.list(request, handlePage);
* }
* };
*
* compute.instanceGroupManagers.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.listManagedInstances
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var managedInstancesPage = response['managedInstances'];
* if (!managedInstancesPage) {
* return;
* }
* for (var i = 0; i < managedInstancesPage.length; i++) {
* // TODO: Change code below to process each resource in `managedInstancesPage`:
* console.log(JSON.stringify(managedInstancesPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceGroupManagers.listManagedInstances(request, handlePage);
* }
* };
*
* compute.instanceGroupManagers.listManagedInstances(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.listManagedInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {integer=} params.maxResults
* @param {string=} params.order_by
* @param {string=} params.pageToken
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
listManagedInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where you want to create the managed instance group.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group manager.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the instance group manager.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where you want to create the managed instance group.
* @param {compute(beta).InstanceGroupManager} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.recreateInstances
*
* @desc Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.recreateInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.recreateInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
recreateInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.resize
*
* @desc 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. 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* // The number of running instances that the managed instance group should maintain at any given time.
* // The group automatically adds or removes instances to maintain the number of instances specified by
* // this parameter.
* size: 0, // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.resize(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.resize
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
resize: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.resizeAdvanced
*
* @desc Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method. If you increase the size of the instance group, 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, creatingWithoutRetries, or deleting actions with the get or 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.resizeAdvanced(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.resizeAdvanced
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersResizeAdvancedRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
resizeAdvanced: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.setAutoHealingPolicies
*
* @desc Modifies the autohealing policies.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group manager.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.setAutoHealingPolicies(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.setAutoHealingPolicies
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the instance group manager.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersSetAutoHealingRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setAutoHealingPolicies: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.setInstanceTemplate
*
* @desc 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 recreate them.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.setInstanceTemplate(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.setInstanceTemplate
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setInstanceTemplate: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.setTargetPools
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the managed instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.setTargetPools(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.setTargetPools
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the managed instance group is located.
* @param {compute(beta).InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setTargetPools: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroupManagers.update
*
* @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where you want to create the managed instance group.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group manager.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroupManagers.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroupManagers.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the instance group manager.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where you want to create the managed instance group.
* @param {compute(beta).InstanceGroupManager} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.instanceGroups = {
/**
* compute.instanceGroups.addInstances
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group where you are adding instances.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroups.addInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.addInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup The name of the instance group where you are adding instances.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {compute(beta).InstanceGroupsAddInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
addInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.aggregatedList
*
* @desc Retrieves the list of instance groups and sorts them by zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceGroups.aggregatedList(request, handlePage);
* }
* };
*
* compute.instanceGroups.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/instanceGroups').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.delete
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group to delete.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceGroups.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup The name of the instance group to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.get
*
* @desc Returns the specified instance group. Get a list of available instance groups by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceGroups.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup The name of the instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.insert
*
* @desc Creates an instance group in the specified project using the parameters that are included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where you want to create the instance group.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroups.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where you want to create the instance group.
* @param {compute(beta).InstanceGroup} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.list
*
* @desc Retrieves the list of instance groups that are located in the specified project and zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceGroups.list(request, handlePage);
* }
* };
*
* compute.instanceGroups.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.listInstances
*
* @desc Lists the instances in the specified instance group.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group from which you want to generate a list of included instances.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceGroups.listInstances(request, handlePage);
* }
* };
*
* compute.instanceGroups.listInstances(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.listInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {compute(beta).InstanceGroupsListInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
listInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.removeInstances
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group where the specified instances will be removed.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroups.removeInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.removeInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {compute(beta).InstanceGroupsRemoveInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
removeInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.setNamedPorts
*
* @desc Sets the named ports for the specified instance group.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone where the instance group is located.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The name of the instance group where the named ports are updated.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroups.setNamedPorts(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.setNamedPorts
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup The name of the instance group where the named ports are updated.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone where the instance group is located.
* @param {compute(beta).InstanceGroupsSetNamedPortsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setNamedPorts: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceGroups.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceGroups.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceGroups.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.instanceTemplates = {
/**
* compute.instanceTemplates.delete
*
* @desc Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the instance template to delete.
* instanceTemplate: 'my-instance-template', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceTemplates.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceTemplates.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceTemplate The name of the instance template to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/instanceTemplates/{instanceTemplate}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'instanceTemplate'],
pathParams: ['instanceTemplate', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceTemplates.get
*
* @desc Returns the specified instance template. Get a list of available instance templates by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the instance template.
* instanceTemplate: 'my-instance-template', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instanceTemplates.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceTemplates.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceTemplate The name of the instance template.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/instanceTemplates/{instanceTemplate}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'instanceTemplate'],
pathParams: ['instanceTemplate', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceTemplates.insert
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceTemplates.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceTemplates.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).InstanceTemplate} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/instanceTemplates').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceTemplates.list
*
* @desc Retrieves a list of instance templates that are contained within the specified project and zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instanceTemplates.list(request, handlePage);
* }
* };
*
* compute.instanceTemplates.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceTemplates.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/instanceTemplates').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instanceTemplates.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instanceTemplates.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instanceTemplates.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.instances = {
/**
* compute.instances.addAccessConfig
*
* @desc Adds an access config to an instance's network interface.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The instance name for this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* // The name of the network interface to add to this instance.
* networkInterface: '', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.addAccessConfig(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.addAccessConfig
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance The instance name for this request.
* @param {string} params.networkInterface The name of the network interface to add to this instance.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).AccessConfig} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
addAccessConfig: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance', 'networkInterface'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.aggregatedList
*
* @desc Retrieves aggregated list of instances.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instances.aggregatedList(request, handlePage);
* }
* };
*
* compute.instances.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/instances').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.attachDisk
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The instance name for this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.attachDisk(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.attachDisk
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance The instance name for this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).AttachedDisk} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
attachDisk: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/attachDisk').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.delete
*
* @desc Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance resource to delete.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.deleteAccessConfig
*
* @desc Deletes an access config from an instance's network interface.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The instance name for this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* // The name of the access config to delete.
* accessConfig: '', // TODO: Update placeholder value.
*
* // The name of the network interface.
* networkInterface: '', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.deleteAccessConfig(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.deleteAccessConfig
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.accessConfig The name of the access config to delete.
* @param {string} params.instance The instance name for this request.
* @param {string} params.networkInterface The name of the network interface.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
deleteAccessConfig: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.detachDisk
*
* @desc Detaches a disk from an instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Instance name.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* // Disk device name to detach.
* deviceName: '', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.detachDisk(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.detachDisk
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.deviceName Disk device name to detach.
* @param {string} params.instance Instance name.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
detachDisk: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/detachDisk').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance', 'deviceName'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.get
*
* @desc Returns the specified Instance resource. Get a list of available instances by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance resource to return.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.getSerialPortOutput
*
* @desc Returns the specified instance's serial port output.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.getSerialPortOutput(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.getSerialPortOutput
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {integer=} params.port Specifies which COM or serial port to retrieve data from.
* @param {string} params.project Project ID for this request.
* @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getSerialPortOutput: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/serialPort').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.insert
*
* @desc Creates an instance resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).Instance} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.list
*
* @desc Retrieves the list of instances contained within the specified zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instances.list(request, handlePage);
* }
* };
*
* compute.instances.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.listReferrers
*
* @desc Retrieves the list of referrers to instances contained within the specified zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the target instance scoping this request, or '-' if the request should span over all
* // instances in the container.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.instances.listReferrers(request, handlePage);
* }
* };
*
* compute.instances.listReferrers(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.listReferrers
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
listReferrers: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/referrers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.reset
*
* @desc Performs a reset on the instance. For more information, see Resetting an instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.reset(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.reset
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
reset: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/reset').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setDiskAutoDelete
*
* @desc Sets the auto-delete flag for a disk attached to an instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // The instance name.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* // Whether to auto-delete the disk when the instance is deleted.
* autoDelete: false, // TODO: Update placeholder value.
*
* // The device name of the disk to modify.
* deviceName: '', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.setDiskAutoDelete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setDiskAutoDelete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted.
* @param {string} params.deviceName The device name of the disk to modify.
* @param {string} params.instance The instance name.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setDiskAutoDelete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance', 'autoDelete', 'deviceName'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setLabels
*
* @desc Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).InstancesSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setMachineResources
*
* @desc Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setMachineResources(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setMachineResources
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).InstancesSetMachineResourcesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setMachineResources: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setMachineType
*
* @desc Changes the machine type for a stopped instance to the machine type specified in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setMachineType(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setMachineType
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).InstancesSetMachineTypeRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setMachineType: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMachineType').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setMetadata
*
* @desc Sets metadata for the specified instance to the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setMetadata(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setMetadata
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).Metadata} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setMetadata: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMetadata').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setMinCpuPlatform
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setMinCpuPlatform(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setMinCpuPlatform
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).InstancesSetMinCpuPlatformRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setMinCpuPlatform: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setScheduling
*
* @desc Sets an instance's scheduling options.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Instance name.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setScheduling(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setScheduling
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Instance name.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).Scheduling} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setScheduling: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setScheduling').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setServiceAccount
*
* @desc Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance resource to start.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setServiceAccount(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setServiceAccount
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance resource to start.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).InstancesSetServiceAccountRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setServiceAccount: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.setTags
*
* @desc Sets tags for the specified instance to the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance scoping this request.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.setTags(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.setTags
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance scoping this request.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).Tags} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setTags: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setTags').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.start
*
* @desc Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance resource to start.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.start(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.start
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance resource to start.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
start: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/start').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.startWithEncryptionKey
*
* @desc Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance resource to start.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.startWithEncryptionKey(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.startWithEncryptionKey
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance resource to start.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).InstancesStartWithEncryptionKeyRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
startWithEncryptionKey: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.stop
*
* @desc Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the instance resource to stop.
* instance: 'my-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.instances.stop(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.stop
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance Name of the instance resource to stop.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
stop: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/stop').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.instances.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.instances.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.updateAccessConfig
*
* @desc 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.
*
* @alias compute.instances.updateAccessConfig
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance The instance name for this request.
* @param {string} params.networkInterface The name of the network interface where the access config is attached.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).AccessConfig} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
updateAccessConfig: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance', 'networkInterface'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.instances.updateNetworkInterface
*
* @desc Updates an instance's network interface. This method follows PATCH semantics.
*
* @alias compute.instances.updateNetworkInterface
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instance The instance name for this request.
* @param {string} params.networkInterface The name of the network interface to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).NetworkInterface} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
updateNetworkInterface: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'zone', 'instance', 'networkInterface'],
pathParams: ['instance', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.interconnectAttachments = {
/**
* compute.interconnectAttachments.aggregatedList
*
* @desc Retrieves an aggregated list of interconnect attachments.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.interconnectAttachments.aggregatedList(request, handlePage);
* }
* };
*
* compute.interconnectAttachments.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectAttachments.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/interconnectAttachments').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnectAttachments.delete
*
* @desc Deletes the specified interconnect attachment.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the interconnect attachment to delete.
* interconnectAttachment: 'my-interconnect-attachment', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.interconnectAttachments.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectAttachments.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.interconnectAttachment Name of the interconnect attachment to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'interconnectAttachment'],
pathParams: ['interconnectAttachment', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnectAttachments.get
*
* @desc Returns the specified interconnect attachment.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the interconnect attachment to return.
* interconnectAttachment: 'my-interconnect-attachment', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.interconnectAttachments.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectAttachments.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.interconnectAttachment Name of the interconnect attachment to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'interconnectAttachment'],
pathParams: ['interconnectAttachment', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnectAttachments.insert
*
* @desc Creates an InterconnectAttachment in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.interconnectAttachments.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectAttachments.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).InterconnectAttachment} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnectAttachments.list
*
* @desc Retrieves the list of interconnect attachments contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.interconnectAttachments.list(request, handlePage);
* }
* };
*
* compute.interconnectAttachments.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectAttachments.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnectAttachments.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.interconnectAttachments.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectAttachments.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.interconnectLocations = {
/**
* compute.interconnectLocations.get
*
* @desc Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the interconnect location to return.
* interconnectLocation: 'my-interconnect-location', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.interconnectLocations.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectLocations.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.interconnectLocation Name of the interconnect location to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnectLocations/{interconnectLocation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'interconnectLocation'],
pathParams: ['interconnectLocation', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnectLocations.list
*
* @desc Retrieves the list of interconnect locations available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.interconnectLocations.list(request, handlePage);
* }
* };
*
* compute.interconnectLocations.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnectLocations.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnectLocations').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.interconnects = {
/**
* compute.interconnects.delete
*
* @desc Deletes the specified interconnect.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the interconnect to delete.
* interconnect: 'my-interconnect', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.interconnects.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnects.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.interconnect Name of the interconnect to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnects/{interconnect}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'interconnect'],
pathParams: ['interconnect', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnects.get
*
* @desc Returns the specified interconnect. Get a list of available interconnects by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the interconnect to return.
* interconnect: 'my-interconnect', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.interconnects.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnects.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.interconnect Name of the interconnect to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnects/{interconnect}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'interconnect'],
pathParams: ['interconnect', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnects.insert
*
* @desc Creates a Interconnect in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.interconnects.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnects.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Interconnect} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnects').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnects.list
*
* @desc Retrieves the list of interconnect available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.interconnects.list(request, handlePage);
* }
* };
*
* compute.interconnects.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnects.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnects').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnects.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the interconnect to update.
* interconnect: 'my-interconnect', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.interconnects.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnects.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.interconnect Name of the interconnect to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Interconnect} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnects/{interconnect}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'interconnect'],
pathParams: ['interconnect', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.interconnects.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.interconnects.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.interconnects.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/interconnects/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.licenses = {
/**
* compute.licenses.get
*
* @desc Returns the specified License resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the License resource to return.
* license: 'my-license', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.licenses.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.licenses.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.license Name of the License resource to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/licenses/{license}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'license'],
pathParams: ['license', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.machineTypes = {
/**
* compute.machineTypes.aggregatedList
*
* @desc Retrieves an aggregated list of machine types.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.machineTypes.aggregatedList(request, handlePage);
* }
* };
*
* compute.machineTypes.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.machineTypes.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/machineTypes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.machineTypes.get
*
* @desc Returns the specified machine type. Get a list of available machine types by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the machine type to return.
* machineType: 'my-machine-type', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.machineTypes.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.machineTypes.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.machineType Name of the machine type to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/machineTypes/{machineType}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'machineType'],
pathParams: ['machineType', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.machineTypes.list
*
* @desc Retrieves a list of machine types available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.machineTypes.list(request, handlePage);
* }
* };
*
* compute.machineTypes.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.machineTypes.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/machineTypes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.networks = {
/**
* compute.networks.addPeering
*
* @desc Adds a peering to the specified network.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the network resource to add peering to.
* network: 'my-network', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.networks.addPeering(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.addPeering
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.network Name of the network resource to add peering to.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).NetworksAddPeeringRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
addPeering: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{network}/addPeering').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'network'],
pathParams: ['network', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.delete
*
* @desc Deletes the specified network.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the network to delete.
* network: 'my-network', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.networks.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.network Name of the network to delete.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{network}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'network'],
pathParams: ['network', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.get
*
* @desc Returns the specified network. Get a list of available networks by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the network to return.
* network: 'my-network', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.networks.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.network Name of the network to return.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{network}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'network'],
pathParams: ['network', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.insert
*
* @desc Creates a network in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.networks.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Network} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.list
*
* @desc Retrieves the list of networks available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.networks.list(request, handlePage);
* }
* };
*
* compute.networks.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.patch
*
* @desc Patches the specified network with the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the network to update.
* network: 'my-network', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.networks.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.network Name of the network to update.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Network} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{network}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'network'],
pathParams: ['network', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.removePeering
*
* @desc Removes a peering from the specified network.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the network resource to remove peering from.
* network: 'my-network', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.networks.removePeering(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.removePeering
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.network Name of the network resource to remove peering from.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).NetworksRemovePeeringRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
removePeering: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{network}/removePeering').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'network'],
pathParams: ['network', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.switchToCustomMode
*
* @desc Switches the network mode from auto subnet mode to custom subnet mode.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the network to be updated.
* network: 'my-network', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.networks.switchToCustomMode(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.switchToCustomMode
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.network Name of the network to be updated.
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
switchToCustomMode: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{network}/switchToCustomMode').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'network'],
pathParams: ['network', 'project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.networks.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.networks.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.networks.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/networks/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.projects = {
/**
* compute.projects.disableXpnHost
*
* @desc Disable this project as a shared VPC host project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.projects.disableXpnHost(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.disableXpnHost
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
disableXpnHost: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/disableXpnHost').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.disableXpnResource
*
* @desc Disable a serivce resource (a.k.a service project) associated with this host project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.projects.disableXpnResource(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.disableXpnResource
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).ProjectsDisableXpnResourceRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
disableXpnResource: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/disableXpnResource').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.enableXpnHost
*
* @desc Enable this project as a shared VPC host project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.projects.enableXpnHost(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.enableXpnHost
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
enableXpnHost: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/enableXpnHost').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.enableXpnResource
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.projects.enableXpnResource(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.enableXpnResource
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).ProjectsEnableXpnResourceRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
enableXpnResource: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/enableXpnResource').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.get
*
* @desc Returns the specified Project resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.projects.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.getXpnHost
*
* @desc Get the shared VPC host project that this project links to. May be empty if no link exists.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.projects.getXpnHost(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.getXpnHost
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getXpnHost: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/getXpnHost').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.getXpnResources
*
* @desc Get service resources (a.k.a service project) associated with this host project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var resourcesPage = response['resources'];
* if (!resourcesPage) {
* return;
* }
* for (var i = 0; i < resourcesPage.length; i++) {
* // TODO: Change code below to process each resource in `resourcesPage`:
* console.log(JSON.stringify(resourcesPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.projects.getXpnResources(request, handlePage);
* }
* };
*
* compute.projects.getXpnResources(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.getXpnResources
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter
* @param {integer=} params.maxResults
* @param {string=} params.order_by
* @param {string=} params.pageToken
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getXpnResources: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/getXpnResources').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.listXpnHosts
*
* @desc List all shared VPC host projects visible to the user in an organization.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.projects.listXpnHosts(request, handlePage);
* }
* };
*
* compute.projects.listXpnHosts(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.listXpnHosts
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter
* @param {integer=} params.maxResults
* @param {string=} params.order_by
* @param {string=} params.pageToken
* @param {string} params.project Project ID for this request.
* @param {compute(beta).ProjectsListXpnHostsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
listXpnHosts: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/listXpnHosts').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.moveDisk
*
* @desc Moves a persistent disk from one zone to another.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.projects.moveDisk(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.moveDisk
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).DiskMoveRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
moveDisk: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/moveDisk').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.moveInstance
*
* @desc Moves an instance and its attached persistent disks from one zone to another.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.projects.moveInstance(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.moveInstance
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).InstanceMoveRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
moveInstance: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/moveInstance').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.setCommonInstanceMetadata
*
* @desc Sets metadata common to all instances within the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.projects.setCommonInstanceMetadata(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.setCommonInstanceMetadata
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Metadata} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setCommonInstanceMetadata: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/setCommonInstanceMetadata').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.projects.setUsageExportBucket
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.projects.setUsageExportBucket(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.projects.setUsageExportBucket
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).UsageExportLocation} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setUsageExportBucket: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/setUsageExportBucket').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regionAutoscalers = {
/**
* compute.regionAutoscalers.delete
*
* @desc Deletes the specified autoscaler.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the autoscaler to delete.
* autoscaler: 'my-autoscaler', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionAutoscalers.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.autoscaler Name of the autoscaler to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers/{autoscaler}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'autoscaler'],
pathParams: ['autoscaler', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionAutoscalers.get
*
* @desc Returns the specified autoscaler.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the autoscaler to return.
* autoscaler: 'my-autoscaler', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionAutoscalers.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.autoscaler Name of the autoscaler to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers/{autoscaler}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'autoscaler'],
pathParams: ['autoscaler', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionAutoscalers.insert
*
* @desc Creates an autoscaler in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionAutoscalers.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Autoscaler} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionAutoscalers.list
*
* @desc Retrieves a list of autoscalers contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionAutoscalers.list(request, handlePage);
* }
* };
*
* compute.regionAutoscalers.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionAutoscalers.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.regionAutoscalers.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.autoscaler Name of the autoscaler to patch.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Autoscaler} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionAutoscalers.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionAutoscalers.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionAutoscalers.update
*
* @desc Updates an autoscaler in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.regionAutoscalers.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionAutoscalers.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.autoscaler Name of the autoscaler to update.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Autoscaler} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/autoscalers').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regionBackendServices = {
/**
* compute.regionBackendServices.delete
*
* @desc Deletes the specified regional BackendService resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to delete.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionBackendServices.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'backendService'],
pathParams: ['backendService', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.get
*
* @desc Returns the specified regional BackendService resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to return.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionBackendServices.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'backendService'],
pathParams: ['backendService', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.getHealth
*
* @desc Gets the most recent health check results for this regional BackendService.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to which the queried instance belongs.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionBackendServices.getHealth(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.getHealth
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs.
* @param {string} params.project
* @param {string} params.region Name of the region scoping this request.
* @param {compute(beta).ResourceGroupReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getHealth: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'backendService'],
pathParams: ['backendService', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.insert
*
* @desc Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionBackendServices.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendService} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.list
*
* @desc Retrieves the list of regional BackendService resources available to the specified project in the given region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionBackendServices.list(request, handlePage);
* }
* };
*
* compute.regionBackendServices.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.patch
*
* @desc Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to patch.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.regionBackendServices.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to patch.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendService} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'region', 'backendService'],
pathParams: ['backendService', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionBackendServices.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionBackendServices.update
*
* @desc Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the BackendService resource to update.
* backendService: 'my-backend-service', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.regionBackendServices.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionBackendServices.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.backendService Name of the BackendService resource to update.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).BackendService} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'region', 'backendService'],
pathParams: ['backendService', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regionCommitments = {
/**
* compute.regionCommitments.aggregatedList
*
* @desc Retrieves an aggregated list of commitments.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionCommitments.aggregatedList(request, handlePage);
* }
* };
*
* compute.regionCommitments.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionCommitments.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/commitments').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionCommitments.get
*
* @desc Returns the specified commitment resource. Get a list of available commitments by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the commitment to return.
* commitment: 'my-commitment', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionCommitments.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionCommitments.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.commitment Name of the commitment to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/commitments/{commitment}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'commitment'],
pathParams: ['commitment', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionCommitments.insert
*
* @desc Creates a commitment in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionCommitments.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionCommitments.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Commitment} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/commitments').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionCommitments.list
*
* @desc Retrieves a list of commitments contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionCommitments.list(request, handlePage);
* }
* };
*
* compute.regionCommitments.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionCommitments.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/commitments').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regionInstanceGroupManagers = {
/**
* compute.regionInstanceGroupManagers.abandonInstances
*
* @desc Schedules a group action to remove the specified instances 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.abandonInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.abandonInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
abandonInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.delete
*
* @desc Deletes the specified managed instance group and all of the instances in that group.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group to delete.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.deleteInstances
*
* @desc Schedules a group action to delete the specified instances in the managed instance group. 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.deleteInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.deleteInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
deleteInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.get
*
* @desc Returns all of the details about the specified managed instance group.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group to return.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.insert
*
* @desc Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).InstanceGroupManager} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.list
*
* @desc Retrieves the list of managed instance groups that are contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionInstanceGroupManagers.list(request, handlePage);
* }
* };
*
* compute.regionInstanceGroupManagers.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.listManagedInstances
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var managedInstancesPage = response['managedInstances'];
* if (!managedInstancesPage) {
* return;
* }
* for (var i = 0; i < managedInstancesPage.length; i++) {
* // TODO: Change code below to process each resource in `managedInstancesPage`:
* console.log(JSON.stringify(managedInstancesPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionInstanceGroupManagers.listManagedInstances(request, handlePage);
* }
* };
*
* compute.regionInstanceGroupManagers.listManagedInstances(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.listManagedInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {integer=} params.maxResults
* @param {string=} params.order_by
* @param {string=} params.pageToken
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
listManagedInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // The name of the instance group manager.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the instance group manager.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).InstanceGroupManager} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.recreateInstances
*
* @desc Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.recreateInstances(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.recreateInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupManagersRecreateRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
recreateInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.resize
*
* @desc Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* // Number of instances that should exist in this instance group manager.
* size: 0, // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.resize(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.resize
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {integer} params.size Number of instances that should exist in this instance group manager.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
resize: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager', 'size'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.setAutoHealingPolicies
*
* @desc Modifies the autohealing policy for the instances in this managed instance group.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.setAutoHealingPolicies(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupManagersSetAutoHealingRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setAutoHealingPolicies: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.setInstanceTemplate
*
* @desc Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // The name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.setInstanceTemplate(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.setInstanceTemplate
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setInstanceTemplate: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.setTargetPools
*
* @desc Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the managed instance group.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.setTargetPools(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.setTargetPools
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager Name of the managed instance group.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setTargetPools: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroupManagers.update
*
* @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listmanagedinstances method.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // The name of the instance group manager.
* instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroupManagers.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroupManagers.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroupManager The name of the instance group manager.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).InstanceGroupManager} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroupManager'],
pathParams: ['instanceGroupManager', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regionInstanceGroups = {
/**
* compute.regionInstanceGroups.get
*
* @desc Returns the specified instance group resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the instance group resource to return.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionInstanceGroups.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroups.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup Name of the instance group resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroups.list
*
* @desc Retrieves the list of instance group resources contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionInstanceGroups.list(request, handlePage);
* }
* };
*
* compute.regionInstanceGroups.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroups.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroups').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroups.listInstances
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the regional instance group for which we want to list the instances.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionInstanceGroups.listInstances(request, handlePage);
* }
* };
*
* compute.regionInstanceGroups.listInstances(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroups.listInstances
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {compute(beta).RegionInstanceGroupsListInstancesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
listInstances: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroups.setNamedPorts
*
* @desc Sets the named ports for the specified regional instance group.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // The name of the regional instance group where the named ports are updated.
* instanceGroup: 'my-instance-group', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroups.setNamedPorts(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroups.setNamedPorts
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setNamedPorts: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'instanceGroup'],
pathParams: ['instanceGroup', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionInstanceGroups.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.regionInstanceGroups.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionInstanceGroups.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regionOperations = {
/**
* compute.regionOperations.delete
*
* @desc Deletes the specified region-specific Operations resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Operations resource to delete.
* operation: 'my-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionOperations.delete(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionOperations.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.operation Name of the Operations resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/operations/{operation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'operation'],
pathParams: ['operation', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionOperations.get
*
* @desc Retrieves the specified region-specific Operations resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Operations resource to return.
* operation: 'my-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regionOperations.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionOperations.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.operation Name of the Operations resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/operations/{operation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'operation'],
pathParams: ['operation', 'project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regionOperations.list
*
* @desc Retrieves a list of Operation resources contained within the specified region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regionOperations.list(request, handlePage);
* }
* };
*
* compute.regionOperations.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regionOperations.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/operations').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.regions = {
/**
* compute.regions.get
*
* @desc Returns the specified Region resource. Get a list of available regions by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region resource to return.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.regions.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regions.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.regions.list
*
* @desc Retrieves the list of region resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.regions.list(request, handlePage);
* }
* };
*
* compute.regions.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.regions.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.routers = {
/**
* compute.routers.aggregatedList
*
* @desc Retrieves an aggregated list of routers.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.routers.aggregatedList(request, handlePage);
* }
* };
*
* compute.routers.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/routers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.delete
*
* @desc Deletes the specified Router resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Router resource to delete.
* router: 'my-router', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.routers.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.router Name of the Router resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{router}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'router'],
pathParams: ['project', 'region', 'router'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.get
*
* @desc Returns the specified Router resource. Get a list of available routers by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Router resource to return.
* router: 'my-router', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.routers.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string} params.router Name of the Router resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{router}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'router'],
pathParams: ['project', 'region', 'router'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.getRouterStatus
*
* @desc Retrieves runtime information of the specified router.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Router resource to query.
* router: 'my-router', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.routers.getRouterStatus(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.getRouterStatus
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string} params.router Name of the Router resource to query.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getRouterStatus: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{router}/getRouterStatus').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'router'],
pathParams: ['project', 'region', 'router'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.insert
*
* @desc Creates a Router resource in the specified project and region using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.routers.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Router} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.list
*
* @desc Retrieves a list of Router resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.routers.list(request, handlePage);
* }
* };
*
* compute.routers.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Router resource to patch.
* router: 'my-router', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.routers.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.router Name of the Router resource to patch.
* @param {compute(beta).Router} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{router}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'region', 'router'],
pathParams: ['project', 'region', 'router'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.preview
*
* @desc Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Router resource to query.
* router: 'my-router', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.routers.preview(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.preview
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string} params.router Name of the Router resource to query.
* @param {compute(beta).Router} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
preview: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{router}/preview').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'router'],
pathParams: ['project', 'region', 'router'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.routers.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routers.update
*
* @desc Updates the specified Router resource with the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Router resource to update.
* router: 'my-router', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.routers.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routers.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.router Name of the Router resource to update.
* @param {compute(beta).Router} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/routers/{router}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'region', 'router'],
pathParams: ['project', 'region', 'router'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.routes = {
/**
* compute.routes.delete
*
* @desc Deletes the specified Route resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the Route resource to delete.
* route: 'my-route', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.routes.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routes.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.route Name of the Route resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/routes/{route}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'route'],
pathParams: ['project', 'route'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routes.get
*
* @desc Returns the specified Route resource. Get a list of available routes by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the Route resource to return.
* route: 'my-route', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.routes.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routes.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.route Name of the Route resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/routes/{route}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'route'],
pathParams: ['project', 'route'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routes.insert
*
* @desc Creates a Route resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.routes.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routes.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Route} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/routes').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routes.list
*
* @desc Retrieves the list of Route resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.routes.list(request, handlePage);
* }
* };
*
* compute.routes.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routes.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/routes').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.routes.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.routes.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.routes.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/routes/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.securityPolicies = {
/**
* compute.securityPolicies.delete
*
* @desc Deletes the specified policy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the security policy to delete.
* securityPolicy: 'my-security-policy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.securityPolicies.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.securityPolicies.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.securityPolicy Name of the security policy to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'securityPolicy'],
pathParams: ['project', 'securityPolicy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.securityPolicies.get
*
* @desc List all of the ordered rules present in a single specified policy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the security policy to get.
* securityPolicy: 'my-security-policy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.securityPolicies.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.securityPolicies.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.securityPolicy Name of the security policy to get.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'securityPolicy'],
pathParams: ['project', 'securityPolicy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.securityPolicies.insert
*
* @desc Creates a new policy in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.securityPolicies.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.securityPolicies.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).SecurityPolicy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/securityPolicies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.securityPolicies.list
*
* @desc List all the policies that have been configured for the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.securityPolicies.list(request, handlePage);
* }
* };
*
* compute.securityPolicies.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.securityPolicies.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/securityPolicies').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.securityPolicies.patch
*
* @desc Patches the specified policy with the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the security policy to update.
* securityPolicy: 'my-security-policy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.securityPolicies.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.securityPolicies.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.securityPolicy Name of the security policy to update.
* @param {compute(beta).SecurityPolicy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'securityPolicy'],
pathParams: ['project', 'securityPolicy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.securityPolicies.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.securityPolicies.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.securityPolicies.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/securityPolicies/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.snapshots = {
/**
* compute.snapshots.delete
*
* @desc 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 snaphots.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the Snapshot resource to delete.
* snapshot: 'my-snapshot', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.snapshots.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.snapshots.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.snapshot Name of the Snapshot resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/snapshots/{snapshot}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'snapshot'],
pathParams: ['project', 'snapshot'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.snapshots.get
*
* @desc Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the Snapshot resource to return.
* snapshot: 'my-snapshot', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.snapshots.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.snapshots.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.snapshot Name of the Snapshot resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/snapshots/{snapshot}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'snapshot'],
pathParams: ['project', 'snapshot'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.snapshots.list
*
* @desc Retrieves the list of Snapshot resources contained within the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.snapshots.list(request, handlePage);
* }
* };
*
* compute.snapshots.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.snapshots.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/snapshots').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.snapshots.setLabels
*
* @desc Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.snapshots.setLabels(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.snapshots.setLabels
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).GlobalSetLabelsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setLabels: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/snapshots/{resource}/setLabels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.snapshots.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.snapshots.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.snapshots.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/snapshots/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.sslCertificates = {
/**
* compute.sslCertificates.delete
*
* @desc Deletes the specified SslCertificate resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the SslCertificate resource to delete.
* sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.sslCertificates.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.sslCertificates.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.sslCertificate Name of the SslCertificate resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/sslCertificates/{sslCertificate}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'sslCertificate'],
pathParams: ['project', 'sslCertificate'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.sslCertificates.get
*
* @desc Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the SslCertificate resource to return.
* sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.sslCertificates.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.sslCertificates.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.sslCertificate Name of the SslCertificate resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/sslCertificates/{sslCertificate}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'sslCertificate'],
pathParams: ['project', 'sslCertificate'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.sslCertificates.insert
*
* @desc Creates a SslCertificate resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.sslCertificates.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.sslCertificates.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).SslCertificate} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/sslCertificates').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.sslCertificates.list
*
* @desc Retrieves the list of SslCertificate resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.sslCertificates.list(request, handlePage);
* }
* };
*
* compute.sslCertificates.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.sslCertificates.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/sslCertificates').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.sslCertificates.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.sslCertificates.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.sslCertificates.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/sslCertificates/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.subnetworks = {
/**
* compute.subnetworks.aggregatedList
*
* @desc Retrieves an aggregated list of subnetworks.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.subnetworks.aggregatedList(request, handlePage);
* }
* };
*
* compute.subnetworks.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/subnetworks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.delete
*
* @desc Deletes the specified subnetwork.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Subnetwork resource to delete.
* subnetwork: 'my-subnetwork', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.subnetworks.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.subnetwork Name of the Subnetwork resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'subnetwork'],
pathParams: ['project', 'region', 'subnetwork'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.expandIpCidrRange
*
* @desc Expands the IP CIDR range of the subnetwork to a specified value.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Subnetwork resource to update.
* subnetwork: 'my-subnetwork', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.subnetworks.expandIpCidrRange(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.expandIpCidrRange
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.subnetwork Name of the Subnetwork resource to update.
* @param {compute(beta).SubnetworksExpandIpCidrRangeRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
expandIpCidrRange: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'subnetwork'],
pathParams: ['project', 'region', 'subnetwork'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.get
*
* @desc Returns the specified subnetwork. Get a list of available subnetworks list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Subnetwork resource to return.
* subnetwork: 'my-subnetwork', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.subnetworks.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string} params.subnetwork Name of the Subnetwork resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'subnetwork'],
pathParams: ['project', 'region', 'subnetwork'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.getIamPolicy
*
* @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.subnetworks.getIamPolicy(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.getIamPolicy
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getIamPolicy: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.insert
*
* @desc Creates a subnetwork in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.subnetworks.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).Subnetwork} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.list
*
* @desc Retrieves a list of subnetworks available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.subnetworks.list(request, handlePage);
* }
* };
*
* compute.subnetworks.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.patch
*
* @desc Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.
*
* @alias compute.subnetworks.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.subnetwork Name of the Subnetwork resource to patch.
* @param {compute(beta).Subnetwork} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'region', 'subnetwork'],
pathParams: ['project', 'region', 'subnetwork'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.setIamPolicy
*
* @desc Sets the access control policy on the specified resource. Replaces any existing policy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.subnetworks.setIamPolicy(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.setIamPolicy
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).Policy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setIamPolicy: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.setPrivateIpGoogleAccess
*
* @desc Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the Subnetwork resource.
* subnetwork: 'my-subnetwork', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.setPrivateIpGoogleAccess
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.subnetwork Name of the Subnetwork resource.
* @param {compute(beta).SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setPrivateIpGoogleAccess: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'subnetwork'],
pathParams: ['project', 'region', 'subnetwork'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.subnetworks.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.subnetworks.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.subnetworks.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetHttpProxies = {
/**
* compute.targetHttpProxies.delete
*
* @desc Deletes the specified TargetHttpProxy resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpProxy resource to delete.
* targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetHttpProxies.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpProxies.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpProxies/{targetHttpProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'targetHttpProxy'],
pathParams: ['project', 'targetHttpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpProxies.get
*
* @desc Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpProxy resource to return.
* targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetHttpProxies.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpProxies.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpProxies/{targetHttpProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'targetHttpProxy'],
pathParams: ['project', 'targetHttpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpProxies.insert
*
* @desc Creates a TargetHttpProxy resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpProxies.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpProxies.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetHttpProxy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpProxies.list
*
* @desc Retrieves the list of TargetHttpProxy resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetHttpProxies.list(request, handlePage);
* }
* };
*
* compute.targetHttpProxies.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpProxies.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpProxies.setUrlMap
*
* @desc Changes the URL map for TargetHttpProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpProxy to set a URL map for.
* targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpProxies.setUrlMap(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpProxies.setUrlMap
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for.
* @param {compute(beta).UrlMapReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setUrlMap: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetHttpProxy'],
pathParams: ['project', 'targetHttpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpProxies.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpProxies.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpProxies.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpProxies/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetHttpsProxies = {
/**
* compute.targetHttpsProxies.delete
*
* @desc Deletes the specified TargetHttpsProxy resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpsProxy resource to delete.
* targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetHttpsProxies.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'targetHttpsProxy'],
pathParams: ['project', 'targetHttpsProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpsProxies.get
*
* @desc Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpsProxy resource to return.
* targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetHttpsProxies.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'targetHttpsProxy'],
pathParams: ['project', 'targetHttpsProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpsProxies.insert
*
* @desc Creates a TargetHttpsProxy resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpsProxies.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetHttpsProxy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpsProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpsProxies.list
*
* @desc Retrieves the list of TargetHttpsProxy resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetHttpsProxies.list(request, handlePage);
* }
* };
*
* compute.targetHttpsProxies.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpsProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpsProxies.setSslCertificates
*
* @desc Replaces SslCertificates for TargetHttpsProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpsProxy resource to set an SslCertificates resource for.
* targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpsProxies.setSslCertificates(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.setSslCertificates
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for.
* @param {compute(beta).TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setSslCertificates: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetHttpsProxy'],
pathParams: ['project', 'targetHttpsProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpsProxies.setUrlMap
*
* @desc Changes the URL map for TargetHttpsProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetHttpsProxy resource whose URL map is to be set.
* targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpsProxies.setUrlMap(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.setUrlMap
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set.
* @param {compute(beta).UrlMapReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setUrlMap: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetHttpsProxy'],
pathParams: ['project', 'targetHttpsProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetHttpsProxies.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetHttpsProxies.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetHttpsProxies.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetHttpsProxies/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetInstances = {
/**
* compute.targetInstances.aggregatedList
*
* @desc Retrieves an aggregated list of target instances.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetInstances.aggregatedList(request, handlePage);
* }
* };
*
* compute.targetInstances.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetInstances.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/targetInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetInstances.delete
*
* @desc Deletes the specified TargetInstance resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone scoping this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the TargetInstance resource to delete.
* targetInstance: 'my-target-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetInstances.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetInstances.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetInstance Name of the TargetInstance resource to delete.
* @param {string} params.zone Name of the zone scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{targetInstance}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'targetInstance'],
pathParams: ['project', 'targetInstance', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetInstances.get
*
* @desc Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone scoping this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the TargetInstance resource to return.
* targetInstance: 'my-target-instance', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetInstances.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetInstances.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.targetInstance Name of the TargetInstance resource to return.
* @param {string} params.zone Name of the zone scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{targetInstance}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'targetInstance'],
pathParams: ['project', 'targetInstance', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetInstances.insert
*
* @desc Creates a TargetInstance resource in the specified project and zone using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone scoping this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetInstances.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetInstances.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.zone Name of the zone scoping this request.
* @param {compute(beta).TargetInstance} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/targetInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetInstances.list
*
* @desc Retrieves a list of TargetInstance resources available to the specified project and zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone scoping this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetInstances.list(request, handlePage);
* }
* };
*
* compute.targetInstances.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetInstances.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/targetInstances').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetInstances.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetInstances.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetInstances.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {string} params.zone The name of the zone for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'zone', 'resource'],
pathParams: ['project', 'resource', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetPools = {
/**
* compute.targetPools.addHealthCheck
*
* @desc Adds health check URLs to a target pool.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the target pool to add a health check to.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.addHealthCheck(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.addHealthCheck
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetPool Name of the target pool to add a health check to.
* @param {compute(beta).TargetPoolsAddHealthCheckRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
addHealthCheck: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.addInstance
*
* @desc Adds an instance to a target pool.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the TargetPool resource to add instances to.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.addInstance(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.addInstance
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetPool Name of the TargetPool resource to add instances to.
* @param {compute(beta).TargetPoolsAddInstanceRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
addInstance: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.aggregatedList
*
* @desc Retrieves an aggregated list of target pools.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetPools.aggregatedList(request, handlePage);
* }
* };
*
* compute.targetPools.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/targetPools').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.delete
*
* @desc Deletes the specified target pool.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the TargetPool resource to delete.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetPools.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetPool Name of the TargetPool resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.get
*
* @desc Returns the specified target pool. Get a list of available target pools by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the TargetPool resource to return.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetPools.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string} params.targetPool Name of the TargetPool resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.getHealth
*
* @desc Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the TargetPool resource to which the queried instance belongs.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.getHealth(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.getHealth
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs.
* @param {compute(beta).InstanceReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getHealth: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.insert
*
* @desc Creates a target pool in the specified project and region using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetPool} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.list
*
* @desc Retrieves a list of target pools available to the specified project and region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetPools.list(request, handlePage);
* }
* };
*
* compute.targetPools.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.removeHealthCheck
*
* @desc Removes health check URL from a target pool.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the target pool to remove health checks from.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.removeHealthCheck(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.removeHealthCheck
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetPool Name of the target pool to remove health checks from.
* @param {compute(beta).TargetPoolsRemoveHealthCheckRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
removeHealthCheck: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.removeInstance
*
* @desc Removes instance URL from a target pool.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the TargetPool resource to remove instances from.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.removeInstance(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.removeInstance
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetPool Name of the TargetPool resource to remove instances from.
* @param {compute(beta).TargetPoolsRemoveInstanceRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
removeInstance: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.setBackup
*
* @desc Changes a backup target pool's configurations.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region scoping this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the TargetPool resource to set a backup pool for.
* targetPool: 'my-target-pool', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.setBackup(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.setBackup
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {number=} params.failoverRatio New failoverRatio value for the target pool.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region scoping this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for.
* @param {compute(beta).TargetReference} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setBackup: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetPool'],
pathParams: ['project', 'region', 'targetPool'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetPools.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetPools.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetPools.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetPools/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetSslProxies = {
/**
* compute.targetSslProxies.delete
*
* @desc Deletes the specified TargetSslProxy resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetSslProxy resource to delete.
* targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetSslProxies.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'targetSslProxy'],
pathParams: ['project', 'targetSslProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.get
*
* @desc Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetSslProxy resource to return.
* targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetSslProxies.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'targetSslProxy'],
pathParams: ['project', 'targetSslProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.insert
*
* @desc Creates a TargetSslProxy resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetSslProxies.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetSslProxy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.list
*
* @desc Retrieves the list of TargetSslProxy resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetSslProxies.list(request, handlePage);
* }
* };
*
* compute.targetSslProxies.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.setBackendService
*
* @desc Changes the BackendService for TargetSslProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetSslProxy resource whose BackendService resource is to be set.
* targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetSslProxies.setBackendService(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.setBackendService
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set.
* @param {compute(beta).TargetSslProxiesSetBackendServiceRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setBackendService: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetSslProxy'],
pathParams: ['project', 'targetSslProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.setProxyHeader
*
* @desc Changes the ProxyHeaderType for TargetSslProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetSslProxy resource whose ProxyHeader is to be set.
* targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetSslProxies.setProxyHeader(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.setProxyHeader
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set.
* @param {compute(beta).TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setProxyHeader: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetSslProxy'],
pathParams: ['project', 'targetSslProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.setSslCertificates
*
* @desc Changes SslCertificates for TargetSslProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetSslProxy resource whose SslCertificate resource is to be set.
* targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetSslProxies.setSslCertificates(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.setSslCertificates
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set.
* @param {compute(beta).TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setSslCertificates: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetSslProxy'],
pathParams: ['project', 'targetSslProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetSslProxies.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetSslProxies.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetSslProxies.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetSslProxies/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetTcpProxies = {
/**
* compute.targetTcpProxies.delete
*
* @desc Deletes the specified TargetTcpProxy resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetTcpProxy resource to delete.
* targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetTcpProxies.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetTcpProxies.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'targetTcpProxy'],
pathParams: ['project', 'targetTcpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetTcpProxies.get
*
* @desc Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetTcpProxy resource to return.
* targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetTcpProxies.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetTcpProxies.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'targetTcpProxy'],
pathParams: ['project', 'targetTcpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetTcpProxies.insert
*
* @desc Creates a TargetTcpProxy resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetTcpProxies.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetTcpProxies.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetTcpProxy} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetTcpProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetTcpProxies.list
*
* @desc Retrieves the list of TargetTcpProxy resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetTcpProxies.list(request, handlePage);
* }
* };
*
* compute.targetTcpProxies.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetTcpProxies.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetTcpProxies').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetTcpProxies.setBackendService
*
* @desc Changes the BackendService for TargetTcpProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetTcpProxy resource whose BackendService resource is to be set.
* targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetTcpProxies.setBackendService(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetTcpProxies.setBackendService
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set.
* @param {compute(beta).TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setBackendService: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetTcpProxy'],
pathParams: ['project', 'targetTcpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetTcpProxies.setProxyHeader
*
* @desc Changes the ProxyHeaderType for TargetTcpProxy.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the TargetTcpProxy resource whose ProxyHeader is to be set.
* targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetTcpProxies.setProxyHeader(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetTcpProxies.setProxyHeader
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set.
* @param {compute(beta).TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setProxyHeader: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'targetTcpProxy'],
pathParams: ['project', 'targetTcpProxy'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.targetVpnGateways = {
/**
* compute.targetVpnGateways.aggregatedList
*
* @desc Retrieves an aggregated list of target VPN gateways.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetVpnGateways.aggregatedList(request, handlePage);
* }
* };
*
* compute.targetVpnGateways.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetVpnGateways.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/targetVpnGateways').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetVpnGateways.delete
*
* @desc Deletes the specified target VPN gateway.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the target VPN gateway to delete.
* targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetVpnGateways.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetVpnGateways.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.targetVpnGateway Name of the target VPN gateway to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetVpnGateway'],
pathParams: ['project', 'region', 'targetVpnGateway'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetVpnGateways.get
*
* @desc Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the target VPN gateway to return.
* targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.targetVpnGateways.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetVpnGateways.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string} params.targetVpnGateway Name of the target VPN gateway to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'targetVpnGateway'],
pathParams: ['project', 'region', 'targetVpnGateway'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetVpnGateways.insert
*
* @desc Creates a target VPN gateway in the specified project and region using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetVpnGateways.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetVpnGateways.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).TargetVpnGateway} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetVpnGateways.list
*
* @desc Retrieves a list of target VPN gateways available to the specified project and region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.targetVpnGateways.list(request, handlePage);
* }
* };
*
* compute.targetVpnGateways.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetVpnGateways.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.targetVpnGateways.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.targetVpnGateways.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.targetVpnGateways.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.urlMaps = {
/**
* compute.urlMaps.delete
*
* @desc Deletes the specified UrlMap resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the UrlMap resource to delete.
* urlMap: 'my-url-map', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.urlMaps.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.urlMap Name of the UrlMap resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'urlMap'],
pathParams: ['project', 'urlMap'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.get
*
* @desc Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the UrlMap resource to return.
* urlMap: 'my-url-map', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.urlMaps.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.urlMap Name of the UrlMap resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'urlMap'],
pathParams: ['project', 'urlMap'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.insert
*
* @desc Creates a UrlMap resource in the specified project using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.urlMaps.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).UrlMap} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.invalidateCache
*
* @desc Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the UrlMap scoping this request.
* urlMap: 'my-url-map', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.urlMaps.invalidateCache(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.invalidateCache
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.urlMap Name of the UrlMap scoping this request.
* @param {compute(beta).CacheInvalidationRule} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
invalidateCache: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}/invalidateCache').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'urlMap'],
pathParams: ['project', 'urlMap'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.list
*
* @desc Retrieves the list of UrlMap resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.urlMaps.list(request, handlePage);
* }
* };
*
* compute.urlMaps.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.patch
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the UrlMap resource to patch.
* urlMap: 'my-url-map', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. Only these properties
* // will be changed.
* },
*
* auth: authClient,
* };
*
* compute.urlMaps.patch(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.patch
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.urlMap Name of the UrlMap resource to patch.
* @param {compute(beta).UrlMap} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['project', 'urlMap'],
pathParams: ['project', 'urlMap'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.urlMaps.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'resource'],
pathParams: ['project', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.update
*
* @desc Updates the specified UrlMap resource with the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the UrlMap resource to update.
* urlMap: 'my-url-map', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body. All existing properties
* // will be replaced.
* },
*
* auth: authClient,
* };
*
* compute.urlMaps.update(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.update
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string=} params.requestId 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).
* @param {string} params.urlMap Name of the UrlMap resource to update.
* @param {compute(beta).UrlMap} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
update: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT'
}, options),
params: params,
requiredParams: ['project', 'urlMap'],
pathParams: ['project', 'urlMap'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.urlMaps.validate
*
* @desc 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.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the UrlMap resource to be validated as.
* urlMap: 'my-url-map', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.urlMaps.validate(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.urlMaps.validate
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.urlMap Name of the UrlMap resource to be validated as.
* @param {compute(beta).UrlMapsValidateRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
validate: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}/validate').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'urlMap'],
pathParams: ['project', 'urlMap'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.vpnTunnels = {
/**
* compute.vpnTunnels.aggregatedList
*
* @desc Retrieves an aggregated list of VPN tunnels.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* Object.keys(itemsPage).forEach(function(name) {
* // TODO: Change code below to process each `name` property:
* console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2));
* });
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.vpnTunnels.aggregatedList(request, handlePage);
* }
* };
*
* compute.vpnTunnels.aggregatedList(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.vpnTunnels.aggregatedList
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
aggregatedList: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/aggregated/vpnTunnels').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.vpnTunnels.delete
*
* @desc Deletes the specified VpnTunnel resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the VpnTunnel resource to delete.
* vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.vpnTunnels.delete(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.vpnTunnels.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'region', 'vpnTunnel'],
pathParams: ['project', 'region', 'vpnTunnel'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.vpnTunnels.get
*
* @desc Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the VpnTunnel resource to return.
* vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.vpnTunnels.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.vpnTunnels.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string} params.vpnTunnel Name of the VpnTunnel resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region', 'vpnTunnel'],
pathParams: ['project', 'region', 'vpnTunnel'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.vpnTunnels.insert
*
* @desc Creates a VpnTunnel resource in the specified project and region using the data included in the request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.vpnTunnels.insert(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.vpnTunnels.insert
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {string=} params.requestId 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).
* @param {compute(beta).VpnTunnel} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
insert: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.vpnTunnels.list
*
* @desc Retrieves a list of VpnTunnel resources contained in the specified project and region.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.vpnTunnels.list(request, handlePage);
* }
* };
*
* compute.vpnTunnels.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.vpnTunnels.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.region Name of the region for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'region'],
pathParams: ['project', 'region'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.vpnTunnels.testIamPermissions
*
* @desc Returns permissions that a caller has on the specified resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // The name of the region for this request.
* region: 'my-region', // TODO: Update placeholder value.
*
* // Name of the resource for this request.
* resource_: 'my-resource', // TODO: Update placeholder value.
*
* resource: {
* // TODO: Add desired properties to the request body.
* },
*
* auth: authClient,
* };
*
* compute.vpnTunnels.testIamPermissions(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.vpnTunnels.testIamPermissions
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.region The name of the region for this request.
* @param {string} params.resource_ Name of the resource for this request.
* @param {compute(beta).TestPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['project', 'region', 'resource'],
pathParams: ['project', 'region', 'resource'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.zoneOperations = {
/**
* compute.zoneOperations.delete
*
* @desc Deletes the specified zone-specific Operations resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the Operations resource to delete.
* operation: 'my-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.zoneOperations.delete(request, function(err) {
* if (err) {
* console.error(err);
* return;
* }
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.zoneOperations.delete
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.operation Name of the Operations resource to delete.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/operations/{operation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE'
}, options),
params: params,
requiredParams: ['project', 'zone', 'operation'],
pathParams: ['operation', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.zoneOperations.get
*
* @desc Retrieves the specified zone-specific Operations resource.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for this request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* // Name of the Operations resource to return.
* operation: 'my-operation', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.zoneOperations.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.zoneOperations.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.operation Name of the Operations resource to return.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/operations/{operation}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone', 'operation'],
pathParams: ['operation', 'project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.zoneOperations.list
*
* @desc Retrieves a list of Operation resources contained within the specified zone.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone for request.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.zoneOperations.list(request, handlePage);
* }
* };
*
* compute.zoneOperations.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.zoneOperations.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone for request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}/operations').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
self.zones = {
/**
* compute.zones.get
*
* @desc Returns the specified Zone resource. Get a list of available zones by making a list() request.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* // Name of the zone resource to return.
* zone: 'my-zone', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* compute.zones.get(request, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* // TODO: Change code below to process the `response` object:
* console.log(JSON.stringify(response, null, 2));
* });
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.zones.get
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string} params.project Project ID for this request.
* @param {string} params.zone Name of the zone resource to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project', 'zone'],
pathParams: ['project', 'zone'],
context: self
};
return apirequest_1.default(parameters, callback);
},
/**
* compute.zones.list
*
* @desc Retrieves the list of Zone resources available to the specified project.
*
* @example
* // BEFORE RUNNING:
* // ---------------
* // 1. If not already done, enable the Compute Engine API
* // and check the quota for your project at
* // https://console.developers.google.com/apis/api/compute
* // 2. This sample uses Application Default Credentials for authentication.
* // If not already done, install the gcloud CLI from
* // https://cloud.google.com/sdk and run
* // `gcloud beta auth application-default login`.
* // For more information, see
* // https://developers.google.com/identity/protocols/application-default-credentials
* // 3. Install the Node.js client library by running
* // `npm install googleapis --save`
*
* var google = require('googleapis');
* var compute = google.compute('beta');
*
* authorize(function(authClient) {
* var request = {
* // Project ID for this request.
* project: 'my-project', // TODO: Update placeholder value.
*
* auth: authClient,
* };
*
* var handlePage = function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
*
* var itemsPage = response['items'];
* if (!itemsPage) {
* return;
* }
* for (var i = 0; i < itemsPage.length; i++) {
* // TODO: Change code below to process each resource in `itemsPage`:
* console.log(JSON.stringify(itemsPage[i], null, 2));
* }
*
* if (response.nextPageToken) {
* request.pageToken = response.nextPageToken;
* compute.zones.list(request, handlePage);
* }
* };
*
* compute.zones.list(request, handlePage);
* });
*
* function authorize(callback) {
* google.auth.getApplicationDefault(function(err, authClient) {
* if (err) {
* console.error('authentication failed: ', err);
* return;
* }
* if (authClient.createScopedRequired && authClient.createScopedRequired()) {
* var scopes = ['https://www.googleapis.com/auth/cloud-platform'];
* authClient = authClient.createScoped(scopes);
* }
* callback(authClient);
* });
* }
*
* @alias compute.zones.list
* @memberOf! compute(beta)
*
* @param {object} params Parameters for request
* @param {string=} params.filter Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
* @param {integer=} params.maxResults 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)
* @param {string=} params.orderBy 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.
* @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
* @param {string} params.project Project ID for this request.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/compute/beta/projects/{project}/zones').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['project'],
pathParams: ['project'],
context: self
};
return apirequest_1.default(parameters, callback);
}
};
}
module.exports = Compute;
//# sourceMappingURL=beta.js.map