class Google::Cloud::Dataplex::V1::MetadataService::Rest::Client
partitions.
Metadata service manages metadata resources such as tables, filesets and
REST 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
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Entity)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.create_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_entity.timeout, metadata: call_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.create_entity request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def create_partition request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Partition)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.create_partition.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_partition.timeout, metadata: call_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.create_partition request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def delete_entity request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Protobuf::Empty)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.delete_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_entity.timeout, metadata: call_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.delete_entity request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def delete_partition request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Protobuf::Empty)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.delete_partition.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_partition.timeout, metadata: call_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.delete_partition request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def get_entity request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Entity)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.get_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_entity.timeout, metadata: call_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.get_entity request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def get_partition request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Partition)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.get_partition.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_partition.timeout, metadata: call_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.get_partition request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def initialize
- Yieldparam: config -
Other tags:
- Yield: - Configure the MetadataService client.
def initialize # 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::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.bindings_override = @config.bindings_override end @metadata_service_stub = ::Google::Cloud::Dataplex::V1::MetadataService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials end
def list_entities request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Entity>)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.list_entities.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_entities.timeout, metadata: call_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.list_entities request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_entities, "entities", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def list_partitions request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Partition>)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.list_partitions.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_partitions.timeout, metadata: call_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.list_partitions request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_partitions, "partitions", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end
def update_entity request, options = nil
-
(::Google::Cloud::Error)- if the REST call is aborted.
Returns:
-
(::Google::Cloud::Dataplex::V1::Entity)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
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 call_metadata = @config.rpcs.update_entity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_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, transports_version_send: [:rest] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_entity.timeout, metadata: call_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.update_entity request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end