Class: Google::Cloud::ServiceDirectory::V1::RegistrationService::Client
- Inherits:
-
Object
- Object
- Google::Cloud::ServiceDirectory::V1::RegistrationService::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/service_directory/v1/registration_service/client.rb
Overview
Client for the RegistrationService service.
Service Directory API for registering services. It defines the following resource model:
The API has a collection of Namespace resources, named
projects/*/locations/*/namespaces/*
.Each Namespace has a collection of Service resources, named
projects/*/locations/*/namespaces/*/services/*
.Each Service has a collection of Endpoint resources, named
projects/*/locations/*/namespaces/*/services/*/endpoints/*
.
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the RegistrationService Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the RegistrationService Client instance.
-
#create_endpoint(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Creates a endpoint, and returns the new Endpoint.
-
#create_namespace(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Creates a namespace, and returns the new Namespace.
-
#create_service(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Creates a service, and returns the new Service.
-
#delete_endpoint(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a endpoint.
-
#delete_namespace(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a namespace.
-
#delete_service(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a service.
-
#get_endpoint(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Gets a endpoint.
-
#get_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the IAM Policy for a resource (namespace or service only).
-
#get_namespace(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Gets a namespace.
-
#get_service(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Gets a service.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new RegistrationService client object.
-
#list_endpoints(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
Lists all endpoints.
-
#list_namespaces(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
Lists all namespaces.
-
#list_services(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
Lists all services belonging to a namespace.
-
#set_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets the IAM Policy for a resource (namespace or service only).
-
#test_iam_permissions(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Tests IAM permissions for a resource (namespace or service only).
-
#update_endpoint(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Updates a endpoint.
-
#update_namespace(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Updates a namespace.
-
#update_service(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Updates a service.
Methods included from Paths
#endpoint_path, #location_path, #namespace_path, #service_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new RegistrationService client object.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 128 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/servicedirectory/v1/registration_service_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 == Client.configure.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 @registration_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the RegistrationService Client class.
See Configuration for a description of the configuration fields.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 70 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "ServiceDirectory", "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.timeout = 15.0 default_config.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the RegistrationService 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 configure.
See Configuration for a description of the configuration fields.
107 108 109 110 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 107 def configure yield @config if block_given? @config end |
#create_endpoint(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint #create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Creates a endpoint, and returns the new Endpoint.
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1179 def create_endpoint request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_endpoint..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_endpoint.timeout, metadata: , retry_policy: @config.rpcs.create_endpoint.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :create_endpoint, request, 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 |
#create_namespace(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace #create_namespace(parent: nil, namespace_id: nil, namespace: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Creates a namespace, and returns the new Namespace.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 221 def create_namespace request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_namespace..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_namespace.timeout, metadata: , retry_policy: @config.rpcs.create_namespace.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :create_namespace, request, 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 |
#create_service(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service #create_service(parent: nil, service_id: nil, service: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Creates a service, and returns the new Service.
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 704 def create_service request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_service..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_service.timeout, metadata: , retry_policy: @config.rpcs.create_service.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :create_service, request, 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 |
#delete_endpoint(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_endpoint(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a endpoint.
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1560 def delete_endpoint request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_endpoint..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, metadata: , retry_policy: @config.rpcs.delete_endpoint.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :delete_endpoint, request, 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 |
#delete_namespace(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_namespace(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a namespace. This also deletes all services and endpoints in the namespace.
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 609 def delete_namespace request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_namespace..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_namespace.timeout, metadata: , retry_policy: @config.rpcs.delete_namespace.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :delete_namespace, request, 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 |
#delete_service(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_service(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a service. This also deletes all endpoints associated with the service.
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1084 def delete_service request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_service..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_service.timeout, metadata: , retry_policy: @config.rpcs.delete_service.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :delete_service, request, 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 |
#get_endpoint(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint #get_endpoint(name: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Gets a endpoint.
1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1388 def get_endpoint request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_endpoint..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_endpoint.timeout, metadata: , retry_policy: @config.rpcs.get_endpoint.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :get_endpoint, request, 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 |
#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy
Gets the IAM Policy for a resource (namespace or service only).
1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1649 def get_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.get_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :get_iam_policy, request, 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 |
#get_namespace(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace #get_namespace(name: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Gets a namespace.
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 436 def get_namespace request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_namespace..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_namespace.timeout, metadata: , retry_policy: @config.rpcs.get_namespace.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :get_namespace, request, 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 |
#get_service(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service #get_service(name: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Gets a service.
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 911 def get_service request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_service..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_service.timeout, metadata: , retry_policy: @config.rpcs.get_service.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :get_service, request, 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 |
#list_endpoints(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint> #list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
Lists all endpoints.
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1302 def list_endpoints request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_endpoints..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_endpoints.timeout, metadata: , retry_policy: @config.rpcs.list_endpoints.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :list_endpoints, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_endpoints, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_namespaces(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace> #list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
Lists all namespaces.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 350 def list_namespaces request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_namespaces..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_namespaces.timeout, metadata: , retry_policy: @config.rpcs.list_namespaces.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :list_namespaces, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_namespaces, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service> #list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
Lists all services belonging to a namespace.
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 825 def list_services request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_services..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"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("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_services.timeout, metadata: , retry_policy: @config.rpcs.list_services.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :list_services, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_services, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy
Sets the IAM Policy for a resource (namespace or service only).
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1746 def set_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.set_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :set_iam_policy, request, 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 |
#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Tests IAM permissions for a resource (namespace or service only).
1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1837 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :test_iam_permissions, request, 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 |
#update_endpoint(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint #update_endpoint(endpoint: nil, update_mask: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Updates a endpoint.
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 1475 def update_endpoint request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_endpoint..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.endpoint&.name header_params["endpoint.name"] = request.endpoint.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_endpoint.timeout, metadata: , retry_policy: @config.rpcs.update_endpoint.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :update_endpoint, request, 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 |
#update_namespace(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace #update_namespace(namespace: nil, update_mask: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Updates a namespace.
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 523 def update_namespace request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_namespace..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.namespace&.name header_params["namespace.name"] = request.namespace.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_namespace.timeout, metadata: , retry_policy: @config.rpcs.update_namespace.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :update_namespace, request, 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 |
#update_service(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service #update_service(service: nil, update_mask: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Updates a service.
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File 'lib/google/cloud/service_directory/v1/registration_service/client.rb', line 998 def update_service request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_service..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.service&.name header_params["service.name"] = request.service.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_service.timeout, metadata: , retry_policy: @config.rpcs.update_service.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @registration_service_stub.call_rpc :update_service, request, 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 |