google-cloud-profiler-v2 0.3.0 → 0.8.0

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.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/profiler/v2/export_service/client.rb +419 -0
  5. data/lib/google/cloud/profiler/v2/export_service/credentials.rb +53 -0
  6. data/lib/google/cloud/profiler/v2/export_service/paths.rb +47 -0
  7. data/lib/google/cloud/profiler/v2/export_service/rest/client.rb +383 -0
  8. data/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb +107 -0
  9. data/lib/google/cloud/profiler/v2/export_service/rest.rb +53 -0
  10. data/lib/google/cloud/profiler/v2/export_service.rb +56 -0
  11. data/lib/google/cloud/profiler/v2/profiler_service/client.rb +21 -8
  12. data/lib/google/cloud/profiler/v2/profiler_service/paths.rb +64 -0
  13. data/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb +576 -0
  14. data/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb +228 -0
  15. data/lib/google/cloud/profiler/v2/profiler_service/rest.rb +57 -0
  16. data/lib/google/cloud/profiler/v2/profiler_service.rb +8 -1
  17. data/lib/google/cloud/profiler/v2/rest.rb +38 -0
  18. data/lib/google/cloud/profiler/v2/version.rb +1 -1
  19. data/lib/google/cloud/profiler/v2.rb +8 -2
  20. data/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb +31 -38
  21. data/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb +19 -0
  22. data/proto_docs/google/api/client.rb +394 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb +48 -7
  26. metadata +23 -8
@@ -35,6 +35,8 @@ module Google
35
35
  # * Profiles can be created in either online or offline mode, see below.
36
36
  #
37
37
  class Client
38
+ include Paths
39
+
38
40
  # @private
39
41
  attr_reader :profiler_service_stub
40
42
 
@@ -67,12 +69,12 @@ module Google
67
69
  end
68
70
  default_config = Client::Configuration.new parent_config
69
71
 
70
- default_config.timeout = 30.0
72
+ default_config.timeout = 60.0
71
73
  default_config.retry_policy = {
72
74
  initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
73
75
  }
74
76
 
75
- default_config.rpcs.create_profile.timeout = 3600.0
77
+ default_config.rpcs.create_profile.timeout = 3610.0
76
78
 
77
79
  default_config.rpcs.create_offline_profile.timeout = 30.0
78
80
 
@@ -137,7 +139,7 @@ module Google
137
139
  credentials = @config.credentials
138
140
  # Use self-signed JWT if the endpoint is unchanged from default,
139
141
  # but only if the default endpoint does not have a region prefix.
140
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
143
  !@config.endpoint.split(".").first.include?("-")
142
144
  credentials ||= Credentials.default scope: @config.scope,
143
145
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -152,7 +154,8 @@ module Google
152
154
  credentials: credentials,
153
155
  endpoint: @config.endpoint,
154
156
  channel_args: @config.channel_args,
155
- interceptors: @config.interceptors
157
+ interceptors: @config.interceptors,
158
+ channel_pool_config: @config.channel_pool
156
159
  )
157
160
  end
158
161
 
@@ -370,7 +373,7 @@ module Google
370
373
  # the default parameter values, pass an empty Hash as a request object (see above).
371
374
  #
372
375
  # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash]
373
- # Profile to update
376
+ # Profile to update.
374
377
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
375
378
  # Field mask used to specify the fields to be overwritten. Currently only
376
379
  # profile_bytes and labels fields are supported by UpdateProfile, so only
@@ -479,9 +482,9 @@ module Google
479
482
  # * (`String`) The path to a service account key file in JSON format
480
483
  # * (`Hash`) A service account key as a Hash
481
484
  # * (`Google::Auth::Credentials`) A googleauth credentials object
482
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
485
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
483
486
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
484
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
487
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
485
488
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
486
489
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
487
490
  # * (`nil`) indicating no credentials
@@ -523,7 +526,9 @@ module Google
523
526
  class Configuration
524
527
  extend ::Gapic::Config
525
528
 
526
- config_attr :endpoint, "cloudprofiler.googleapis.com", ::String
529
+ DEFAULT_ENDPOINT = "cloudprofiler.googleapis.com"
530
+
531
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
527
532
  config_attr :credentials, nil do |value|
528
533
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
529
534
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -558,6 +563,14 @@ module Google
558
563
  end
559
564
  end
560
565
 
566
+ ##
567
+ # Configuration for the channel pool
568
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
569
+ #
570
+ def channel_pool
571
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
572
+ end
573
+
561
574
  ##
562
575
  # Configuration RPC class for the ProfilerService API.
563
576
  #
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Profiler
23
+ module V2
24
+ module ProfilerService
25
+ # Path helper methods for the ProfilerService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Profile resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/profiles/{profile}`
33
+ #
34
+ # @param project [String]
35
+ # @param profile [String]
36
+ #
37
+ # @return [::String]
38
+ def profile_path project:, profile:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/profiles/#{profile}"
42
+ end
43
+
44
+ ##
45
+ # Create a fully-qualified Project resource string.
46
+ #
47
+ # The resource will be in the following format:
48
+ #
49
+ # `projects/{project}`
50
+ #
51
+ # @param project [String]
52
+ #
53
+ # @return [::String]
54
+ def project_path project:
55
+ "projects/#{project}"
56
+ end
57
+
58
+ extend self
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end