ApiGatewayServiceClient

ApiGatewayServiceClient

The API Gateway Service is the interface for managing API Gateways.

Constructor

new ApiGatewayServiceClient(optionsopt)

Construct an instance of ApiGatewayServiceClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. The options accepted by the constructor are described in detail in this document. The common options are:

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

clientConfig gax.ClientConfig <optional>

Client configuration override. Follows the structure of gapicConfig.

fallback boolean <optional>

Use HTTP fallback mode. In fallback mode, a special browser-compatible transport implementation is used instead of gRPC transport. In browser context (if the window object is defined) the fallback mode is enabled automatically; set options.fallback to false if you need to override this behavior.

Members

apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

port

The port for this API service.

scopes

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

The DNS address for this API service.

Methods

apiConfigPath(project, api, api_config) → {string}

Return a fully-qualified apiConfig resource name string.

Parameters:
Name Type Description
project string
api string
api_config string
Returns:
Type Description
string

Resource name string.

apiPath(project, api) → {string}

Return a fully-qualified api resource name string.

Parameters:
Name Type Description
project string
api string
Returns:
Type Description
string

Resource name string.

(async) checkCreateApiConfigProgress(name) → {Promise}

Check the status of the long running operation returned by createApiConfig().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkCreateApiConfigProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkCreateApiProgress(name) → {Promise}

Check the status of the long running operation returned by createApi().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkCreateApiProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkCreateGatewayProgress(name) → {Promise}

Check the status of the long running operation returned by createGateway().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkCreateGatewayProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkDeleteApiConfigProgress(name) → {Promise}

Check the status of the long running operation returned by deleteApiConfig().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkDeleteApiConfigProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkDeleteApiProgress(name) → {Promise}

Check the status of the long running operation returned by deleteApi().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkDeleteApiProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkDeleteGatewayProgress(name) → {Promise}

Check the status of the long running operation returned by deleteGateway().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkDeleteGatewayProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkUpdateApiConfigProgress(name) → {Promise}

Check the status of the long running operation returned by updateApiConfig().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkUpdateApiConfigProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkUpdateApiProgress(name) → {Promise}

Check the status of the long running operation returned by updateApi().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkUpdateApiProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

(async) checkUpdateGatewayProgress(name) → {Promise}

Check the status of the long running operation returned by updateGateway().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
const decodedOperation = await checkUpdateGatewayProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);

close() → {Promise}

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns:
Type Description
Promise

A promise that resolves when the client is closed.

createApi(request, optionsopt) → {Promise}

