google-cloud-profiler-v2 0.2.0 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87d61aaaac77ee8c2fcf373c53e558d795879a2e25c803b187bef92063fdbb2e
4
- data.tar.gz: 47f6364c2d03a4fa1181a2841f4af1c7e7ce5c0b4524a756389e4f1b75b2ab8c
3
+ metadata.gz: bb2ad911ae1c5a74aadb4a0c7cb401ad67201f588d82a912151d135d5dc684c9
4
+ data.tar.gz: 51624476eb148b86c06fa97b7ba52ea57b35ad5f5ec98e7f23d6fb08f4e89fb0
5
5
  SHA512:
6
- metadata.gz: e9eee42ce876fa71731f52c5d5fbeefba22ad12c9bdaad0bcc325818c8d3756b27ca92306617b9257c05c33a61843563bfc2917bda713aff1629475eee713902
7
- data.tar.gz: b2dcf13e00b8ee75c72816ab941a80d8c636caa63267d2826406a60c415ab8732e83470e149fa457697f251d8f1da347973340189ce4fa1abbef5043b74cfc50
6
+ metadata.gz: 0c5b403a13e55c3587bf87b744fb42bc3bfd225bb7207964137707ce468831dda1b6517bd7538639189ab63a9cd1435f7ed387602af845e63001de63178fbb52
7
+ data.tar.gz: fa44484a64a9069c7e2016b97e20861d863f33091fff5f80bfa050dd19da572b9e22f7fcbf9f1d25b20b59a874dbb831146b3940302126ba6e13ad76d5f40272
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-profiler-v2
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Profiler::V2::ProfilerService::Credentials}):
68
68
 
69
- 1. `PROFILER_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `PROFILER_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `PROFILER_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `PROFILER_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/profiler/v2"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/profiler/v2"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/profiler/v2"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/profiler/v2"
34
34
 
35
35
  client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Profiler::V2::CreateProfileRequest.new # (request fields as keyword arguments...)
37
37
  response = client.create_profile request
