Network Security V1beta1 API - Class Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client (v0.3.0)

Reference documentation and code samples for the Network Security V1beta1 API class Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.

Client for the NetworkSecurity service.

Network Security API provides resources to configure authentication and authorization policies. Refer to per API resource documentation for more information.

Inherits

  • Object

Methods

.configure

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

Configure the NetworkSecurity 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 NetworkSecurity clients
::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the NetworkSecurity 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_authorization_policy

def create_authorization_policy(request, options = nil) -> ::Gapic::Operation
def create_authorization_policy(parent: nil, authorization_policy_id: nil, authorization_policy: nil) -> ::Gapic::Operation

Creates a new AuthorizationPolicy in a given project and location.

Overloads
def create_authorization_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_authorization_policy via a request object, either of type CreateAuthorizationPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest, ::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_authorization_policy(parent: nil, authorization_policy_id: nil, authorization_policy: nil) -> ::Gapic::Operation
Pass arguments to create_authorization_policy 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 AuthorizationPolicy. Must be in the format projects/{project}/locations/{location}.
  • authorization_policy_id (::String) — Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".
  • authorization_policy (::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy, ::Hash) — Required. AuthorizationPolicy resource to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest.new

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

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

#create_client_tls_policy

def create_client_tls_policy(request, options = nil) -> ::Gapic::Operation
def create_client_tls_policy(parent: nil, client_tls_policy_id: nil, client_tls_policy: nil) -> ::Gapic::Operation

Creates a new ClientTlsPolicy in a given project and location.

Overloads
def create_client_tls_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_client_tls_policy via a request object, either of type CreateClientTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest, ::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_client_tls_policy(parent: nil, client_tls_policy_id: nil, client_tls_policy: nil) -> ::Gapic::Operation
Pass arguments to create_client_tls_policy 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 ClientTlsPolicy. Must be in the format projects/*/locations/{location}.
  • client_tls_policy_id (::String) — Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy".
  • client_tls_policy (::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy, ::Hash) — Required. ClientTlsPolicy resource to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest.new

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

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

#create_server_tls_policy

def create_server_tls_policy(request, options = nil) -> ::Gapic::Operation
def create_server_tls_policy(parent: nil, server_tls_policy_id: nil, server_tls_policy: nil) -> ::Gapic::Operation

Creates a new ServerTlsPolicy in a given project and location.

Overloads
def create_server_tls_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_server_tls_policy via a request object, either of type CreateServerTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest, ::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_server_tls_policy(parent: nil, server_tls_policy_id: nil, server_tls_policy: nil) -> ::Gapic::Operation
Pass arguments to create_server_tls_policy 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 ServerTlsPolicy. Must be in the format projects/*/locations/{location}.
  • server_tls_policy_id (::String) — Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy".
  • server_tls_policy (::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy, ::Hash) — Required. ServerTlsPolicy resource to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest.new

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

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

#delete_authorization_policy

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

Deletes a single AuthorizationPolicy.

Overloads
def delete_authorization_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_authorization_policy via a request object, either of type DeleteAuthorizationPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest, ::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_authorization_policy(name: nil) -> ::Gapic::Operation
Pass arguments to delete_authorization_policy 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. A name of the AuthorizationPolicy to delete. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest.new

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

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

#delete_client_tls_policy

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

Deletes a single ClientTlsPolicy.