Creates a new Api in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API, of the form: projects/* /locations/global

apiId string

Required. Identifier to assign to the API. Must be unique within scope of the parent resource.

api google.cloud.apigateway.v1.Api

Required. API resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.createApi(request);
const [response] = await operation.promise();

createApiConfig(request, optionsopt) → {Promise}

Creates a new ApiConfig in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API Config, of the form: projects/* /locations/global/apis/*

apiConfigId string

Required. Identifier to assign to the API Config. Must be unique within scope of the parent resource.

apiConfig google.cloud.apigateway.v1.ApiConfig

Required. API resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.createApiConfig(request);
const [response] = await operation.promise();

createGateway(request, optionsopt) → {Promise}

Creates a new Gateway in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the Gateway, of the form: projects/* /locations/*

gatewayId string

Required. Identifier to assign to the Gateway. Must be unique within scope of the parent resource.

gateway google.cloud.apigateway.v1.Gateway

Required. Gateway resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.createGateway(request);
const [response] = await operation.promise();

deleteApi(request, optionsopt) → {Promise}

Deletes a single Api.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the form: projects/* /locations/global/apis/*

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.deleteApi(request);
const [response] = await operation.promise();

deleteApiConfig(request, optionsopt) → {Promise}

Deletes a single ApiConfig.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the form: projects/* /locations/global/apis/* /configs/*

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.deleteApiConfig(request);
const [response] = await operation.promise();

deleteGateway(request, optionsopt) → {Promise}

Deletes a single Gateway.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the form: projects/* /locations/* /gateways/*

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.deleteGateway(request);
const [response] = await operation.promise();

gatewayPath(project, location, gateway) → {string}

Return a fully-qualified gateway resource name string.

Parameters:
Name Type Description
project string
location string
gateway string
Returns:
Type Description
string

Resource name string.

getApi(request, optionsopt) → {Promise}

Gets details of a single Api.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the form: projects/* /locations/global/apis/*

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Api. Please see the documentation for more details and examples.
Example
const [response] = await client.getApi(request);

getApiConfig(request, optionsopt) → {Promise}

Gets details of a single ApiConfig.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the form: projects/* /locations/global/apis/* /configs/*

view google.cloud.apigateway.v1.GetApiConfigRequest.ConfigView

Specifies which fields of the API Config are returned in the response. Defaults to BASIC view.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing ApiConfig. Please see the documentation for more details and examples.
Example
const [response] = await client.getApiConfig(request);

getGateway(request, optionsopt) → {Promise}

Gets details of a single Gateway.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the form: projects/* /locations/* /gateways/*

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Gateway. Please see the documentation for more details and examples.
Example
const [response] = await client.getGateway(request);

getProjectId() → {Promise}

Return the project ID used by this class.

Returns:
Type Description
Promise

A promise that resolves to string containing the project ID.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns:
Type Description
Promise

A promise that resolves to an authenticated service stub.

listApiConfigs(request, optionsopt) → {Promise}

Lists ApiConfigs in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API Config, of the form: projects/* /locations/global/apis/*

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is Array of ApiConfig. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listApiConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listApiConfigsAsync(request, optionsopt) → {Object}

Equivalent to listApiConfigs, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API Config, of the form: projects/* /locations/global/apis/*

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ApiConfig. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
const iterable = client.listApiConfigsAsync(request);
for await (const response of iterable) {
  // process response
}

listApiConfigsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API Config, of the form: projects/* /locations/global/apis/*

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing ApiConfig on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listApiConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listApis(request, optionsopt) → {Promise}

Lists Apis in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API, of the form: projects/* /locations/global

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is Array of Api. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listApisAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listApisAsync(request, optionsopt) → {Object}

Equivalent to listApis, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API, of the form: projects/* /locations/global

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Api. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
const iterable = client.listApisAsync(request);
for await (const response of iterable) {
  // process response
}

listApisStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the API, of the form: projects/* /locations/global

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Api on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listApisAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listGateways(request, optionsopt) → {Promise}

Lists Gateways in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the Gateway, of the form: projects/* /locations/*

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is Array of Gateway. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listGatewaysAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listGatewaysAsync(request, optionsopt) → {Object}

Equivalent to listGateways, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the Gateway, of the form: projects/* /locations/*

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Gateway. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
const iterable = client.listGatewaysAsync(request);
for await (const response of iterable) {
  // process response
}

listGatewaysStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Parent resource of the Gateway, of the form: projects/* /locations/*

pageSize number

Page size.

pageToken string

Page token.

filter string

Filter.

orderBy string

Order by parameters.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Gateway on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listGatewaysAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchApiConfigFromApiConfigName(apiConfigName) → {string}

Parse the api_config from ApiConfig resource.

Parameters:
Name Type Description
apiConfigName string

A fully-qualified path representing ApiConfig resource.

Returns:
Type Description
string

A string representing the api_config.

matchApiFromApiConfigName(apiConfigName) → {string}

Parse the api from ApiConfig resource.

Parameters:
Name Type Description
apiConfigName string

A fully-qualified path representing ApiConfig resource.

Returns:
Type Description
string

A string representing the api.

matchApiFromApiName(apiName) → {string}

Parse the api from Api resource.

Parameters:
Name Type Description
apiName string

A fully-qualified path representing Api resource.

Returns:
Type Description
string

A string representing the api.

matchGatewayFromGatewayName(gatewayName) → {string}

Parse the gateway from Gateway resource.

Parameters:
Name Type Description
gatewayName string

A fully-qualified path representing Gateway resource.

Returns:
Type Description
string

A string representing the gateway.

matchLocationFromGatewayName(gatewayName) → {string}

Parse the location from Gateway resource.

Parameters:
Name Type Description
gatewayName string

A fully-qualified path representing Gateway resource.

Returns:
Type Description
string

A string representing the location.

matchProjectFromApiConfigName(apiConfigName) → {string}

Parse the project from ApiConfig resource.

Parameters:
Name Type Description
apiConfigName string

A fully-qualified path representing ApiConfig resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromApiName(apiName) → {string}

Parse the project from Api resource.

Parameters:
Name Type Description
apiName string

A fully-qualified path representing Api resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromGatewayName(gatewayName) → {string}

Parse the project from Gateway resource.

Parameters:
Name Type Description
gatewayName string

A fully-qualified path representing Gateway resource.

Returns:
Type Description
string

A string representing the project.

updateApi(request, optionsopt) → {Promise}

Updates the parameters of a single Api.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
updateMask google.protobuf.FieldMask

Field mask is used to specify the fields to be overwritten in the Api resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

api google.cloud.apigateway.v1.Api

Required. API resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.updateApi(request);
const [response] = await operation.promise();

updateApiConfig(request, optionsopt) → {Promise}

Updates the parameters of a single ApiConfig.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
updateMask google.protobuf.FieldMask

Field mask is used to specify the fields to be overwritten in the ApiConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

apiConfig google.cloud.apigateway.v1.ApiConfig

Required. API Config resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.updateApiConfig(request);
const [response] = await operation.promise();

updateGateway(request, optionsopt) → {Promise}

Updates the parameters of a single Gateway.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
updateMask google.protobuf.FieldMask

Field mask is used to specify the fields to be overwritten in the Gateway resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

gateway google.cloud.apigateway.v1.Gateway

Required. Gateway resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.
Example
const [operation] = await client.updateGateway(request);
const [response] = await operation.promise();