The VPC Flow Logs service in the Google Cloud Network Management API provides configurations that generate Flow Logs. The service and the configuration resources created using this service are global. v1beta1
Package
@google-cloud/network-managementConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of VpcFlowLogsServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;
The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
iamClient
iamClient: IamClient;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
locationsClient
locationsClient: LocationsClient;
operationsClient
operationsClient: gax.OperationsClient;
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
universeDomain
get universeDomain(): string;
vpcFlowLogsServiceStub
vpcFlowLogsServiceStub?: Promise<{
[name: string]: Function;
}>;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
request |
CancelOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkCreateVpcFlowLogsConfigProgress(name)
checkCreateVpcFlowLogsConfigProgress(name: string): Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.VpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by createVpcFlowLogsConfig()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.VpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>> |
{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. |
/**
* 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. The parent resource of the VPC Flow Logs configuration to create:
* `projects/{project_id}/locations/global`
*/
// const parent = 'abc123'
/**
* Required. ID of the `VpcFlowLogsConfig`.
*/
// const vpcFlowLogsConfigId = 'abc123'
/**
* Required. A `VpcFlowLogsConfig` resource
*/
// const vpcFlowLogsConfig = {}
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callCreateVpcFlowLogsConfig() {
// Construct request
const request = {
parent,
vpcFlowLogsConfigId,
vpcFlowLogsConfig,
};
// Run request
const [operation] = await networkmanagementClient.createVpcFlowLogsConfig(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateVpcFlowLogsConfig();
checkDeleteVpcFlowLogsConfigProgress(name)
checkDeleteVpcFlowLogsConfigProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by deleteVpcFlowLogsConfig()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>> |
{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. |
/**
* 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. `VpcFlowLogsConfig` resource name using the form:
* `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
*/
// const name = 'abc123'
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callDeleteVpcFlowLogsConfig() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await networkmanagementClient.deleteVpcFlowLogsConfig(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteVpcFlowLogsConfig();
checkUpdateVpcFlowLogsConfigProgress(name)
checkUpdateVpcFlowLogsConfigProgress(name: string): Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.VpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by updateVpcFlowLogsConfig()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.VpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>> |
{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. |
/**
* 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. Mask of fields to update. At least one path must be supplied in
* this field.
*/
// const updateMask = {}
/**
* Required. Only fields specified in update_mask are updated.
*/
// const vpcFlowLogsConfig = {}
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callUpdateVpcFlowLogsConfig() {
// Construct request
const request = {
updateMask,
vpcFlowLogsConfig,
};
// Run request
const [operation] = await networkmanagementClient.updateVpcFlowLogsConfig(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateVpcFlowLogsConfig();
close()
close(): Promise<void>;
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<void> |
{Promise} A promise that resolves when the client is closed. |
connectivityTestPath(project, test)
connectivityTestPath(project: string, test: string): string;
Return a fully-qualified connectivityTest resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
test |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
createVpcFlowLogsConfig(request, options)
createVpcFlowLogsConfig(request?: protos.google.cloud.networkmanagement.v1beta1.ICreateVpcFlowLogsConfigRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates a new VpcFlowLogsConfig
. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Creating a configuration with state=DISABLED will fail. 2. The following fields are not considrered as settings
for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: - name - create_time - update_time - labels - description
Parameters | |
---|---|
Name | Description |
request |
ICreateVpcFlowLogsConfigRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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. The parent resource of the VPC Flow Logs configuration to create:
* `projects/{project_id}/locations/global`
*/
// const parent = 'abc123'
/**
* Required. ID of the `VpcFlowLogsConfig`.
*/
// const vpcFlowLogsConfigId = 'abc123'
/**
* Required. A `VpcFlowLogsConfig` resource
*/
// const vpcFlowLogsConfig = {}
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callCreateVpcFlowLogsConfig() {
// Construct request
const request = {
parent,
vpcFlowLogsConfigId,
vpcFlowLogsConfig,
};
// Run request
const [operation] = await networkmanagementClient.createVpcFlowLogsConfig(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateVpcFlowLogsConfig();
createVpcFlowLogsConfig(request, options, callback)
createVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.ICreateVpcFlowLogsConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateVpcFlowLogsConfigRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createVpcFlowLogsConfig(request, callback)
createVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.ICreateVpcFlowLogsConfigRequest, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateVpcFlowLogsConfigRequest
|
callback |
Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
DeleteOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
deleteVpcFlowLogsConfig(request, options)
deleteVpcFlowLogsConfig(request?: protos.google.cloud.networkmanagement.v1beta1.IDeleteVpcFlowLogsConfigRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes a specific VpcFlowLogsConfig
.
Parameters | |
---|---|
Name | Description |
request |
IDeleteVpcFlowLogsConfigRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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. `VpcFlowLogsConfig` resource name using the form:
* `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
*/
// const name = 'abc123'
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callDeleteVpcFlowLogsConfig() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await networkmanagementClient.deleteVpcFlowLogsConfig(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteVpcFlowLogsConfig();
deleteVpcFlowLogsConfig(request, options, callback)
deleteVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.IDeleteVpcFlowLogsConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteVpcFlowLogsConfigRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteVpcFlowLogsConfig(request, callback)
deleteVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.IDeleteVpcFlowLogsConfigRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteVpcFlowLogsConfigRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getIamPolicy(request, options, callback)
getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Parameters | |
---|---|
Name | Description |
request |
IamProtos.google.iam.v1.GetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . |
Returns | |
---|---|
Type | Description |
Promise<[google.iam.v1.Policy]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
Promise<google.cloud.location.ILocation> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
const [response] = await client.getLocation(request);
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
GetOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<[protos.google.longrunning.Operation]> |
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
getVpcFlowLogsConfig(request, options)
getVpcFlowLogsConfig(request?: protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest, options?: CallOptions): Promise<[
protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig,
(protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest | undefined),
{} | undefined
]>;
Gets the details of a specific VpcFlowLogsConfig
.
Parameters | |
---|---|
Name | Description |
request |
IGetVpcFlowLogsConfigRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig,
(protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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. `VpcFlowLogsConfig` resource name using the form:
* `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
*/
// const name = 'abc123'
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callGetVpcFlowLogsConfig() {
// Construct request
const request = {
name,
};
// Run request
const response = await networkmanagementClient.getVpcFlowLogsConfig(request);
console.log(response);
}
callGetVpcFlowLogsConfig();
getVpcFlowLogsConfig(request, options, callback)
getVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetVpcFlowLogsConfigRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getVpcFlowLogsConfig(request, callback)
getVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest, callback: Callback<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetVpcFlowLogsConfigRequest
|
callback |
Callback<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IGetVpcFlowLogsConfigRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
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<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
Lists information about the supported locations for this service. Returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<google.cloud.location.ILocation> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
Parameters | |
---|---|
Name | Description |
request |
ListOperationsRequest
The request object that will be sent. |
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.ListOperationsResponse> |
{Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
listVpcFlowLogsConfigs(request, options)
listVpcFlowLogsConfigs(request?: protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, options?: CallOptions): Promise<[
protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig[],
protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest | null,
protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsResponse
]>;
Lists all VpcFlowLogsConfigs
in a given project.
Parameters | |
---|---|
Name | Description |
request |
IListVpcFlowLogsConfigsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig[],
protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest | null,
protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 |
listVpcFlowLogsConfigs(request, options, callback)
listVpcFlowLogsConfigs(request: protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig>): void;
Parameters | |
---|---|
Name | Description |
request |
IListVpcFlowLogsConfigsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig>
|
Returns | |
---|---|
Type | Description |
void |
listVpcFlowLogsConfigs(request, callback)
listVpcFlowLogsConfigs(request: protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, callback: PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig>): void;
Parameters | |
---|---|
Name | Description |
request |
IListVpcFlowLogsConfigsRequest
|
callback |
PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig>
|
Returns | |
---|---|
Type | Description |
void |
listVpcFlowLogsConfigsAsync(request, options)
listVpcFlowLogsConfigsAsync(request?: protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig>;
Equivalent to listVpcFlowLogsConfigs
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListVpcFlowLogsConfigsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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. |
/**
* 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. The parent resource of the VpcFlowLogsConfig:
* `projects/{project_id}/locations/global`
*/
// const parent = 'abc123'
/**
* Optional. Number of `VpcFlowLogsConfigs` to return.
*/
// const pageSize = 1234
/**
* Optional. Page token from an earlier query, as returned in
* `next_page_token`.
*/
// const pageToken = 'abc123'
/**
* Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
* A filter expression must use the supported CEL logic operators
* (https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators).
*/
// const filter = 'abc123'
/**
* Optional. Field to use to sort the list.
*/
// const orderBy = 'abc123'
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callListVpcFlowLogsConfigs() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = networkmanagementClient.listVpcFlowLogsConfigsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListVpcFlowLogsConfigs();
listVpcFlowLogsConfigsStream(request, options)
listVpcFlowLogsConfigsStream(request?: protos.google.cloud.networkmanagement.v1beta1.IListVpcFlowLogsConfigsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListVpcFlowLogsConfigsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform |
{Stream} An object stream which emits an object representing 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 |
locationPath(project, location)
locationPath(project: string, location: string): string;
Return a fully-qualified location resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromVpcFlowLogsConfigName(vpcFlowLogsConfigName)
matchLocationFromVpcFlowLogsConfigName(vpcFlowLogsConfigName: string): string | number;
Parse the location from VpcFlowLogsConfig resource.
Parameter | |
---|---|
Name | Description |
vpcFlowLogsConfigName |
string
A fully-qualified path representing VpcFlowLogsConfig resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromConnectivityTestName(connectivityTestName)
matchProjectFromConnectivityTestName(connectivityTestName: string): string | number;
Parse the project from ConnectivityTest resource.
Parameter | |
---|---|
Name | Description |
connectivityTestName |
string
A fully-qualified path representing ConnectivityTest resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter | |
---|---|
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromVpcFlowLogsConfigName(vpcFlowLogsConfigName)
matchProjectFromVpcFlowLogsConfigName(vpcFlowLogsConfigName: string): string | number;
Parse the project from VpcFlowLogsConfig resource.
Parameter | |
---|---|
Name | Description |
vpcFlowLogsConfigName |
string
A fully-qualified path representing VpcFlowLogsConfig resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchTestFromConnectivityTestName(connectivityTestName)
matchTestFromConnectivityTestName(connectivityTestName: string): string | number;
Parse the test from ConnectivityTest resource.
Parameter | |
---|---|
Name | Description |
connectivityTestName |
string
A fully-qualified path representing ConnectivityTest resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the test. |
matchVpcFlowLogsConfigFromVpcFlowLogsConfigName(vpcFlowLogsConfigName)
matchVpcFlowLogsConfigFromVpcFlowLogsConfigName(vpcFlowLogsConfigName: string): string | number;
Parse the vpc_flow_logs_config from VpcFlowLogsConfig resource.
Parameter | |
---|---|
Name | Description |
vpcFlowLogsConfigName |
string
A fully-qualified path representing VpcFlowLogsConfig resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the vpc_flow_logs_config. |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
setIamPolicy(request, options, callback)
setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
Parameters | |
---|---|
Name | Description |
request |
IamProtos.google.iam.v1.SetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . |
Returns | |
---|---|
Type | Description |
Promise<[google.iam.v1.Policy]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
testIamPermissions(request, options, callback)
testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]>;
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
Parameters | |
---|---|
Name | Description |
request |
IamProtos.google.iam.v1.TestIamPermissionsRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . |
Returns | |
---|---|
Type | Description |
Promise<[google.iam.v1.TestIamPermissionsResponse]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
updateVpcFlowLogsConfig(request, options)
updateVpcFlowLogsConfig(request?: protos.google.cloud.networkmanagement.v1beta1.IUpdateVpcFlowLogsConfigRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates an existing VpcFlowLogsConfig
. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. The following fields are not considrered as settings
for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: - name - create_time - update_time - labels - description
Parameters | |
---|---|
Name | Description |
request |
IUpdateVpcFlowLogsConfigRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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. Mask of fields to update. At least one path must be supplied in
* this field.
*/
// const updateMask = {}
/**
* Required. Only fields specified in update_mask are updated.
*/
// const vpcFlowLogsConfig = {}
// Imports the Networkmanagement library
const {VpcFlowLogsServiceClient} = require('@google-cloud/network-management').v1beta1;
// Instantiates a client
const networkmanagementClient = new VpcFlowLogsServiceClient();
async function callUpdateVpcFlowLogsConfig() {
// Construct request
const request = {
updateMask,
vpcFlowLogsConfig,
};
// Run request
const [operation] = await networkmanagementClient.updateVpcFlowLogsConfig(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateVpcFlowLogsConfig();
updateVpcFlowLogsConfig(request, options, callback)
updateVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.IUpdateVpcFlowLogsConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateVpcFlowLogsConfigRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateVpcFlowLogsConfig(request, callback)
updateVpcFlowLogsConfig(request: protos.google.cloud.networkmanagement.v1beta1.IUpdateVpcFlowLogsConfigRequest, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateVpcFlowLogsConfigRequest
|
callback |
Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IVpcFlowLogsConfig, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
vpcFlowLogsConfigPath(project, location, vpcFlowLogsConfig)
vpcFlowLogsConfigPath(project: string, location: string, vpcFlowLogsConfig: string): string;
Return a fully-qualified vpcFlowLogsConfig resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
vpcFlowLogsConfig |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |