google-cloud-service_directory-v1 0.3.2 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/lib/google/cloud/service_directory/v1/lookup_service/client.rb +52 -40
- data/lib/google/cloud/service_directory/v1/registration_service/client.rb +461 -108
- data/lib/google/cloud/service_directory/v1/version.rb +1 -1
- data/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb +2 -2
- data/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb +2 -2
- data/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb +1 -1
- data/lib/google/cloud/servicedirectory/v1/namespace_pb.rb +2 -2
- data/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb +2 -2
- data/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb +1 -1
- data/lib/google/cloud/servicedirectory/v1/service_pb.rb +2 -2
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb +1 -1
- data/proto_docs/google/cloud/servicedirectory/v1/namespace.rb +1 -1
- data/proto_docs/google/cloud/servicedirectory/v1/service.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: add551a374838cea816f62ca5128c16f23f5913e455ae84915417ec93daebd1b
|
4
|
+
data.tar.gz: 26b37e7584b78c5ff230ac65cde679906fcdc13bfe4471e185c48ba51ed5db1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6252683a0cb8e7bd700569013193ab7169e7b8ddbac3fbe3b784fdc23cc6b56c2232d5df541bbe60d5c72c4229b2049e4a114ce858c5124a7e1a8ad9c875db
|
7
|
+
data.tar.gz: 2073cd1daf9680f1ed8aecf7a7fc9836a53e09476cc013ee7bb1d191f9a4c6fb664cc53c4945fe508c870eac18840143352e4d18f2d32688ba17295ff822a925
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all LookupService clients
|
47
|
+
# ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -99,19 +98,15 @@ module Google
|
|
99
98
|
##
|
100
99
|
# Create a new LookupService client object.
|
101
100
|
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
# To create a new LookupService client with the default
|
105
|
-
# configuration:
|
101
|
+
# @example
|
106
102
|
#
|
107
|
-
#
|
103
|
+
# # Create a client using the default configuration
|
104
|
+
# client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new
|
108
105
|
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
# config.timeout = 10.0
|
114
|
-
# end
|
106
|
+
# # Create a client using a custom configuration
|
107
|
+
# client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config|
|
108
|
+
# config.timeout = 10.0
|
109
|
+
# end
|
115
110
|
#
|
116
111
|
# @yield [config] Configure the LookupService client.
|
117
112
|
# @yieldparam config [Client::Configuration]
|
@@ -131,10 +126,9 @@ module Google
|
|
131
126
|
|
132
127
|
# Create credentials
|
133
128
|
credentials = @config.credentials
|
134
|
-
# Use self-signed JWT if the
|
129
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
135
130
|
# but only if the default endpoint does not have a region prefix.
|
136
|
-
enable_self_signed_jwt = @config.
|
137
|
-
@config.endpoint == Client.configure.endpoint &&
|
131
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
138
132
|
!@config.endpoint.split(".").first.include?("-")
|
139
133
|
credentials ||= Credentials.default scope: @config.scope,
|
140
134
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -209,6 +203,21 @@ module Google
|
|
209
203
|
#
|
210
204
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
211
205
|
#
|
206
|
+
# @example Basic example
|
207
|
+
# require "google/cloud/service_directory/v1"
|
208
|
+
#
|
209
|
+
# # Create a client object. The client can be reused for multiple calls.
|
210
|
+
# client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new
|
211
|
+
#
|
212
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
213
|
+
# request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new
|
214
|
+
#
|
215
|
+
# # Call the resolve_service method.
|
216
|
+
# result = client.resolve_service request
|
217
|
+
#
|
218
|
+
# # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.
|
219
|
+
# p result
|
220
|
+
#
|
212
221
|
def resolve_service request, options = nil
|
213
222
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
214
223
|
|
@@ -226,16 +235,20 @@ module Google
|
|
226
235
|
gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION
|
227
236
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
228
237
|
|
229
|
-
header_params = {
|
230
|
-
|
231
|
-
|
238
|
+
header_params = {}
|
239
|
+
if request.name
|
240
|
+
header_params["name"] = request.name
|
241
|
+
end
|
242
|
+
|
232
243
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
233
244
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
234
245
|
|
235
246
|
options.apply_defaults timeout: @config.rpcs.resolve_service.timeout,
|
236
247
|
metadata: metadata,
|
237
248
|
retry_policy: @config.rpcs.resolve_service.retry_policy
|
238
|
-
|
249
|
+
|
250
|
+
options.apply_defaults timeout: @config.timeout,
|
251
|
+
metadata: @config.metadata,
|
239
252
|
retry_policy: @config.retry_policy
|
240
253
|
|
241
254
|
@lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation|
|
@@ -259,22 +272,21 @@ module Google
|
|
259
272
|
# Configuration can be applied globally to all clients, or to a single client
|
260
273
|
# on construction.
|
261
274
|
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
#
|
265
|
-
# to 20 seconds,
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
# end
|
275
|
+
# @example
|
276
|
+
#
|
277
|
+
# # Modify the global config, setting the timeout for
|
278
|
+
# # resolve_service to 20 seconds,
|
279
|
+
# # and all remaining timeouts to 10 seconds.
|
280
|
+
# ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config|
|
281
|
+
# config.timeout = 10.0
|
282
|
+
# config.rpcs.resolve_service.timeout = 20.0
|
283
|
+
# end
|
284
|
+
#
|
285
|
+
# # Apply the above configuration only to a new client.
|
286
|
+
# client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config|
|
287
|
+
# config.timeout = 10.0
|
288
|
+
# config.rpcs.resolve_service.timeout = 20.0
|
289
|
+
# end
|
278
290
|
#
|
279
291
|
# @!attribute [rw] endpoint
|
280
292
|
# The hostname or hostname:port of the service endpoint.
|