Reference documentation and code samples for the Network Management V1 API class Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Client.
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::ConfigurationConfigure the VpcFlowLogsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all VpcFlowLogsService clients ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::OperationCreates a new VpcFlowLogsConfig.
If a configuration with the exact same settings already exists (even if the
ID is different), the creation fails.
Notes:
- Creating a configuration with
state=DISABLEDwill fail - 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
def create_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operationcreate_vpc_flow_logs_config via a request object, either of type
CreateVpcFlowLogsConfigRequest or an equivalent Hash.
- 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::Operationcreate_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).
-
parent (::String) —
Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:
For project-level resources:
projects/{project_id}/locations/globalFor organization-level resources:
organizations/{organization_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
VpcFlowLogsConfigresource
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::OperationDeletes a specific VpcFlowLogsConfig.
def delete_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operationdelete_vpc_flow_logs_config via a request object, either of type
DeleteVpcFlowLogsConfigRequest or an equivalent Hash.
- 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::Operationdelete_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).
-
name (::String) —
Required. The resource name of the VpcFlowLogsConfig, in one of the following formats:
For a project-level resource:
projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}For an organization-level resource:
organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::VpcFlowLogsConfigGets the details of a specific VpcFlowLogsConfig.
def get_vpc_flow_logs_config(request, options = nil) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfigget_vpc_flow_logs_config via a request object, either of type
GetVpcFlowLogsConfigRequest or an equivalent Hash.
- 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::VpcFlowLogsConfigget_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).
-
name (::String) —
Required. The resource name of the VpcFlowLogsConfig, in one of the following formats:
For project-level resources:
projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}For organization-level resources:
organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::ClientGet the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Client)
#initialize
def initialize() { |config| ... } -> ClientCreate a new VpcFlowLogsService client object.
- (config) — Configure the VpcFlowLogsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::Client.new do |config| config.timeout = 10.0 end
#list_vpc_flow_logs_configs
def list_vpc_flow_logs_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>
def list_vpc_flow_logs_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>Lists all VpcFlowLogsConfigs in a given project.
def list_vpc_flow_logs_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>list_vpc_flow_logs_configs via a request object, either of type
ListVpcFlowLogsConfigsRequest or an equivalent Hash.
- 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) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>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).
-
parent (::String) —
Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats:
For project-level resourcs:
projects/{project_id}/locations/globalFor organization-level resources:
organizations/{organization_id}/locations/global
-
page_size (::Integer) — Optional. Number of
VpcFlowLogsConfigsto return. -
page_token (::String) — Optional. Page token from an earlier query, as returned in
next_page_token. -
filter (::String) — Optional. Lists the
VpcFlowLogsConfigsthat 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsService::OperationsGet the associated client for long-running operations.
#query_org_vpc_flow_logs_configs
def query_org_vpc_flow_logs_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>
def query_org_vpc_flow_logs_configs(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to the specified project.
def query_org_vpc_flow_logs_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>query_org_vpc_flow_logs_configs via a request object, either of type
QueryOrgVpcFlowLogsConfigsRequest or an equivalent Hash.
- request (::Google::Cloud::NetworkManagement::V1::QueryOrgVpcFlowLogsConfigsRequest, ::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 query_org_vpc_flow_logs_configs(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>query_org_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).
-
parent (::String) — Required. The parent resource of the VpcFlowLogsConfig, specified in
the following format:
projects/{project_id}/locations/global -
page_size (::Integer) — Optional. Number of
VpcFlowLogsConfigsto return. -
page_token (::String) — Optional. Page token from an earlier query, as returned in
next_page_token. -
filter (::String) — Optional. Lists the
VpcFlowLogsConfigsthat match the filter expression. A filter expression must use the supported CEL logic operators.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::NetworkManagement::V1::QueryOrgVpcFlowLogsConfigsRequest.new # Call the query_org_vpc_flow_logs_configs method. result = client.query_org_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
#show_effective_flow_logs_configs
def show_effective_flow_logs_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::EffectiveVpcFlowLogsConfig>
def show_effective_flow_logs_configs(parent: nil, resource: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::EffectiveVpcFlowLogsConfig>ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a specified resource.
def show_effective_flow_logs_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::EffectiveVpcFlowLogsConfig>show_effective_flow_logs_configs via a request object, either of type
ShowEffectiveFlowLogsConfigsRequest or an equivalent Hash.
- request (::Google::Cloud::NetworkManagement::V1::ShowEffectiveFlowLogsConfigsRequest, ::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 show_effective_flow_logs_configs(parent: nil, resource: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::EffectiveVpcFlowLogsConfig>show_effective_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).
-
parent (::String) — Required. The parent resource of the VpcFlowLogsConfig, specified in
the following format:
projects/{project_id}/locations/global - resource (::String) — Required. The resource to get the effective VPC Flow Logs configuration for. The resource must belong to the same project as the parent. The resource must be a network, subnetwork, interconnect attachment, VPN tunnel, or a project.
-
page_size (::Integer) — Optional. Number of
EffectiveVpcFlowLogsConfigsto return. Default is 30. -
page_token (::String) — Optional. Page token from an earlier query, as returned in
next_page_token. -
filter (::String) — Optional. Lists the
EffectiveVpcFlowLogsConfigsthat match the filter expression. A filter expression must use the supported CEL logic operators.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::EffectiveVpcFlowLogsConfig>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::NetworkManagement::V1::EffectiveVpcFlowLogsConfig>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::NetworkManagement::V1::ShowEffectiveFlowLogsConfigsRequest.new # Call the show_effective_flow_logs_configs method. result = client.show_effective_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::EffectiveVpcFlowLogsConfig. p item end
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (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::OperationUpdates an existing VpcFlowLogsConfig.
If a configuration with the exact same settings already exists (even if the
ID is different), the creation fails.
Notes:
- Updating a configuration with
state=DISABLEDwill fail. - 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
def update_vpc_flow_logs_config(request, options = nil) -> ::Gapic::Operationupdate_vpc_flow_logs_config via a request object, either of type
UpdateVpcFlowLogsConfigRequest or an equivalent Hash.
- 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::Operationupdate_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).
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask of fields to update. At least one path must be supplied in
this field.
For example, to change the state of the configuration to ENABLED, specify
update_mask="state", and thevpc_flow_logs_configwould be:vpc_flow_logs_config = { name = "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config" state = "ENABLED" } - vpc_flow_logs_config (::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig, ::Hash) — Required. Only fields specified in update_mask are updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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