Reference documentation and code samples for the Workload Identity V1 API class Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.
Client for the WorkloadIdentity service.
Service describing handlers for resources
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the WorkloadIdentity Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all WorkloadIdentity clients ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the WorkloadIdentity 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)
#generate_service_agents
def generate_service_agents(request, options = nil) -> ::Gapic::Operation
def generate_service_agents(parent: nil) -> ::Gapic::OperationCreates all service agents for a given resource, location and service producer.
def generate_service_agents(request, options = nil) -> ::Gapic::Operationgenerate_service_agents via a request object, either of type
GenerateServiceAgentsRequest or an equivalent Hash.
- request (::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest, ::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 generate_service_agents(parent: nil) -> ::Gapic::Operationgenerate_service_agents 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. The
locationfor the parent resource must beglobal.Examples:
- projects/1234/locations/global/serviceProducers/bigquery.googleapis.com
- folders/2344/locations/global/serviceProducers/vertexai.googleapis.com
- organizations/3344/locations/global/serviceProducers/iam.googleapis.com
- (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/workload_identity/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest.new # Call the generate_service_agents method. result = client.generate_service_agents 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
#initialize
def initialize() { |config| ... } -> ClientCreate a new WorkloadIdentity client object.
- (config) — Configure the WorkloadIdentity client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new # Create a client using a custom configuration client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new do |config| config.timeout = 10.0 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::WorkloadIdentity::V1::WorkloadIdentity::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)