Class: Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/service_directory/v1/registration_service/rest/client.rb
Overview
REST 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) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Creates a endpoint, and returns the new Endpoint.
-
#create_namespace(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Creates a namespace, and returns the new Namespace.
-
#create_service(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Creates a service, and returns the new Service.
-
#delete_endpoint(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a endpoint.
-
#delete_namespace(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a namespace.
-
#delete_service(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a service.
-
#get_endpoint(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Gets a endpoint.
-
#get_iam_policy(request, options = nil) {|result, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the IAM Policy for a resource (namespace or service only).
-
#get_namespace(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Gets a namespace.
-
#get_service(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Gets a service.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new RegistrationService REST client object.
-
#list_endpoints(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
Lists all endpoints.
-
#list_namespaces(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
Lists all namespaces.
-
#list_services(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
Lists all services belonging to a namespace.
-
#set_iam_policy(request, options = nil) {|result, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets the IAM Policy for a resource (namespace or service only).
-
#test_iam_permissions(request, options = nil) {|result, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Tests IAM permissions for a resource (namespace or service only).
-
#update_endpoint(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Updates a endpoint.
-
#update_namespace(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Updates a namespace.
-
#update_service(request, options = nil) {|result, 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 REST client object.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 130 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 == 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 = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the RegistrationService Client class.
See Configuration for a description of the configuration fields.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 72 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.
109 110 111 112 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 109 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.
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 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 915 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.create_endpoint request, 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 |
#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.
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 195 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.create_namespace request, 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 |
#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.
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 559 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.create_service request, 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 |
#delete_endpoint(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_endpoint(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a endpoint.
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1200 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.delete_endpoint request, 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 |
#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.
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 487 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.delete_namespace request, 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 |
#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.
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 843 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.delete_service request, 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 |
#get_endpoint(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint #get_endpoint(name: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Endpoint
Gets a endpoint.
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1074 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.get_endpoint request, 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 |
#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).
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1266 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.get_iam_policy request, 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 |
#get_namespace(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace #get_namespace(name: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Namespace
Gets a namespace.
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 391 392 393 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 360 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.get_namespace request, 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 |
#get_service(request, options = nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service #get_service(name: nil) ⇒ ::Google::Cloud::ServiceDirectory::V1::Service
Gets a service.
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 744 745 746 747 748 749 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 716 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.get_service request, 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 |
#list_endpoints(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint> #list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
Lists all endpoints.
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 1038 1039 1040 1041 1042 1043 1044 1045 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1011 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.list_endpoints request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_endpoints, "endpoints", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_namespaces(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace> #list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
Lists all namespaces.
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 297 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.list_namespaces request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_namespaces, "namespaces", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_services(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service> #list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
Lists all services belonging to a namespace.
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 653 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.list_services request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_services, "services", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => 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).
1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1340 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.set_iam_policy request, 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 |
#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).
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1408 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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. request, 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 |
#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.
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 1138 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.update_endpoint request, 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 |
#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.
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 424 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.update_namespace request, 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 |
#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.
780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
# File 'lib/google/cloud/service_directory/v1/registration_service/rest/client.rb', line 780 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, transports_version_send: [:rest] [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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.update_service request, 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 |