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

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

REST 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::Rest::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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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

#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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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

#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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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_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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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_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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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_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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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_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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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::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 NetworkSecurity REST 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::Rest::Client.new

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

#list_authorization_policies

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

Lists AuthorizationPolicies in a given project and location.

Overloads
def list_authorization_policies(request, options = nil) -> ::Gapic::Rest::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::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy.
  p item
end

#list_client_tls_policies

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

Lists ClientTlsPolicies in a given project and location.

Overloads
def list_client_tls_policies(request, options = nil) -> ::Gapic::Rest::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::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy.
  p item
end

#list_server_tls_policies

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

Lists ServerTlsPolicies in a given project and location.

Overloads
def list_server_tls_policies(request, options = nil) -> ::Gapic::Rest::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::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy.
  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::NetworkSecurity::V1beta1::NetworkSecurity::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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

#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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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

#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
  • (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_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::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 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