Constructor
new RoutersClient(optionsopt, gaxInstanceopt)
Construct an instance of RoutersClient.
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
|
||||||||||||||||||||||||||||||||||||||||||||||||
gaxInstance |
gax |
<optional> |
loaded instance of |
Members
apiEndpoint
The DNS address for this API service.
apiEndpoint
The DNS address for this API service - same as servicePath.
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
aggregatedListAsync(request, optionsopt) → {Object}
Retrieves an aggregated list of routers.
To prevent failure, Google recommends that you set the
returnPartialSuccess parameter to true.
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
|
||||||||||||||||||||||||||||
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 as tuple [string, RoutersScopedList]. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A filter expression that filters resources listed in the response. Most
* Compute resources support two types of filter expressions:
* expressions that support regular expressions and expressions that follow
* API improvement proposal AIP-160.
* These two types of filter expressions cannot be mixed in one request.
* If you want to use AIP-160, your expression must specify the field name, an
* operator, and the value that you want to use for filtering. The value
* must be a string, a number, or a boolean. The operator
* must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
* For example, if you are filtering Compute Engine instances, you can
* exclude instances named `example-instance` by specifying
* `name != example-instance`.
* The `:*` comparison can be used to test whether a key has been defined.
* For example, to find all objects with `owner` label use:
* ```
* labels.owner:*
* ```
* You can also filter nested fields. For example, you could specify
* `scheduling.automaticRestart = false` to include instances only
* if they are not scheduled for automatic restarts. You can use filtering
* on nested fields to filter based onresource labels.
* To filter on multiple expressions, provide each separate expression within
* parentheses. For example:
* ```
* (scheduling.automaticRestart = true)
* (cpuPlatform = "Intel Skylake")
* ```
* By default, each expression is an `AND` expression. However, you
* can include `AND` and `OR` expressions explicitly.
* For example:
* ```
* (cpuPlatform = "Intel Skylake") OR
* (cpuPlatform = "Intel Broadwell") AND
* (scheduling.automaticRestart = true)
* ```
* If you want to use a regular expression, use the `eq` (equal) or `ne`
* (not equal) operator against a single un-parenthesized expression with or
* without quotes or against multiple parenthesized expressions. Examples:
* `fieldname eq unquoted literal`
* `fieldname eq 'single quoted literal'`
* `fieldname eq "double quoted literal"`
* `(fieldname1 eq literal) (fieldname2 ne "literal")`
* The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
* The literal value must match the entire field.
* For example, to filter for instances that do not end with name "instance",
* you would use `name ne .*instance`.
* You cannot combine constraints on multiple fields using regular
* expressions.
*/
// const filter = 'abc123'
/**
* Indicates whether every visible scope for each scope type (zone, region,
* global) should be included in the response. For new resource types added
* after this field, the flag has no effect as new resource types will always
* include every visible scope for each scope type in response. For resource
* types which predate this field, if this flag is omitted or false, only
* scopes of the scope types where the resource type is expected to be found
* will be included.
*/
// const includeAllScopes = true
/**
* 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`)
*/
// const maxResults = 1234
/**
* 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.
*/
// const orderBy = 'abc123'
/**
* Specifies a page token to use. Set `pageToken` to the
* `nextPageToken` returned by a previous list request to get
* the next page of results.
*/
// const pageToken = 'abc123'
/**
* Project ID for this request.
*/
// const project = 'my-project'
/**
* Opt-in for partial success behavior which provides partial results in case
* of failure. The default value is false.
* For example, when partial success behavior is enabled, aggregatedList for a
* single zone scope either returns all resources in the zone or no resources,
* with an error code.
*/
// const returnPartialSuccess = true
/**
* The Shared VPC service project id or service project number for which
* aggregated list request is invoked for subnetworks list-usable api.
*/
// const serviceProjectNumber = 1234
// Imports the Compute library
const {RoutersClient} = require('@google-cloud/compute').v1beta;
// Instantiates a client
const computeClient = new RoutersClient();
async function callAggregatedList() {
// Construct request
const request = {
project,
};
// Run request
const iterable = computeClient.aggregatedListAsync(request);
for await (const [key, value] of iterable) {
console.log(response);
}
}
callAggregatedList();
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. |
getNatMappingInfoAsync(request, optionsopt) → {Object}
Equivalent to getNatMappingInfo, 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
|
|||||||||||||||||||||||||||||||
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 VmEndpointNatMappings. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A filter expression that filters resources listed in the response. Most
* Compute resources support two types of filter expressions:
* expressions that support regular expressions and expressions that follow
* API improvement proposal AIP-160.
* These two types of filter expressions cannot be mixed in one request.
* If you want to use AIP-160, your expression must specify the field name, an
* operator, and the value that you want to use for filtering. The value
* must be a string, a number, or a boolean. The operator
* must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
* For example, if you are filtering Compute Engine instances, you can
* exclude instances named `example-instance` by specifying
* `name != example-instance`.
* The `:*` comparison can be used to test whether a key has been defined.
* For example, to find all objects with `owner` label use:
* ```
* labels.owner:*
* ```
* You can also filter nested fields. For example, you could specify
* `scheduling.automaticRestart = false` to include instances only
* if they are not scheduled for automatic restarts. You can use filtering
* on nested fields to filter based onresource labels.
* To filter on multiple expressions, provide each separate expression within
* parentheses. For example:
* ```
* (scheduling.automaticRestart = true)
* (cpuPlatform = "Intel Skylake")
* ```
* By default, each expression is an `AND` expression. However, you
* can include `AND` and `OR` expressions explicitly.
* For example:
* ```
* (cpuPlatform = "Intel Skylake") OR
* (cpuPlatform = "Intel Broadwell") AND
* (scheduling.automaticRestart = true)
* ```
* If you want to use a regular expression, use the `eq` (equal) or `ne`
* (not equal) operator against a single un-parenthesized expression with or
* without quotes or against multiple parenthesized expressions. Examples:
* `fieldname eq unquoted literal`
* `fieldname eq 'single quoted literal'`
* `fieldname eq "double quoted literal"`
* `(fieldname1 eq literal) (fieldname2 ne "literal")`
* The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
* The literal value must match the entire field.
* For example, to filter for instances that do not end with name "instance",
* you would use `name ne .*instance`.
* You cannot combine constraints on multiple fields using regular
* expressions.
*/
// const filter = 'abc123'
/**
* 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`)
*/
// const maxResults = 1234
/**
* Name of the nat service to filter the Nat Mapping information.
* If it is omitted, all nats for this router will be returned.
* Name should conform to RFC1035.
*/
// const natName = 'abc123'
/**
* 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.
*/
// const orderBy = 'abc123'
/**
* Specifies a page token to use. Set `pageToken` to the
* `nextPageToken` returned by a previous list request to get
* the next page of results.
*/
// const pageToken = 'abc123'
/**
* Project ID for this request.
*/
// const project = 'my-project'
/**
* Name of the region for this request.
*/
// const region = 'us-central1'
/**
* Opt-in for partial success behavior which provides partial results in case
* of failure. The default value is false.
* For example, when partial success behavior is enabled, aggregatedList for a
* single zone scope either returns all resources in the zone or no resources,
* with an error code.
*/
// const returnPartialSuccess = true
/**
* Name of the Router resource to query for Nat Mapping information of
* VM endpoints.
*/
// const router = 'abc123'
// Imports the Compute library
const {RoutersClient} = require('@google-cloud/compute').v1beta;
// Instantiates a client
const computeClient = new RoutersClient();
async function callGetNatMappingInfo() {
// Construct request
const request = {
project,
region,
router,
};
// Run request
const iterable = computeClient.getNatMappingInfoAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callGetNatMappingInfo();
getNatMappingInfoStream(request, optionsopt) → {Stream}
Equivalent to getNatMappingInfo, but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing VmEndpointNatMappings 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 |
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. |
listAsync(request, optionsopt) → {Object}
Equivalent to list, 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
|
|||||||||||||||||||||||||
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 Router. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A filter expression that filters resources listed in the response. Most
* Compute resources support two types of filter expressions:
* expressions that support regular expressions and expressions that follow
* API improvement proposal AIP-160.
* These two types of filter expressions cannot be mixed in one request.
* If you want to use AIP-160, your expression must specify the field name, an
* operator, and the value that you want to use for filtering. The value
* must be a string, a number, or a boolean. The operator
* must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
* For example, if you are filtering Compute Engine instances, you can
* exclude instances named `example-instance` by specifying
* `name != example-instance`.
* The `:*` comparison can be used to test whether a key has been defined.
* For example, to find all objects with `owner` label use:
* ```
* labels.owner:*
* ```
* You can also filter nested fields. For example, you could specify
* `scheduling.automaticRestart = false` to include instances only
* if they are not scheduled for automatic restarts. You can use filtering
* on nested fields to filter based onresource labels.
* To filter on multiple expressions, provide each separate expression within
* parentheses. For example:
* ```
* (scheduling.automaticRestart = true)
* (cpuPlatform = "Intel Skylake")
* ```
* By default, each expression is an `AND` expression. However, you
* can include `AND` and `OR` expressions explicitly.
* For example:
* ```
* (cpuPlatform = "Intel Skylake") OR
* (cpuPlatform = "Intel Broadwell") AND
* (scheduling.automaticRestart = true)
* ```
* If you want to use a regular expression, use the `eq` (equal) or `ne`
* (not equal) operator against a single un-parenthesized expression with or
* without quotes or against multiple parenthesized expressions. Examples:
* `fieldname eq unquoted literal`
* `fieldname eq 'single quoted literal'`
* `fieldname eq "double quoted literal"`
* `(fieldname1 eq literal) (fieldname2 ne "literal")`
* The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
* The literal value must match the entire field.
* For example, to filter for instances that do not end with name "instance",
* you would use `name ne .*instance`.
* You cannot combine constraints on multiple fields using regular
* expressions.
*/
// const filter = 'abc123'
/**
* 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`)
*/
// const maxResults = 1234
/**
* 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.
*/
// const orderBy = 'abc123'
/**
* Specifies a page token to use. Set `pageToken` to the
* `nextPageToken` returned by a previous list request to get
* the next page of results.
*/
// const pageToken = 'abc123'
/**
* Project ID for this request.
*/
// const project = 'my-project'
/**
* Name of the region for this request.
*/
// const region = 'us-central1'
/**
* Opt-in for partial success behavior which provides partial results in case
* of failure. The default value is false.
* For example, when partial success behavior is enabled, aggregatedList for a
* single zone scope either returns all resources in the zone or no resources,
* with an error code.
*/
// const returnPartialSuccess = true
// Imports the Compute library
const {RoutersClient} = require('@google-cloud/compute').v1beta;
// Instantiates a client
const computeClient = new RoutersClient();
async function callList() {
// Construct request
const request = {
project,
region,
};
// Run request
const iterable = computeClient.listAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callList();
listBgpRoutesAsync(request, optionsopt) → {Object}
Equivalent to listBgpRoutes, 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
|
|||||||||||||||||||||||||||||||||||||||||||
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 BgpRoute. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* (Required) limit results to this address family (either IPv4 or IPv6)
* Check the AddressFamily enum for the list of possible values.
*/
// const addressFamily = 'abc123'
/**
* Limit results to destinations that are subnets of this CIDR range
*/
// const destinationPrefix = 'abc123'
/**
* A filter expression that filters resources listed in the response. Most
* Compute resources support two types of filter expressions:
* expressions that support regular expressions and expressions that follow
* API improvement proposal AIP-160.
* These two types of filter expressions cannot be mixed in one request.
* If you want to use AIP-160, your expression must specify the field name, an
* operator, and the value that you want to use for filtering. The value
* must be a string, a number, or a boolean. The operator
* must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
* For example, if you are filtering Compute Engine instances, you can
* exclude instances named `example-instance` by specifying
* `name != example-instance`.
* The `:*` comparison can be used to test whether a key has been defined.
* For example, to find all objects with `owner` label use:
* ```
* labels.owner:*
* ```
* You can also filter nested fields. For example, you could specify
* `scheduling.automaticRestart = false` to include instances only
* if they are not scheduled for automatic restarts. You can use filtering
* on nested fields to filter based onresource labels.
* To filter on multiple expressions, provide each separate expression within
* parentheses. For example:
* ```
* (scheduling.automaticRestart = true)
* (cpuPlatform = "Intel Skylake")
* ```
* By default, each expression is an `AND` expression. However, you
* can include `AND` and `OR` expressions explicitly.
* For example:
* ```
* (cpuPlatform = "Intel Skylake") OR
* (cpuPlatform = "Intel Broadwell") AND
* (scheduling.automaticRestart = true)
* ```
* If you want to use a regular expression, use the `eq` (equal) or `ne`
* (not equal) operator against a single un-parenthesized expression with or
* without quotes or against multiple parenthesized expressions. Examples:
* `fieldname eq unquoted literal`
* `fieldname eq 'single quoted literal'`
* `fieldname eq "double quoted literal"`
* `(fieldname1 eq literal) (fieldname2 ne "literal")`
* The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
* The literal value must match the entire field.
* For example, to filter for instances that do not end with name "instance",
* you would use `name ne .*instance`.
* You cannot combine constraints on multiple fields using regular
* expressions.
*/
// const filter = 'abc123'
/**
* 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`)
*/
// const maxResults = 1234
/**
* 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.
*/
// const orderBy = 'abc123'
/**
* Specifies a page token to use. Set `pageToken` to the
* `nextPageToken` returned by a previous list request to get
* the next page of results.
*/
// const pageToken = 'abc123'
/**
* (Required) limit results to the BGP peer with the given name.
* Name should conform to RFC1035.
*/
// const peer = 'abc123'
/**
* When true, the method returns post-policy routes. Otherwise, it returns
* pre-policy routes.
*/
// const policyApplied = true
/**
* Project ID for this request.
*/
// const project = 'my-project'
/**
* Name of the region for this request.
*/
// const region = 'us-central1'
/**
* Opt-in for partial success behavior which provides partial results in case
* of failure. The default value is false.
* For example, when partial success behavior is enabled, aggregatedList for a
* single zone scope either returns all resources in the zone or no resources,
* with an error code.
*/
// const returnPartialSuccess = true
/**
* (Required) limit results to this type of route (either LEARNED or
* ADVERTISED)
* Check the RouteType enum for the list of possible values.
*/
// const routeType = 'abc123'
/**
* Name or id of the resource for this request.
* Name should conform to RFC1035.
*/
// const router = 'abc123'
// Imports the Compute library
const {RoutersClient} = require('@google-cloud/compute').v1beta;
// Instantiates a client
const computeClient = new RoutersClient();
async function callListBgpRoutes() {
// Construct request
const request = {
project,
region,
router,
};
// Run request
const iterable = computeClient.listBgpRoutesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListBgpRoutes();
listBgpRoutesStream(request, optionsopt) → {Stream}
Equivalent to listBgpRoutes, but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing BgpRoute 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 |
listNamedSetsAsync(request, optionsopt) → {Object}
Equivalent to listNamedSets, 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
|
||||||||||||||||||||||||||||
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 NamedSet. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A filter expression that filters resources listed in the response. Most
* Compute resources support two types of filter expressions:
* expressions that support regular expressions and expressions that follow
* API improvement proposal AIP-160.
* These two types of filter expressions cannot be mixed in one request.
* If you want to use AIP-160, your expression must specify the field name, an
* operator, and the value that you want to use for filtering. The value
* must be a string, a number, or a boolean. The operator
* must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
* For example, if you are filtering Compute Engine instances, you can
* exclude instances named `example-instance` by specifying
* `name != example-instance`.
* The `:*` comparison can be used to test whether a key has been defined.
* For example, to find all objects with `owner` label use:
* ```
* labels.owner:*
* ```
* You can also filter nested fields. For example, you could specify
* `scheduling.automaticRestart = false` to include instances only
* if they are not scheduled for automatic restarts. You can use filtering
* on nested fields to filter based onresource labels.
* To filter on multiple expressions, provide each separate expression within
* parentheses. For example:
* ```
* (scheduling.automaticRestart = true)
* (cpuPlatform = "Intel Skylake")
* ```
* By default, each expression is an `AND` expression. However, you
* can include `AND` and `OR` expressions explicitly.
* For example:
* ```
* (cpuPlatform = "Intel Skylake") OR
* (cpuPlatform = "Intel Broadwell") AND
* (scheduling.automaticRestart = true)
* ```
* If you want to use a regular expression, use the `eq` (equal) or `ne`
* (not equal) operator against a single un-parenthesized expression with or
* without quotes or against multiple parenthesized expressions. Examples:
* `fieldname eq unquoted literal`
* `fieldname eq 'single quoted literal'`
* `fieldname eq "double quoted literal"`
* `(fieldname1 eq literal) (fieldname2 ne "literal")`
* The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
* The literal value must match the entire field.
* For example, to filter for instances that do not end with name "instance",
* you would use `name ne .*instance`.
* You cannot combine constraints on multiple fields using regular
* expressions.
*/
// const filter = 'abc123'
/**
* 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`)
*/
// const maxResults = 1234
/**
* 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.
*/
// const orderBy = 'abc123'
/**
* Specifies a page token to use. Set `pageToken` to the
* `nextPageToken` returned by a previous list request to get
* the next page of results.
*/
// const pageToken = 'abc123'
/**
* Project ID for this request.
*/
// const project = 'my-project'
/**
* Name of the region for this request.
*/
// const region = 'us-central1'
/**
* Opt-in for partial success behavior which provides partial results in case
* of failure. The default value is false.
* For example, when partial success behavior is enabled, aggregatedList for a
* single zone scope either returns all resources in the zone or no resources,
* with an error code.
*/
// const returnPartialSuccess = true
/**
* Name or id of the resource for this request.
* Name should conform to RFC1035.
*/
// const router = 'abc123'
// Imports the Compute library
const {RoutersClient} = require('@google-cloud/compute').v1beta;
// Instantiates a client
const computeClient = new RoutersClient();
async function callListNamedSets() {
// Construct request
const request = {
project,
region,
router,
};
// Run request
const iterable = computeClient.listNamedSetsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListNamedSets();
listNamedSetsStream(request, optionsopt) → {Stream}
Equivalent to listNamedSets, but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing NamedSet 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 |
listRoutePoliciesAsync(request, optionsopt) → {Object}
Equivalent to listRoutePolicies, 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
|
||||||||||||||||||||||||||||
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 RoutePolicy. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A filter expression that filters resources listed in the response. Most
* Compute resources support two types of filter expressions:
* expressions that support regular expressions and expressions that follow
* API improvement proposal AIP-160.
* These two types of filter expressions cannot be mixed in one request.
* If you want to use AIP-160, your expression must specify the field name, an
* operator, and the value that you want to use for filtering. The value
* must be a string, a number, or a boolean. The operator
* must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
* For example, if you are filtering Compute Engine instances, you can
* exclude instances named `example-instance` by specifying
* `name != example-instance`.
* The `:*` comparison can be used to test whether a key has been defined.
* For example, to find all objects with `owner` label use:
* ```
* labels.owner:*
* ```
* You can also filter nested fields. For example, you could specify
* `scheduling.automaticRestart = false` to include instances only
* if they are not scheduled for automatic restarts. You can use filtering
* on nested fields to filter based onresource labels.
* To filter on multiple expressions, provide each separate expression within
* parentheses. For example:
* ```
* (scheduling.automaticRestart = true)
* (cpuPlatform = "Intel Skylake")
* ```
* By default, each expression is an `AND` expression. However, you
* can include `AND` and `OR` expressions explicitly.
* For example:
* ```
* (cpuPlatform = "Intel Skylake") OR
* (cpuPlatform = "Intel Broadwell") AND
* (scheduling.automaticRestart = true)
* ```
* If you want to use a regular expression, use the `eq` (equal) or `ne`
* (not equal) operator against a single un-parenthesized expression with or
* without quotes or against multiple parenthesized expressions. Examples:
* `fieldname eq unquoted literal`
* `fieldname eq 'single quoted literal'`
* `fieldname eq "double quoted literal"`
* `(fieldname1 eq literal) (fieldname2 ne "literal")`
* The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
* The literal value must match the entire field.
* For example, to filter for instances that do not end with name "instance",
* you would use `name ne .*instance`.
* You cannot combine constraints on multiple fields using regular
* expressions.
*/
// const filter = 'abc123'
/**
* 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`)
*/
// const maxResults = 1234
/**
* 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.
*/
// const orderBy = 'abc123'
/**
* Specifies a page token to use. Set `pageToken` to the
* `nextPageToken` returned by a previous list request to get
* the next page of results.
*/
// const pageToken = 'abc123'
/**
* Project ID for this request.
*/
// const project = 'my-project'
/**
* Name of the region for this request.
*/
// const region = 'us-central1'
/**
* Opt-in for partial success behavior which provides partial results in case
* of failure. The default value is false.
* For example, when partial success behavior is enabled, aggregatedList for a
* single zone scope either returns all resources in the zone or no resources,
* with an error code.
*/
// const returnPartialSuccess = true
/**
* Name or id of the resource for this request.
* Name should conform to RFC1035.
*/
// const router = 'abc123'
// Imports the Compute library
const {RoutersClient} = require('@google-cloud/compute').v1beta;
// Instantiates a client
const computeClient = new RoutersClient();
async function callListRoutePolicies() {
// Construct request
const request = {
project,
region,
router,
};
// Run request
const iterable = computeClient.listRoutePoliciesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListRoutePolicies();
listRoutePoliciesStream(request, optionsopt) → {Stream}
Equivalent to listRoutePolicies, but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing RoutePolicy 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 |
listStream(request, optionsopt) → {Stream}
Equivalent to list, but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing Router 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 |