Network Services V1BETA1 API - Class Google::Cloud::NetworkServices::V1beta1::NetworkServices::Client (v0.1.0)

Reference documentation and code samples for the Network Services V1BETA1 API class Google::Cloud::NetworkServices::V1beta1::NetworkServices::Client.

Client for the NetworkServices service.

Service describing handlers for resources.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the NetworkServices 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_endpoint_policy

def create_endpoint_policy(request, options = nil) -> ::Gapic::Operation
def create_endpoint_policy(parent: nil, endpoint_policy_id: nil, endpoint_policy: nil) -> ::Gapic::Operation

Creates a new EndpointPolicy in a given project and location.

Overloads
def create_endpoint_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_endpoint_policy via a request object, either of type CreateEndpointPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkServices::V1beta1::CreateEndpointPolicyRequest, ::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_endpoint_policy(parent: nil, endpoint_policy_id: nil, endpoint_policy: nil) -> ::Gapic::Operation
Pass arguments to create_endpoint_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 EndpointPolicy. Must be in the format projects/*/locations/global.
  • endpoint_policy_id (::String) — Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".
  • endpoint_policy (::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy, ::Hash) — Required. EndpointPolicy 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_services/v1beta1"

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

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

# Call the create_endpoint_policy method.
result = client.create_endpoint_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_endpoint_policy

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

Deletes a single EndpointPolicy.

Overloads
def delete_endpoint_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_endpoint_policy via a request object, either of type DeleteEndpointPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkServices::V1beta1::DeleteEndpointPolicyRequest, ::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_endpoint_policy(name: nil) -> ::Gapic::Operation
Pass arguments to delete_endpoint_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 EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.
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_services/v1beta1"

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

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

# Call the delete_endpoint_policy method.
result = client.delete_endpoint_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_endpoint_policy

def get_endpoint_policy(request, options = nil) -> ::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy
def get_endpoint_policy(name: nil) -> ::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy

Gets details of a single EndpointPolicy.

Overloads
def get_endpoint_policy(request, options = nil) -> ::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy
Pass arguments to get_endpoint_policy via a request object, either of type GetEndpointPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkServices::V1beta1::GetEndpointPolicyRequest, ::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_endpoint_policy(name: nil) -> ::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy
Pass arguments to get_endpoint_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 EndpointPolicy to get. Must be in the format projects/*/locations/global/endpointPolicies/*.
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_services/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::NetworkServices::V1beta1::EndpointPolicy.
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 NetworkServices client object.

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

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

#list_endpoint_policies

def list_endpoint_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>
def list_endpoint_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>

Lists EndpointPolicies in a given project and location.

Overloads
def list_endpoint_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>
Pass arguments to list_endpoint_policies via a request object, either of type ListEndpointPoliciesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkServices::V1beta1::ListEndpointPoliciesRequest, ::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_endpoint_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>
Pass arguments to list_endpoint_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 EndpointPolicies should be listed, specified in the format projects/*/locations/global.
  • page_size (::Integer) — Maximum number of EndpointPolicies to return per call.
  • page_token (::String) — The value returned by the last ListEndpointPoliciesResponse Indicates that this is a continuation of a prior ListEndpointPolicies 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
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/network_services/v1beta1"

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

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

# Call the list_endpoint_policies method.
result = client.list_endpoint_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::NetworkServices::V1beta1::EndpointPolicy.
  p item
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)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

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

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_endpoint_policy

def update_endpoint_policy(request, options = nil) -> ::Gapic::Operation
def update_endpoint_policy(update_mask: nil, endpoint_policy: nil) -> ::Gapic::Operation

Updates the parameters of a single EndpointPolicy.

Overloads
def update_endpoint_policy(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_endpoint_policy via a request object, either of type UpdateEndpointPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkServices::V1beta1::UpdateEndpointPolicyRequest, ::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_endpoint_policy(update_mask: nil, endpoint_policy: nil) -> ::Gapic::Operation
Pass arguments to update_endpoint_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 EndpointPolicy 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.
  • endpoint_policy (::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy, ::Hash) — Required. Updated EndpointPolicy 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_services/v1beta1"

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

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

# Call the update_endpoint_policy method.
result = client.update_endpoint_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