google-cloud-run-v2 0.11.0 → 0.13.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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -99
- data/lib/google/cloud/run/v2/condition_pb.rb +1 -1
- data/lib/google/cloud/run/v2/execution_pb.rb +2 -1
- data/lib/google/cloud/run/v2/execution_services_pb.rb +2 -0
- data/lib/google/cloud/run/v2/executions/client.rb +148 -14
- data/lib/google/cloud/run/v2/executions/operations.rb +28 -6
- data/lib/google/cloud/run/v2/executions/rest/client.rb +143 -13
- data/lib/google/cloud/run/v2/executions/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/executions/rest/service_stub.rb +74 -2
- data/lib/google/cloud/run/v2/job_pb.rb +8 -1
- data/lib/google/cloud/run/v2/jobs/client.rb +67 -21
- data/lib/google/cloud/run/v2/jobs/operations.rb +28 -6
- data/lib/google/cloud/run/v2/jobs/rest/client.rb +39 -8
- data/lib/google/cloud/run/v2/jobs/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +14 -2
- data/lib/google/cloud/run/v2/k8s.min_pb.rb +3 -1
- data/lib/google/cloud/run/v2/revisions/client.rb +33 -8
- data/lib/google/cloud/run/v2/revisions/operations.rb +28 -6
- data/lib/google/cloud/run/v2/revisions/rest/client.rb +35 -7
- data/lib/google/cloud/run/v2/revisions/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +14 -2
- data/lib/google/cloud/run/v2/services/client.rb +33 -8
- data/lib/google/cloud/run/v2/services/operations.rb +28 -6
- data/lib/google/cloud/run/v2/services/rest/client.rb +35 -7
- data/lib/google/cloud/run/v2/services/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/services/rest/service_stub.rb +14 -2
- data/lib/google/cloud/run/v2/task_pb.rb +1 -1
- data/lib/google/cloud/run/v2/tasks/client.rb +32 -8
- data/lib/google/cloud/run/v2/tasks/rest/client.rb +34 -7
- data/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/run/v2/vendor_settings_pb.rb +3 -1
- data/lib/google/cloud/run/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/run/v2/condition.rb +3 -0
- data/proto_docs/google/cloud/run/v2/execution.rb +26 -6
- data/proto_docs/google/cloud/run/v2/job.rb +42 -0
- data/proto_docs/google/cloud/run/v2/k8s.min.rb +44 -4
- data/proto_docs/google/cloud/run/v2/task.rb +7 -2
- data/proto_docs/google/cloud/run/v2/vendor_settings.rb +33 -5
- metadata +7 -7
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Cloud Run Revision Control Plane API.
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
|
36
|
+
|
34
37
|
include Paths
|
35
38
|
|
36
39
|
# @private
|
@@ -91,6 +94,15 @@ module Google
|
|
91
94
|
@config
|
92
95
|
end
|
93
96
|
|
97
|
+
##
|
98
|
+
# The effective universe domain
|
99
|
+
#
|
100
|
+
# @return [String]
|
101
|
+
#
|
102
|
+
def universe_domain
|
103
|
+
@revisions_stub.universe_domain
|
104
|
+
end
|
105
|
+
|
94
106
|
##
|
95
107
|
# Create a new Revisions client object.
|
96
108
|
#
|
@@ -124,8 +136,9 @@ module Google
|
|
124
136
|
credentials = @config.credentials
|
125
137
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
126
138
|
# but only if the default endpoint does not have a region prefix.
|
127
|
-
enable_self_signed_jwt = @config.endpoint
|
128
|
-
|
139
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
140
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
141
|
+
!@config.endpoint.split(".").first.include?("-"))
|
129
142
|
credentials ||= Credentials.default scope: @config.scope,
|
130
143
|
enable_self_signed_jwt: enable_self_signed_jwt
|
131
144
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -138,18 +151,22 @@ module Google
|
|
138
151
|
config.credentials = credentials
|
139
152
|
config.quota_project = @quota_project_id
|
140
153
|
config.endpoint = @config.endpoint
|
154
|
+
config.universe_domain = @config.universe_domain
|
141
155
|
end
|
142
156
|
|
143
157
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
144
158
|
config.credentials = credentials
|
145
159
|
config.quota_project = @quota_project_id
|
146
160
|
config.endpoint = @config.endpoint
|
161
|
+
config.universe_domain = @config.universe_domain
|
147
162
|
end
|
148
163
|
|
149
164
|
@revisions_stub = ::Gapic::ServiceStub.new(
|
150
165
|
::Google::Cloud::Run::V2::Revisions::Stub,
|
151
|
-
credentials:
|
152
|
-
endpoint:
|
166
|
+
credentials: credentials,
|
167
|
+
endpoint: @config.endpoint,
|
168
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
169
|
+
universe_domain: @config.universe_domain,
|
153
170
|
channel_args: @config.channel_args,
|
154
171
|
interceptors: @config.interceptors,
|
155
172
|
channel_pool_config: @config.channel_pool
|
@@ -499,9 +516,9 @@ module Google
|
|
499
516
|
# end
|
500
517
|
#
|
501
518
|
# @!attribute [rw] endpoint
|
502
|
-
#
|
503
|
-
#
|
504
|
-
# @return [::String]
|
519
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
520
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
521
|
+
# @return [::String,nil]
|
505
522
|
# @!attribute [rw] credentials
|
506
523
|
# Credentials to send with calls. You may provide any of the following types:
|
507
524
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -547,13 +564,20 @@ module Google
|
|
547
564
|
# @!attribute [rw] quota_project
|
548
565
|
# A separate project against which to charge quota.
|
549
566
|
# @return [::String]
|
567
|
+
# @!attribute [rw] universe_domain
|
568
|
+
# The universe domain within which to make requests. This determines the
|
569
|
+
# default endpoint URL. The default value of nil uses the environment
|
570
|
+
# universe (usually the default "googleapis.com" universe).
|
571
|
+
# @return [::String,nil]
|
550
572
|
#
|
551
573
|
class Configuration
|
552
574
|
extend ::Gapic::Config
|
553
575
|
|
576
|
+
# @private
|
577
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
554
578
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
555
579
|
|
556
|
-
config_attr :endpoint,
|
580
|
+
config_attr :endpoint, nil, ::String, nil
|
557
581
|
config_attr :credentials, nil do |value|
|
558
582
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
559
583
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -568,6 +592,7 @@ module Google
|
|
568
592
|
config_attr :metadata, nil, ::Hash, nil
|
569
593
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
570
594
|
config_attr :quota_project, nil, ::String, nil
|
595
|
+
config_attr :universe_domain, nil, ::String, nil
|
571
596
|
|
572
597
|
# @private
|
573
598
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module Revisions
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
|
31
|
+
|
29
32
|
# @private
|
30
33
|
attr_reader :operations_stub
|
31
34
|
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@config
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The effective universe domain
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
#
|
71
|
+
def universe_domain
|
72
|
+
@operations_stub.universe_domain
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Create a new Operations client object.
|
65
77
|
#
|
@@ -90,8 +102,10 @@ module Google
|
|
90
102
|
|
91
103
|
@operations_stub = ::Gapic::ServiceStub.new(
|
92
104
|
::Google::Longrunning::Operations::Stub,
|
93
|
-
credentials:
|
94
|
-
endpoint:
|
105
|
+
credentials: credentials,
|
106
|
+
endpoint: @config.endpoint,
|
107
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
108
|
+
universe_domain: @config.universe_domain,
|
95
109
|
channel_args: @config.channel_args,
|
96
110
|
interceptors: @config.interceptors,
|
97
111
|
channel_pool_config: @config.channel_pool
|
@@ -621,9 +635,9 @@ module Google
|
|
621
635
|
# end
|
622
636
|
#
|
623
637
|
# @!attribute [rw] endpoint
|
624
|
-
#
|
625
|
-
#
|
626
|
-
# @return [::String]
|
638
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
639
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
640
|
+
# @return [::String,nil]
|
627
641
|
# @!attribute [rw] credentials
|
628
642
|
# Credentials to send with calls. You may provide any of the following types:
|
629
643
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -669,13 +683,20 @@ module Google
|
|
669
683
|
# @!attribute [rw] quota_project
|
670
684
|
# A separate project against which to charge quota.
|
671
685
|
# @return [::String]
|
686
|
+
# @!attribute [rw] universe_domain
|
687
|
+
# The universe domain within which to make requests. This determines the
|
688
|
+
# default endpoint URL. The default value of nil uses the environment
|
689
|
+
# universe (usually the default "googleapis.com" universe).
|
690
|
+
# @return [::String,nil]
|
672
691
|
#
|
673
692
|
class Configuration
|
674
693
|
extend ::Gapic::Config
|
675
694
|
|
695
|
+
# @private
|
696
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
676
697
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
677
698
|
|
678
|
-
config_attr :endpoint,
|
699
|
+
config_attr :endpoint, nil, ::String, nil
|
679
700
|
config_attr :credentials, nil do |value|
|
680
701
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
681
702
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -690,6 +711,7 @@ module Google
|
|
690
711
|
config_attr :metadata, nil, ::Hash, nil
|
691
712
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
692
713
|
config_attr :quota_project, nil, ::String, nil
|
714
|
+
config_attr :universe_domain, nil, ::String, nil
|
693
715
|
|
694
716
|
# @private
|
695
717
|
def initialize parent_config = nil
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# Cloud Run Revision Control Plane API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
include Paths
|
37
40
|
|
38
41
|
# @private
|
@@ -93,6 +96,15 @@ module Google
|
|
93
96
|
@config
|
94
97
|
end
|
95
98
|
|
99
|
+
##
|
100
|
+
# The effective universe domain
|
101
|
+
#
|
102
|
+
# @return [String]
|
103
|
+
#
|
104
|
+
def universe_domain
|
105
|
+
@revisions_stub.universe_domain
|
106
|
+
end
|
107
|
+
|
96
108
|
##
|
97
109
|
# Create a new Revisions REST client object.
|
98
110
|
#
|
@@ -120,8 +132,9 @@ module Google
|
|
120
132
|
credentials = @config.credentials
|
121
133
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
122
134
|
# but only if the default endpoint does not have a region prefix.
|
123
|
-
enable_self_signed_jwt = @config.endpoint
|
124
|
-
|
135
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
136
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
137
|
+
!@config.endpoint.split(".").first.include?("-"))
|
125
138
|
credentials ||= Credentials.default scope: @config.scope,
|
126
139
|
enable_self_signed_jwt: enable_self_signed_jwt
|
127
140
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -135,15 +148,22 @@ module Google
|
|
135
148
|
config.credentials = credentials
|
136
149
|
config.quota_project = @quota_project_id
|
137
150
|
config.endpoint = @config.endpoint
|
151
|
+
config.universe_domain = @config.universe_domain
|
138
152
|
end
|
139
153
|
|
140
154
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
141
155
|
config.credentials = credentials
|
142
156
|
config.quota_project = @quota_project_id
|
143
157
|
config.endpoint = @config.endpoint
|
158
|
+
config.universe_domain = @config.universe_domain
|
144
159
|
end
|
145
160
|
|
146
|
-
@revisions_stub = ::Google::Cloud::Run::V2::Revisions::Rest::ServiceStub.new
|
161
|
+
@revisions_stub = ::Google::Cloud::Run::V2::Revisions::Rest::ServiceStub.new(
|
162
|
+
endpoint: @config.endpoint,
|
163
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
164
|
+
universe_domain: @config.universe_domain,
|
165
|
+
credentials: credentials
|
166
|
+
)
|
147
167
|
end
|
148
168
|
|
149
169
|
##
|
@@ -459,9 +479,9 @@ module Google
|
|
459
479
|
# end
|
460
480
|
#
|
461
481
|
# @!attribute [rw] endpoint
|
462
|
-
#
|
463
|
-
#
|
464
|
-
# @return [::String]
|
482
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
483
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
484
|
+
# @return [::String,nil]
|
465
485
|
# @!attribute [rw] credentials
|
466
486
|
# Credentials to send with calls. You may provide any of the following types:
|
467
487
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -498,13 +518,20 @@ module Google
|
|
498
518
|
# @!attribute [rw] quota_project
|
499
519
|
# A separate project against which to charge quota.
|
500
520
|
# @return [::String]
|
521
|
+
# @!attribute [rw] universe_domain
|
522
|
+
# The universe domain within which to make requests. This determines the
|
523
|
+
# default endpoint URL. The default value of nil uses the environment
|
524
|
+
# universe (usually the default "googleapis.com" universe).
|
525
|
+
# @return [::String,nil]
|
501
526
|
#
|
502
527
|
class Configuration
|
503
528
|
extend ::Gapic::Config
|
504
529
|
|
530
|
+
# @private
|
531
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
505
532
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
506
533
|
|
507
|
-
config_attr :endpoint,
|
534
|
+
config_attr :endpoint, nil, ::String, nil
|
508
535
|
config_attr :credentials, nil do |value|
|
509
536
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
510
537
|
allowed.any? { |klass| klass === value }
|
@@ -516,6 +543,7 @@ module Google
|
|
516
543
|
config_attr :metadata, nil, ::Hash, nil
|
517
544
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
518
545
|
config_attr :quota_project, nil, ::String, nil
|
546
|
+
config_attr :universe_domain, nil, ::String, nil
|
519
547
|
|
520
548
|
# @private
|
521
549
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module Rest
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
|
31
|
+
|
29
32
|
# @private
|
30
33
|
attr_reader :operations_stub
|
31
34
|
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@config
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The effective universe domain
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
#
|
71
|
+
def universe_domain
|
72
|
+
@operations_stub.universe_domain
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Create a new Operations client object.
|
65
77
|
#
|
@@ -84,8 +96,10 @@ module Google
|
|
84
96
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
85
97
|
|
86
98
|
@operations_stub = OperationsServiceStub.new(
|
87
|
-
endpoint:
|
88
|
-
|
99
|
+
endpoint: @config.endpoint,
|
100
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
101
|
+
universe_domain: @config.universe_domain,
|
102
|
+
credentials: credentials
|
89
103
|
)
|
90
104
|
|
91
105
|
# Used by an LRO wrapper for some methods of this service
|
@@ -576,9 +590,9 @@ module Google
|
|
576
590
|
# end
|
577
591
|
#
|
578
592
|
# @!attribute [rw] endpoint
|
579
|
-
#
|
580
|
-
#
|
581
|
-
# @return [::String]
|
593
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
594
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
595
|
+
# @return [::String,nil]
|
582
596
|
# @!attribute [rw] credentials
|
583
597
|
# Credentials to send with calls. You may provide any of the following types:
|
584
598
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -615,13 +629,20 @@ module Google
|
|
615
629
|
# @!attribute [rw] quota_project
|
616
630
|
# A separate project against which to charge quota.
|
617
631
|
# @return [::String]
|
632
|
+
# @!attribute [rw] universe_domain
|
633
|
+
# The universe domain within which to make requests. This determines the
|
634
|
+
# default endpoint URL. The default value of nil uses the environment
|
635
|
+
# universe (usually the default "googleapis.com" universe).
|
636
|
+
# @return [::String,nil]
|
618
637
|
#
|
619
638
|
class Configuration
|
620
639
|
extend ::Gapic::Config
|
621
640
|
|
641
|
+
# @private
|
642
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
622
643
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
623
644
|
|
624
|
-
config_attr :endpoint,
|
645
|
+
config_attr :endpoint, nil, ::String, nil
|
625
646
|
config_attr :credentials, nil do |value|
|
626
647
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
627
648
|
allowed.any? { |klass| klass === value }
|
@@ -633,6 +654,7 @@ module Google
|
|
633
654
|
config_attr :metadata, nil, ::Hash, nil
|
634
655
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
635
656
|
config_attr :quota_project, nil, ::String, nil
|
657
|
+
config_attr :universe_domain, nil, ::String, nil
|
636
658
|
|
637
659
|
# @private
|
638
660
|
def initialize parent_config = nil
|
@@ -722,12 +744,15 @@ module Google
|
|
722
744
|
# Service stub contains baseline method implementations
|
723
745
|
# including transcoding, making the REST call, and deserialing the response.
|
724
746
|
class OperationsServiceStub
|
725
|
-
def initialize endpoint:, credentials:
|
747
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
726
748
|
# These require statements are intentionally placed here to initialize
|
727
749
|
# the REST modules only when it's required.
|
728
750
|
require "gapic/rest"
|
729
751
|
|
730
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
752
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
753
|
+
endpoint_template: endpoint_template,
|
754
|
+
universe_domain: universe_domain,
|
755
|
+
credentials: credentials
|
731
756
|
end
|
732
757
|
|
733
758
|
##
|
@@ -30,16 +30,28 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
def initialize endpoint:, credentials:
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
34
34
|
# These require statements are intentionally placed here to initialize
|
35
35
|
# the REST modules only when it's required.
|
36
36
|
require "gapic/rest"
|
37
37
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
39
42
|
numeric_enums: true,
|
40
43
|
raise_faraday_errors: false
|
41
44
|
end
|
42
45
|
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
43
55
|
##
|
44
56
|
# Baseline implementation for the get_revision REST call
|
45
57
|
#
|
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Cloud Run Service Control Plane API
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
|
36
|
+
|
34
37
|
include Paths
|
35
38
|
|
36
39
|
# @private
|
@@ -107,6 +110,15 @@ module Google
|
|
107
110
|
@config
|
108
111
|
end
|
109
112
|
|
113
|
+
##
|
114
|
+
# The effective universe domain
|
115
|
+
#
|
116
|
+
# @return [String]
|
117
|
+
#
|
118
|
+
def universe_domain
|
119
|
+
@services_stub.universe_domain
|
120
|
+
end
|
121
|
+
|
110
122
|
##
|
111
123
|
# Create a new Services client object.
|
112
124
|
#
|
@@ -140,8 +152,9 @@ module Google
|
|
140
152
|
credentials = @config.credentials
|
141
153
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
142
154
|
# but only if the default endpoint does not have a region prefix.
|
143
|
-
enable_self_signed_jwt = @config.endpoint
|
144
|
-
|
155
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
156
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
157
|
+
!@config.endpoint.split(".").first.include?("-"))
|
145
158
|
credentials ||= Credentials.default scope: @config.scope,
|
146
159
|
enable_self_signed_jwt: enable_self_signed_jwt
|
147
160
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -154,18 +167,22 @@ module Google
|
|
154
167
|
config.credentials = credentials
|
155
168
|
config.quota_project = @quota_project_id
|
156
169
|
config.endpoint = @config.endpoint
|
170
|
+
config.universe_domain = @config.universe_domain
|
157
171
|
end
|
158
172
|
|
159
173
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
160
174
|
config.credentials = credentials
|
161
175
|
config.quota_project = @quota_project_id
|
162
176
|
config.endpoint = @config.endpoint
|
177
|
+
config.universe_domain = @config.universe_domain
|
163
178
|
end
|
164
179
|
|
165
180
|
@services_stub = ::Gapic::ServiceStub.new(
|
166
181
|
::Google::Cloud::Run::V2::Services::Stub,
|
167
|
-
credentials:
|
168
|
-
endpoint:
|
182
|
+
credentials: credentials,
|
183
|
+
endpoint: @config.endpoint,
|
184
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
185
|
+
universe_domain: @config.universe_domain,
|
169
186
|
channel_args: @config.channel_args,
|
170
187
|
interceptors: @config.interceptors,
|
171
188
|
channel_pool_config: @config.channel_pool
|
@@ -1008,9 +1025,9 @@ module Google
|
|
1008
1025
|
# end
|
1009
1026
|
#
|
1010
1027
|
# @!attribute [rw] endpoint
|
1011
|
-
#
|
1012
|
-
#
|
1013
|
-
# @return [::String]
|
1028
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1029
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1030
|
+
# @return [::String,nil]
|
1014
1031
|
# @!attribute [rw] credentials
|
1015
1032
|
# Credentials to send with calls. You may provide any of the following types:
|
1016
1033
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1056,13 +1073,20 @@ module Google
|
|
1056
1073
|
# @!attribute [rw] quota_project
|
1057
1074
|
# A separate project against which to charge quota.
|
1058
1075
|
# @return [::String]
|
1076
|
+
# @!attribute [rw] universe_domain
|
1077
|
+
# The universe domain within which to make requests. This determines the
|
1078
|
+
# default endpoint URL. The default value of nil uses the environment
|
1079
|
+
# universe (usually the default "googleapis.com" universe).
|
1080
|
+
# @return [::String,nil]
|
1059
1081
|
#
|
1060
1082
|
class Configuration
|
1061
1083
|
extend ::Gapic::Config
|
1062
1084
|
|
1085
|
+
# @private
|
1086
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1063
1087
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
1064
1088
|
|
1065
|
-
config_attr :endpoint,
|
1089
|
+
config_attr :endpoint, nil, ::String, nil
|
1066
1090
|
config_attr :credentials, nil do |value|
|
1067
1091
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1068
1092
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1077,6 +1101,7 @@ module Google
|
|
1077
1101
|
config_attr :metadata, nil, ::Hash, nil
|
1078
1102
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1079
1103
|
config_attr :quota_project, nil, ::String, nil
|
1104
|
+
config_attr :universe_domain, nil, ::String, nil
|
1080
1105
|
|
1081
1106
|
# @private
|
1082
1107
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module Services
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
|
31
|
+
|
29
32
|
# @private
|
30
33
|
attr_reader :operations_stub
|
31
34
|
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@config
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The effective universe domain
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
#
|
71
|
+
def universe_domain
|
72
|
+
@operations_stub.universe_domain
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Create a new Operations client object.
|
65
77
|
#
|
@@ -90,8 +102,10 @@ module Google
|
|
90
102
|
|
91
103
|
@operations_stub = ::Gapic::ServiceStub.new(
|
92
104
|
::Google::Longrunning::Operations::Stub,
|
93
|
-
credentials:
|
94
|
-
endpoint:
|
105
|
+
credentials: credentials,
|
106
|
+
endpoint: @config.endpoint,
|
107
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
108
|
+
universe_domain: @config.universe_domain,
|
95
109
|
channel_args: @config.channel_args,
|
96
110
|
interceptors: @config.interceptors,
|
97
111
|
channel_pool_config: @config.channel_pool
|
@@ -621,9 +635,9 @@ module Google
|
|
621
635
|
# end
|
622
636
|
#
|
623
637
|
# @!attribute [rw] endpoint
|
624
|
-
#
|
625
|
-
#
|
626
|
-
# @return [::String]
|
638
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
639
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
640
|
+
# @return [::String,nil]
|
627
641
|
# @!attribute [rw] credentials
|
628
642
|
# Credentials to send with calls. You may provide any of the following types:
|
629
643
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -669,13 +683,20 @@ module Google
|
|
669
683
|
# @!attribute [rw] quota_project
|
670
684
|
# A separate project against which to charge quota.
|
671
685
|
# @return [::String]
|
686
|
+
# @!attribute [rw] universe_domain
|
687
|
+
# The universe domain within which to make requests. This determines the
|
688
|
+
# default endpoint URL. The default value of nil uses the environment
|
689
|
+
# universe (usually the default "googleapis.com" universe).
|
690
|
+
# @return [::String,nil]
|
672
691
|
#
|
673
692
|
class Configuration
|
674
693
|
extend ::Gapic::Config
|
675
694
|
|
695
|
+
# @private
|
696
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
676
697
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
677
698
|
|
678
|
-
config_attr :endpoint,
|
699
|
+
config_attr :endpoint, nil, ::String, nil
|
679
700
|
config_attr :credentials, nil do |value|
|
680
701
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
681
702
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -690,6 +711,7 @@ module Google
|
|
690
711
|
config_attr :metadata, nil, ::Hash, nil
|
691
712
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
692
713
|
config_attr :quota_project, nil, ::String, nil
|
714
|
+
config_attr :universe_domain, nil, ::String, nil
|
693
715
|
|
694
716
|
# @private
|
695
717
|
def initialize parent_config = nil
|