38
38
  ```
39
39
 
@@ -44,13 +44,12 @@ module Google
44
44
  # See {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
- # ## Example
47
+ # @example
48
48
  #
49
- # To modify the configuration for all ProfilerService clients:
50
- #
51
- # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config|
52
- # config.timeout = 10.0
53
- # end
49
+ # # Modify the configuration for all ProfilerService clients
50
+ # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
54
53
  #
55
54
  # @yield [config] Configure the Client client.
56
55
  # @yieldparam config [Client::Configuration]
@@ -70,10 +69,7 @@ module Google
70
69
 
71
70
  default_config.timeout = 30.0
72
71
  default_config.retry_policy = {
73
- initial_delay: 1.0,
74
- max_delay: 10.0,
75
- multiplier: 1.3,
76
- retry_codes: [14]
72
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
73
  }
78
74
 
79
75
  default_config.rpcs.create_profile.timeout = 3600.0
@@ -111,19 +107,15 @@ module Google
111
107
  ##
112
108
  # Create a new ProfilerService client object.
113
109
  #
114
- # ## Examples
115
- #
116
- # To create a new ProfilerService client with the default
117
- # configuration:
110
+ # @example
118
111
  #
119
- # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new
120
114
  #
121
- # To create a new ProfilerService client with a custom
122
- # configuration:
123
- #
124
- # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config|
125
- # config.timeout = 10.0
126
- # end
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
127
119
  #
128
120
  # @yield [config] Configure the ProfilerService client.
129
121
  # @yieldparam config [Client::Configuration]
@@ -143,14 +135,13 @@ module Google
143
135
 
144
136
  # Create credentials
145
137
  credentials = @config.credentials
146
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
147
139
  # but only if the default endpoint does not have a region prefix.
148
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
149
- @config.endpoint == Client.configure.endpoint &&
140
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
150
141
  !@config.endpoint.split(".").first.include?("-")
151
142
  credentials ||= Credentials.default scope: @config.scope,
152
143
  enable_self_signed_jwt: enable_self_signed_jwt
153
- if credentials.is_a?(String) || credentials.is_a?(Hash)
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
154
145
  credentials = Credentials.new credentials, scope: @config.scope
155
146
  end
156
147
  @quota_project_id = @config.quota_project
@@ -212,6 +203,21 @@ module Google
212
203
  #
213
204
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
214
205
  #
206
+ # @example Basic example
207
+ # require "google/cloud/profiler/v2"
208
+ #
209
+ # # Create a client object. The client can be reused for multiple calls.
210
+ # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new
211
+ #
212
+ # # Create a request. To set request fields, pass in keyword arguments.
213
+ # request = Google::Cloud::Profiler::V2::CreateProfileRequest.new
214
+ #
215
+ # # Call the create_profile method.
216
+ # result = client.create_profile request
217
+ #
218
+ # # The returned object is of type Google::Cloud::Profiler::V2::Profile.
219
+ # p result
220
+ #
215
221
  def create_profile request, options = nil
216
222
  raise ::ArgumentError, "request must be provided" if request.nil?
217
223
 
@@ -229,16 +235,20 @@ module Google
229
235
  gapic_version: ::Google::Cloud::Profiler::V2::VERSION
230
236
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
237
 
232
- header_params = {
233
- "parent" => request.parent
234
- }
238
+ header_params = {}
239
+ if request.parent
240
+ header_params["parent"] = request.parent
241
+ end
242
+
235
243
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
236
244
  metadata[:"x-goog-request-params"] ||= request_params_header
237
245
 
238
246
  options.apply_defaults timeout: @config.rpcs.create_profile.timeout,
239
247
  metadata: metadata,
240
248
  retry_policy: @config.rpcs.create_profile.retry_policy
241
- options.apply_defaults metadata: @config.metadata,
249
+
250
+ options.apply_defaults timeout: @config.timeout,
251
+ metadata: @config.metadata,
242
252
  retry_policy: @config.retry_policy
243
253
 
244
254
  @profiler_service_stub.call_rpc :create_profile, request, options: options do |response, operation|
@@ -282,6 +292,21 @@ module Google
282
292
  #
283
293
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
284
294
  #
295
+ # @example Basic example
296
+ # require "google/cloud/profiler/v2"
297
+ #
298
+ # # Create a client object. The client can be reused for multiple calls.
299
+ # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new
300
+ #
301
+ # # Create a request. To set request fields, pass in keyword arguments.
302
+ # request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new
303
+ #
304
+ # # Call the create_offline_profile method.
305
+ # result = client.create_offline_profile request
306
+ #
307
+ # # The returned object is of type Google::Cloud::Profiler::V2::Profile.
308
+ # p result
309
+ #
285
310
  def create_offline_profile request, options = nil
286
311
  raise ::ArgumentError, "request must be provided" if request.nil?
287
312
 
@@ -299,16 +324,20 @@ module Google
299
324
  gapic_version: ::Google::Cloud::Profiler::V2::VERSION
300
325
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
326
 
302
- header_params = {
303
- "parent" => request.parent
304
- }
327
+ header_params = {}
328
+ if request.parent
329
+ header_params["parent"] = request.parent
330
+ end
331
+
305
332
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
306
333
  metadata[:"x-goog-request-params"] ||= request_params_header
307
334
 
308
335
  options.apply_defaults timeout: @config.rpcs.create_offline_profile.timeout,
309
336
  metadata: metadata,
310
337
  retry_policy: @config.rpcs.create_offline_profile.retry_policy
311
- options.apply_defaults metadata: @config.metadata,
338
+
339
+ options.apply_defaults timeout: @config.timeout,
340
+ metadata: @config.metadata,
312
341
  retry_policy: @config.retry_policy
313
342
 
314
343
  @profiler_service_stub.call_rpc :create_offline_profile, request, options: options do |response, operation|
@@ -356,6 +385,21 @@ module Google
356
385
  #
357
386
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
358
387
  #
388
+ # @example Basic example
389
+ # require "google/cloud/profiler/v2"
390
+ #
391
+ # # Create a client object. The client can be reused for multiple calls.
392
+ # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new
393
+ #
394
+ # # Create a request. To set request fields, pass in keyword arguments.
395
+ # request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new
396
+ #
397
+ # # Call the update_profile method.
398
+ # result = client.update_profile request
399
+ #
400
+ # # The returned object is of type Google::Cloud::Profiler::V2::Profile.
401
+ # p result
402
+ #
359
403
  def update_profile request, options = nil
360
404
  raise ::ArgumentError, "request must be provided" if request.nil?
361
405
 
@@ -373,16 +417,20 @@ module Google
373
417
  gapic_version: ::Google::Cloud::Profiler::V2::VERSION
374
418
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
375
419
 
376
- header_params = {
377
- "profile.name" => request.profile.name
378
- }
420
+ header_params = {}
421
+ if request.profile&.name
422
+ header_params["profile.name"] = request.profile.name
423
+ end
424
+
379
425
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
380
426
  metadata[:"x-goog-request-params"] ||= request_params_header
381
427
 
382
428
  options.apply_defaults timeout: @config.rpcs.update_profile.timeout,
383
429
  metadata: metadata,
384
430
  retry_policy: @config.rpcs.update_profile.retry_policy
385
- options.apply_defaults metadata: @config.metadata,
431
+
432
+ options.apply_defaults timeout: @config.timeout,
433
+ metadata: @config.metadata,
386
434
  retry_policy: @config.retry_policy
387
435
 
388
436
  @profiler_service_stub.call_rpc :update_profile, request, options: options do |response, operation|
@@ -406,22 +454,21 @@ module Google
406
454
  # Configuration can be applied globally to all clients, or to a single client
407
455
  # on construction.
408
456
  #
409
- # # Examples
410
- #
411
- # To modify the global config, setting the timeout for create_profile
412
- # to 20 seconds, and all remaining timeouts to 10 seconds:
413
- #
414
- # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config|
415
- # config.timeout = 10.0
416
- # config.rpcs.create_profile.timeout = 20.0
417
- # end
418
- #
419
- # To apply the above configuration only to a new client:
420
- #
421
- # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config|
422
- # config.timeout = 10.0
423
- # config.rpcs.create_profile.timeout = 20.0
424
- # end
457
+ # @example
458
+ #
459
+ # # Modify the global config, setting the timeout for
460
+ # # create_profile to 20 seconds,
461
+ # # and all remaining timeouts to 10 seconds.
462
+ # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config|
463
+ # config.timeout = 10.0
464
+ # config.rpcs.create_profile.timeout = 20.0
465
+ # end
466
+ #
467
+ # # Apply the above configuration only to a new client.
468
+ # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config|
469
+ # config.timeout = 10.0
470
+ # config.rpcs.create_profile.timeout = 20.0
471
+ # end
425
472
  #
426
473
  # @!attribute [rw] endpoint
427
474
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Profiler
23
23
  module V2
24
- VERSION = "0.2.0"
24
+ VERSION = "0.2.4"
25
25
  end
26
26
  end
27
27
  end
@@ -1,12 +1,12 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/devtools/cloudprofiler/v2/profiler.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/protobuf/duration_pb'
8
6
  require 'google/protobuf/field_mask_pb'
9
7
  require 'google/api/client_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/devtools/cloudprofiler/v2/profiler.proto", :syntax => :proto3) do
12
12
  add_message "google.devtools.cloudprofiler.v2.CreateProfileRequest" do
@@ -32,7 +32,7 @@ module Google
32
32
  # * Profiles can be created in either online or offline mode, see below.
33
33
  class Service
34
34
 
35
- include GRPC::GenericService
35
+ include ::GRPC::GenericService
36
36
 
37
37
  self.marshal_class_method = :encode
38
38
  self.unmarshal_class_method = :decode
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-profiler-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.7'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -198,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
204
  - !ruby/object:Gem::Version
199
205
  version: '0'
200
206
  requirements: []
201
- rubygems_version: 3.2.13
207
+ rubygems_version: 3.2.17
202
208
  signing_key:
203
209
  specification_version: 4
204
210
  summary: API Client library for the Cloud Profiler V2 API