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::ConfigurationConfigure the NetworkServices Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::OperationCreates a new EndpointPolicy in a given project and location.
def create_endpoint_policy(request, options = nil) -> ::Gapic::Operationcreate_endpoint_policy via a request object, either of type
CreateEndpointPolicyRequest or an equivalent Hash.
- 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::Operationcreate_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/network_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::OperationDeletes a single EndpointPolicy.
def delete_endpoint_policy(request, options = nil) -> ::Gapic::Operationdelete_endpoint_policy via a request object, either of type
DeleteEndpointPolicyRequest or an equivalent Hash.
- 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::Operationdelete_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).
-
name (::String) — Required. A name of the EndpointPolicy to delete. Must be in the format
projects/*/locations/global/endpointPolicies/*.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/network_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::EndpointPolicyGets details of a single EndpointPolicy.
def get_endpoint_policy(request, options = nil) -> ::Google::Cloud::NetworkServices::V1beta1::EndpointPolicyget_endpoint_policy via a request object, either of type
GetEndpointPolicyRequest or an equivalent Hash.
- 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::EndpointPolicyget_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).
-
name (::String) — Required. A name of the EndpointPolicy to get. Must be in the format
projects/*/locations/global/endpointPolicies/*.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ClientGet the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Client)
#initialize
def initialize() { |config| ... } -> ClientCreate a new NetworkServices client object.
- (config) — Configure the NetworkServices client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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.
def list_endpoint_policies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>list_endpoint_policies via a request object, either of type
ListEndpointPoliciesRequest or an equivalent Hash.
- 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>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).
-
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
ListEndpointPoliciesResponseIndicates that this is a continuation of a priorListEndpointPoliciescall, and that the system should return the next page of data.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::NetworkServices::V1beta1::EndpointPolicy>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::NetworkServices::V1beta1::NetworkServices::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_endpoint_policy
def update_endpoint_policy(request, options = nil) -> ::Gapic::Operation
def update_endpoint_policy(update_mask: nil, endpoint_policy: nil) -> ::Gapic::OperationUpdates the parameters of a single EndpointPolicy.
def update_endpoint_policy(request, options = nil) -> ::Gapic::Operationupdate_endpoint_policy via a request object, either of type
UpdateEndpointPolicyRequest or an equivalent Hash.
- 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::Operationupdate_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/network_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