Network Management V1 API - Class Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client (v1.5.0)

Reference documentation and code samples for the Network Management V1 API class Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.

REST client for the VpcFlowLogsService service.

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.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the VpcFlowLogsService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all VpcFlowLogsService clients
::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the VpcFlowLogsService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_vpc_flow_logs_config

def create_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operation
def create_vpc_flow_logs_config(parent: nil, vpc_flow_logs_config_id: nil, vpc_flow_logs_config: nil) -> ::Gapic::Operation

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 considered 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
Overloads
def create_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_vpc_flow_logs_config via a request object, either of type CreateVpcFlowLogsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkManagement::V1::CreateVpcFlowLogsConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_vpc_flow_logs_config(parent: nil, vpc_flow_logs_config_id: nil, vpc_flow_logs_config: nil) -> ::Gapic::Operation
Pass arguments to create_vpc_flow_logs_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource of the VPC Flow Logs configuration to create: projects/{project_id}/locations/global
  • vpc_flow_logs_config_id (::String) — Required. ID of the VpcFlowLogsConfig.
  • vpc_flow_logs_config (::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig, ::Hash) — Required. A VpcFlowLogsConfig resource
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_management/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkManagement::V1::CreateVpcFlowLogsConfigRequest.new

# Call the create_vpc_flow_logs_config method.
result = client.create_vpc_flow_logs_config request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_vpc_flow_logs_config

def delete_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operation
def delete_vpc_flow_logs_config(name: nil) -> ::Gapic::Operation

Deletes a specific VpcFlowLogsConfig.

Overloads
def delete_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_vpc_flow_logs_config via a request object, either of type DeleteVpcFlowLogsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkManagement::V1::DeleteVpcFlowLogsConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_vpc_flow_logs_config(name: nil) -> ::Gapic::Operation
Pass arguments to delete_vpc_flow_logs_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. VpcFlowLogsConfig resource name using the form: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_management/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkManagement::V1::DeleteVpcFlowLogsConfigRequest.new

# Call the delete_vpc_flow_logs_config method.
result = client.delete_vpc_flow_logs_config request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_vpc_flow_logs_config

def get_vpc_flow_logs_config(request, options = nil) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig
def get_vpc_flow_logs_config(name: nil) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig

Gets the details of a specific VpcFlowLogsConfig.

Overloads
def get_vpc_flow_logs_config(request, options = nil) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig
Pass arguments to get_vpc_flow_logs_config via a request object, either of type GetVpcFlowLogsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkManagement::V1::GetVpcFlowLogsConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_vpc_flow_logs_config(name: nil) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig
Pass arguments to get_vpc_flow_logs_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. VpcFlowLogsConfig resource name using the form: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_management/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkManagement::V1::GetVpcFlowLogsConfigRequest.new

# Call the get_vpc_flow_logs_config method.
result = client.get_vpc_flow_logs_config request

# The returned object is of type Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Rest::Client

Get the associated client for mix-in of the IAMPolicy.

Returns
  • (Google::Iam::V1::IAMPolicy::Rest::Client)

#initialize

def initialize() { |config| ... } -> Client

Create a new VpcFlowLogsService REST client object.

Yields
  • (config) — Configure the VpcFlowLogsService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_vpc_flow_logs_configs

def list_vpc_flow_logs_configs(request, options = nil) -> ::Google::Cloud::NetworkManagement::V1::ListVpcFlowLogsConfigsResponse
def list_vpc_flow_logs_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::NetworkManagement::V1::ListVpcFlowLogsConfigsResponse

Lists all VpcFlowLogsConfigs in a given project.

Overloads
def list_vpc_flow_logs_configs(request, options = nil) -> ::Google::Cloud::NetworkManagement::V1::ListVpcFlowLogsConfigsResponse
Pass arguments to list_vpc_flow_logs_configs via a request object, either of type ListVpcFlowLogsConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkManagement::V1::ListVpcFlowLogsConfigsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_vpc_flow_logs_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::NetworkManagement::V1::ListVpcFlowLogsConfigsResponse
Pass arguments to list_vpc_flow_logs_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource of the VpcFlowLogsConfig: projects/{project_id}/locations/global
  • page_size (::Integer) — Optional. Number of VpcFlowLogsConfigs to return.
  • page_token (::String) — Optional. Page token from an earlier query, as returned in next_page_token.
  • filter (::String) — Optional. Lists the VpcFlowLogsConfigs that match the filter expression. A filter expression must use the supported CEL logic operators.
  • order_by (::String) — Optional. Field to use to sort the list.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_management/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkManagement::V1::ListVpcFlowLogsConfigsRequest.new

# Call the list_vpc_flow_logs_configs method.
result = client.list_vpc_flow_logs_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_vpc_flow_logs_config

def update_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operation
def update_vpc_flow_logs_config(update_mask: nil, vpc_flow_logs_config: nil) -> ::Gapic::Operation

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. Updating a configuration with state=DISABLED will fail.
  2. The following fields are not considered 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
Overloads
def update_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_vpc_flow_logs_config via a request object, either of type UpdateVpcFlowLogsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkManagement::V1::UpdateVpcFlowLogsConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_vpc_flow_logs_config(update_mask: nil, vpc_flow_logs_config: nil) -> ::Gapic::Operation
Pass arguments to update_vpc_flow_logs_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_management/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkManagement::V1::UpdateVpcFlowLogsConfigRequest.new

# Call the update_vpc_flow_logs_config method.
result = client.update_vpc_flow_logs_config request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end