class Google::Cloud::Dataplex::V1::MetadataService::Client
partitions.
Metadata service manages metadata resources such as tables, filesets and
Client for the MetadataService service.
#
def self.configure
-
(Client::Configuration)-
Other tags:
- Yieldparam: config -
Other tags:
- Yield: - Configure the Client client.
def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Dataplex", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.create_entity.timeout = 60.0 default_config.rpcs.update_entity.timeout = 60.0 default_config.rpcs.delete_entity.timeout = 60.0 default_config.rpcs.get_entity.timeout = 60.0 default_config.rpcs.get_entity.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_entities.timeout = 60.0 default_config.rpcs.list_entities.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_partition.timeout = 60.0 default_config.rpcs.delete_partition.timeout = 60.0 default_config.rpcs.get_partition.timeout = 60.0 default_config.rpcs.get_partition.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_partitions.timeout = 60.0 default_config.rpcs.list_partitions.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config end yield @configure if block_given? @configure end
def configure
-
(Client::Configuration)-
Other tags:
- Yieldparam: config -
Other tags:
- Yield: - Configure the Client client.
def configure yield @config if block_given? @config end
def create_entity request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Entity)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
validate_only(::Boolean) -- -
entity(::Google::Cloud::Dataplex::V1::Entity, ::Hash) -- -
parent(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::CreateEntityRequest, ::Hash) --
Overloads:
-
create_entity(parent: nil, entity: nil, validate_only: nil) -
create_entity(request, options = nil)
def create_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::CreateEntityRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_entity.timeout, metadata: metadata, retry_policy: @config.rpcs.create_entity.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :create_entity, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def create_partition request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Partition)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
validate_only(::Boolean) -- -
partition(::Google::Cloud::Dataplex::V1::Partition, ::Hash) -- -
parent(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::CreatePartitionRequest, ::Hash) --
Overloads:
-
create_partition(parent: nil, partition: nil, validate_only: nil) -
create_partition(request, options = nil)
def create_partition request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::CreatePartitionRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_partition.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_partition.timeout, metadata: metadata, retry_policy: @config.rpcs.create_partition.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :create_partition, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def delete_entity request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Protobuf::Empty)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
etag(::String) -- -
name(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::DeleteEntityRequest, ::Hash) --
Overloads:
-
delete_entity(name: nil, etag: nil) -
delete_entity(request, options = nil)
def delete_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::DeleteEntityRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_entity.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_entity.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :delete_entity, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def delete_partition request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Protobuf::Empty)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
etag(::String) -- -
name(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::DeletePartitionRequest, ::Hash) --
Overloads:
-
delete_partition(name: nil, etag: nil) -
delete_partition(request, options = nil)
def delete_partition request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::DeletePartitionRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_partition.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_partition.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_partition.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :delete_partition, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def get_entity request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Entity)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
view(::Google::Cloud::Dataplex::V1::GetEntityRequest::EntityView) -- -
name(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::GetEntityRequest, ::Hash) --
Overloads:
-
get_entity(name: nil, view: nil) -
get_entity(request, options = nil)
def get_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetEntityRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_entity.timeout, metadata: metadata, retry_policy: @config.rpcs.get_entity.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :get_entity, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def get_partition request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Partition)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
name(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::GetPartitionRequest, ::Hash) --
Overloads:
-
get_partition(name: nil) -
get_partition(request, options = nil)
def get_partition request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetPartitionRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_partition.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_partition.timeout, metadata: metadata, retry_policy: @config.rpcs.get_partition.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :get_partition, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def initialize
- Yieldparam: config -
Other tags:
- Yield: - Configure the MetadataService client.
def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/dataplex/v1/metadata_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @location_client = Google::Cloud::Location::Locations::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @metadata_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataplex::V1::MetadataService::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end
def list_entities request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::Entity>)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
filter(::String) -- -
page_token(::String) -- -
page_size(::Integer) -- -
view(::Google::Cloud::Dataplex::V1::ListEntitiesRequest::EntityView) -- -
parent(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::ListEntitiesRequest, ::Hash) --
Overloads:
-
list_entities(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil) -
list_entities(request, options = nil)
def list_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListEntitiesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_entities.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_entities.timeout, metadata: metadata, retry_policy: @config.rpcs.list_entities.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :list_entities, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_entities, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def list_partitions request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::Partition>)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
filter(::String) -- -
page_token(::String) -- -
page_size(::Integer) -- -
parent(::String) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::ListPartitionsRequest, ::Hash) --
Overloads:
-
list_partitions(parent: nil, page_size: nil, page_token: nil, filter: nil) -
list_partitions(request, options = nil)
def list_partitions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListPartitionsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_partitions.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_partitions.timeout, metadata: metadata, retry_policy: @config.rpcs.list_partitions.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :list_partitions, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_partitions, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
def update_entity request, options = nil
- Example: Basic example -
Raises:
-
(::Google::Cloud::Error)- if the RPC is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Entity)-
Other tags:
- Yieldparam: operation -
Yieldparam: response -
Other tags:
- Yield: - Access the result along with the RPC operation
Parameters:
-
validate_only(::Boolean) -- -
entity(::Google::Cloud::Dataplex::V1::Entity, ::Hash) -- -
options(::Gapic::CallOptions, ::Hash) -- -
request(::Google::Cloud::Dataplex::V1::UpdateEntityRequest, ::Hash) --
Overloads:
-
update_entity(entity: nil, validate_only: nil) -
update_entity(request, options = nil)
def update_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::UpdateEntityRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Dataplex::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.entity&.name header_params["entity.name"] = request.entity.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_entity.timeout, metadata: metadata, retry_policy: @config.rpcs.update_entity.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metadata_service_stub.call_rpc :update_entity, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end