Overloads
def delete_client_tls_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_client_tls_policy via a request object, either of type DeleteClientTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest, ::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_client_tls_policy(name: nil) -> ::Gapic::Operation
Pass arguments to delete_client_tls_policy 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. A name of the ClientTlsPolicy to delete. Must be in the format projects/*/locations/{location}/clientTlsPolicies/*.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest.new

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

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

#delete_server_tls_policy

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

Deletes a single ServerTlsPolicy.

Overloads
def delete_server_tls_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_server_tls_policy via a request object, either of type DeleteServerTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest, ::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_server_tls_policy(name: nil) -> ::Gapic::Operation
Pass arguments to delete_server_tls_policy 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. A name of the ServerTlsPolicy to delete. Must be in the format projects/*/locations/{location}/serverTlsPolicies/*.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest.new

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

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

#get_authorization_policy

def get_authorization_policy(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy
def get_authorization_policy(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy

Gets details of a single AuthorizationPolicy.

Overloads
def get_authorization_policy(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy
Pass arguments to get_authorization_policy via a request object, either of type GetAuthorizationPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest, ::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_authorization_policy(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy
Pass arguments to get_authorization_policy 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. A name of the AuthorizationPolicy to get. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest.new

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

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy.
p result

#get_client_tls_policy

def get_client_tls_policy(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy
def get_client_tls_policy(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy

Gets details of a single ClientTlsPolicy.

Overloads
def get_client_tls_policy(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy
Pass arguments to get_client_tls_policy via a request object, either of type GetClientTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest, ::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_client_tls_policy(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy
Pass arguments to get_client_tls_policy 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. A name of the ClientTlsPolicy to get. Must be in the format projects/*/locations/{location}/clientTlsPolicies/*.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest.new

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

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy.
p result

#get_server_tls_policy

def get_server_tls_policy(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy
def get_server_tls_policy(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy

Gets details of a single ServerTlsPolicy.

Overloads
def get_server_tls_policy(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy
Pass arguments to get_server_tls_policy via a request object, either of type GetServerTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest, ::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_server_tls_policy(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy
Pass arguments to get_server_tls_policy 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. A name of the ServerTlsPolicy to get. Must be in the format projects/*/locations/{location}/serverTlsPolicies/*.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest.new

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

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy.
p result

#iam_policy_client

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

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

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

#initialize

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

Create a new NetworkSecurity client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config|
  config.timeout = 10.0
end

#list_authorization_policies

def list_authorization_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy>
def list_authorization_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy>

Lists AuthorizationPolicies in a given project and location.

Overloads
def list_authorization_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy>
Pass arguments to list_authorization_policies via a request object, either of type ListAuthorizationPoliciesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest, ::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_authorization_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy>
Pass arguments to list_authorization_policies 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 project and location from which the AuthorizationPolicies should be listed, specified in the format projects/{project}/locations/{location}.
  • page_size (::Integer) — Maximum number of AuthorizationPolicies to return per call.
  • page_token (::String) — The value returned by the last ListAuthorizationPoliciesResponse Indicates that this is a continuation of a prior ListAuthorizationPolicies call, and that the system should return the next page of data.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy.
  p response
end

#list_client_tls_policies

def list_client_tls_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy>
def list_client_tls_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy>

Lists ClientTlsPolicies in a given project and location.

Overloads
def list_client_tls_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy>
Pass arguments to list_client_tls_policies via a request object, either of type ListClientTlsPoliciesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest, ::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_client_tls_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy>
Pass arguments to list_client_tls_policies 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 project and location from which the ClientTlsPolicies should be listed, specified in the format projects/*/locations/{location}.
  • page_size (::Integer) — Maximum number of ClientTlsPolicies to return per call.
  • page_token (::String) — The value returned by the last ListClientTlsPoliciesResponse Indicates that this is a continuation of a prior ListClientTlsPolicies call, and that the system should return the next page of data.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy.
  p response
end

#list_server_tls_policies

def list_server_tls_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy>
def list_server_tls_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy>

Lists ServerTlsPolicies in a given project and location.

Overloads
def list_server_tls_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy>
Pass arguments to list_server_tls_policies via a request object, either of type ListServerTlsPoliciesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest, ::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_server_tls_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy>
Pass arguments to list_server_tls_policies 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 project and location from which the ServerTlsPolicies should be listed, specified in the format projects/*/locations/{location}.
  • page_size (::Integer) — Maximum number of ServerTlsPolicies to return per call.
  • page_token (::String) — The value returned by the last ListServerTlsPoliciesResponse Indicates that this is a continuation of a prior ListServerTlsPolicies call, and that the system should return the next page of data.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy.
  p response
end

#location_client

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

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

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

#operations_client

def operations_client() -> ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Operations

Get the associated client for long-running operations.

#update_authorization_policy

def update_authorization_policy(request, options = nil) -> ::Gapic::Operation
def update_authorization_policy(update_mask: nil, authorization_policy: nil) -> ::Gapic::Operation

Updates the parameters of a single AuthorizationPolicy.

Overloads
def update_authorization_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_authorization_policy via a request object, either of type UpdateAuthorizationPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest, ::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_authorization_policy(update_mask: nil, authorization_policy: nil) -> ::Gapic::Operation
Pass arguments to update_authorization_policy 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask is used to specify the fields to be overwritten in the AuthorizationPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • authorization_policy (::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy, ::Hash) — Required. Updated AuthorizationPolicy resource.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest.new

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

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

#update_client_tls_policy

def update_client_tls_policy(request, options = nil) -> ::Gapic::Operation
def update_client_tls_policy(update_mask: nil, client_tls_policy: nil) -> ::Gapic::Operation

Updates the parameters of a single ClientTlsPolicy.

Overloads
def update_client_tls_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_client_tls_policy via a request object, either of type UpdateClientTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest, ::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_client_tls_policy(update_mask: nil, client_tls_policy: nil) -> ::Gapic::Operation
Pass arguments to update_client_tls_policy 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask is used to specify the fields to be overwritten in the ClientTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • client_tls_policy (::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy, ::Hash) — Required. Updated ClientTlsPolicy resource.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest.new

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

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

#update_server_tls_policy

def update_server_tls_policy(request, options = nil) -> ::Gapic::Operation
def update_server_tls_policy(update_mask: nil, server_tls_policy: nil) -> ::Gapic::Operation

Updates the parameters of a single ServerTlsPolicy.

Overloads
def update_server_tls_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_server_tls_policy via a request object, either of type UpdateServerTlsPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest, ::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_server_tls_policy(update_mask: nil, server_tls_policy: nil) -> ::Gapic::Operation
Pass arguments to update_server_tls_policy 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask is used to specify the fields to be overwritten in the ServerTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • server_tls_policy (::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy, ::Hash) — Required. Updated ServerTlsPolicy resource.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest.new

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

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