Reference documentation and code samples for the Resource Manager V3 API class Google::Cloud::ResourceManager::V3::TagBindings::Client.
Client for the TagBindings service.
Allow users to create and manage TagBindings between TagValues and different cloud resources throughout the GCP resource hierarchy.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the TagBindings Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all TagBindings clients ::Google::Cloud::ResourceManager::V3::TagBindings::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the TagBindings 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_tag_binding
def create_tag_binding(request, options = nil) -> ::Gapic::Operation
def create_tag_binding(tag_binding: nil, validate_only: nil) -> ::Gapic::Operation
Creates a TagBinding between a TagValue and a cloud resource (currently project, folder, or organization).
def create_tag_binding(request, options = nil) -> ::Gapic::Operation
create_tag_binding
via a request object, either of type
CreateTagBindingRequest or an equivalent Hash.
- request (::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::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_tag_binding(tag_binding: nil, validate_only: nil) -> ::Gapic::Operation
create_tag_binding
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).
- tag_binding (::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash) — Required. The TagBinding to be created.
- validate_only (::Boolean) — Optional. Set to true to perform the validations necessary for creating the resource, but not actually perform the action.
- (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/resource_manager/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new # Call the create_tag_binding method. result = client.create_tag_binding 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_tag_binding
def delete_tag_binding(request, options = nil) -> ::Gapic::Operation
def delete_tag_binding(name: nil) -> ::Gapic::Operation
Deletes a TagBinding.
def delete_tag_binding(request, options = nil) -> ::Gapic::Operation
delete_tag_binding
via a request object, either of type
DeleteTagBindingRequest or an equivalent Hash.
- request (::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::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_tag_binding(name: nil) -> ::Gapic::Operation
delete_tag_binding
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. The name of the TagBinding. This is a String of the form:
tagBindings/{id}
(e.g.tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456
).
- (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/resource_manager/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new # Call the delete_tag_binding method. result = client.delete_tag_binding 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
#initialize
def initialize() { |config| ... } -> Client
Create a new TagBindings client object.
- (config) — Configure the TagBindings client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new # Create a client using a custom configuration client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| config.timeout = 10.0 end
#list_tag_bindings
def list_tag_bindings(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>
def list_tag_bindings(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>
Lists the TagBindings for the given cloud resource, as specified with
parent
.
NOTE: The parent
field is expected to be a full resource name:
https://cloud.google.com/apis/design/resource_names#full_resource_name
def list_tag_bindings(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>
list_tag_bindings
via a request object, either of type
ListTagBindingsRequest or an equivalent Hash.
- request (::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::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_tag_bindings(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>
list_tag_bindings
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 full resource name of a resource for which you want to list existing TagBindings. E.g. "//cloudresourcemanager.googleapis.com/projects/123"
- page_size (::Integer) — Optional. The maximum number of TagBindings to return in the response. The server allows a maximum of 300 TagBindings to return. If unspecified, the server will use 100 as the default.
-
page_token (::String) — Optional. A pagination token returned from a previous call to
ListTagBindings
that indicates where this listing should continue from.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/resource_manager/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new # Call the list_tag_bindings method. result = client.list_tag_bindings 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::ResourceManager::V3::TagBinding. p response end
#operations_client
def operations_client() -> ::Google::Cloud::ResourceManager::V3::TagBindings::Operations
Get the associated client for long-running operations.