google-cloud-service_management-v1 0.3.0 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -169,7 +169,9 @@ module Google
169
169
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
170
170
  metadata: metadata,
171
171
  retry_policy: @config.rpcs.list_operations.retry_policy
172
- options.apply_defaults metadata: @config.metadata,
172
+
173
+ options.apply_defaults timeout: @config.timeout,
174
+ metadata: @config.metadata,
173
175
  retry_policy: @config.retry_policy
174
176
 
175
177
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -239,7 +241,9 @@ module Google
239
241
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
240
242
  metadata: metadata,
241
243
  retry_policy: @config.rpcs.get_operation.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
243
247
  retry_policy: @config.retry_policy
244
248
 
245
249
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -309,7 +313,9 @@ module Google
309
313
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
310
314
  metadata: metadata,
311
315
  retry_policy: @config.rpcs.delete_operation.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
313
319
  retry_policy: @config.retry_policy
314
320
 
315
321
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -384,7 +390,9 @@ module Google
384
390
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
385
391
  metadata: metadata,
386
392
  retry_policy: @config.rpcs.cancel_operation.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
388
396
  retry_policy: @config.retry_policy
389
397
 
390
398
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -396,9 +404,9 @@ module Google
396
404
  end
397
405
 
398
406
  ##
399
- # Waits for the specified long-running operation until it is done or reaches
400
- # at most a specified timeout, returning the latest state. If the operation
401
- # is already done, the latest state is immediately returned. If the timeout
407
+ # Waits until the specified long-running operation is done or reaches at most
408
+ # a specified timeout, returning the latest state. If the operation is
409
+ # already done, the latest state is immediately returned. If the timeout
402
410
  # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
411
  # timeout is used. If the server does not support this method, it returns
404
412
  # `google.rpc.Code.UNIMPLEMENTED`.
@@ -456,7 +464,9 @@ module Google
456
464
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
465
  metadata: metadata,
458
466
  retry_policy: @config.rpcs.wait_operation.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
467
+
468
+ options.apply_defaults timeout: @config.timeout,
469
+ metadata: @config.metadata,
460
470
  retry_policy: @config.retry_policy
461
471
 
462
472
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -481,22 +491,21 @@ module Google
481
491
  # Configuration can be applied globally to all clients, or to a single client
482
492
  # on construction.
483
493
  #
484
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
493
- #
494
- # To apply the above configuration only to a new client:
495
- #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
494
+ # @example
495
+ #
496
+ # # Modify the global config, setting the timeout for
497
+ # # list_operations to 20 seconds,
498
+ # # and all remaining timeouts to 10 seconds.
499
+ # ::Google::Longrunning::Operations::Client.configure do |config|
500
+ # config.timeout = 10.0
501
+ # config.rpcs.list_operations.timeout = 20.0
502
+ # end
503
+ #
504
+ # # Apply the above configuration only to a new client.
505
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.list_operations.timeout = 20.0
508
+ # end
500
509
  #
501
510
  # @!attribute [rw] endpoint
502
511
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ServiceManagement
23
23
  module V1
24
- VERSION = "0.3.0"
24
+ VERSION = "0.3.4"
25
25
  end
26
26
  end
27
27
  end
@@ -19,9 +19,10 @@
19
19
 
20
20
  module Google
21
21
  module Api
22
- # `Authentication` defines the authentication configuration for an API.
22
+ # `Authentication` defines the authentication configuration for API methods
23
+ # provided by an API service.
23
24
  #
24
- # Example for an API targeted for external use:
25
+ # Example:
25
26
  #
26
27
  # name: calendar.googleapis.com
27
28
  # authentication:
@@ -33,6 +34,9 @@ module Google
33
34
  # - selector: "*"
34
35
  # requirements:
35
36
  # provider_id: google_calendar_auth
37
+ # - selector: google.calendar.Delegate
38
+ # oauth:
39
+ # canonical_scopes: https://www.googleapis.com/auth/calendar.read
36
40
  # @!attribute [rw] rules
37
41
  # @return [::Array<::Google::Api::AuthenticationRule>]
38
42
  # A list of authentication rules that apply to individual API methods.
@@ -66,6 +70,7 @@ module Google
66
70
  # @!attribute [rw] allow_without_credential
67
71
  # @return [::Boolean]
68
72
  # If true, the service accepts API keys without any other credential.
73
+ # This flag only applies to HTTP and gRPC requests.
69
74
  # @!attribute [rw] requirements
70
75
  # @return [::Array<::Google::Api::AuthRequirement>]
71
76
  # Requirements for additional authentication providers.
@@ -74,8 +79,31 @@ module Google
74
79
  extend ::Google::Protobuf::MessageExts::ClassMethods
75
80
  end
76
81
 
77
- # Configuration for an anthentication provider, including support for
78
- # [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
82
+ # Specifies a location to extract JWT from an API request.
83
+ # @!attribute [rw] header
84
+ # @return [::String]
85
+ # Specifies HTTP header name to extract JWT token.
86
+ # @!attribute [rw] query
87
+ # @return [::String]
88
+ # Specifies URL query parameter name to extract JWT token.
89
+ # @!attribute [rw] value_prefix
90
+ # @return [::String]
91
+ # The value prefix. The value format is "value_prefix\\{token}"
92
+ # Only applies to "in" header type. Must be empty for "in" query type.
93
+ # If not empty, the header value has to match (case sensitive) this prefix.
94
+ # If not matched, JWT will not be extracted. If matched, JWT will be
95
+ # extracted after the prefix is removed.
96
+ #
97
+ # For example, for "Authorization: Bearer \\{JWT}",
98
+ # value_prefix="Bearer " with a space at the end.
99
+ class JwtLocation
100
+ include ::Google::Protobuf::MessageExts
101
+ extend ::Google::Protobuf::MessageExts::ClassMethods
102
+ end
103
+
104
+ # Configuration for an authentication provider, including support for
105
+ # [JSON Web Token
106
+ # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
79
107
  # @!attribute [rw] id
80
108
  # @return [::String]
81
109
  # The unique identifier of the auth provider. It will be referred to by
@@ -93,12 +121,15 @@ module Google
93
121
  # @!attribute [rw] jwks_uri
94
122
  # @return [::String]
95
123
  # URL of the provider's public key set to validate signature of the JWT. See
96
- # [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
124
+ # [OpenID
125
+ # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
97
126
  # Optional if the key set document:
98
127
  # - can be retrieved from
99
- # [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html
128
+ # [OpenID
129
+ # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html)
100
130
  # of the issuer.
101
- # - can be inferred from the email domain of the issuer (e.g. a Google service account).
131
+ # - can be inferred from the email domain of the issuer (e.g. a Google
132
+ # service account).
102
133
  #
103
134
  # Example: https://www.googleapis.com/oauth2/v1/certs
104
135
  # @!attribute [rw] audiences
@@ -106,11 +137,15 @@ module Google
106
137
  # The list of JWT
107
138
  # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
108
139
  # that are allowed to access. A JWT containing any of these audiences will
109
- # be accepted. When this setting is absent, only JWTs with audience
110
- # "https://{::Google::Api::Service#name Service_name}/{::Google::Protobuf::Api#name API_name}"
111
- # will be accepted. For example, if no audiences are in the setting,
112
- # LibraryService API will only accept JWTs with the following audience
113
- # "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
140
+ # be accepted. When this setting is absent, JWTs with audiences:
141
+ # - "https://[service.name]/[google.protobuf.Api.name]"
142
+ # - "https://[service.name]/"
143
+ # will be accepted.
144
+ # For example, if no audiences are in the setting, LibraryService API will
145
+ # accept JWTs with the following audiences:
146
+ # -
147
+ # https://library-example.googleapis.com/google.example.library.v1.LibraryService
148
+ # - https://library-example.googleapis.com/
114
149
  #
115
150
  # Example:
116
151
  #
@@ -118,8 +153,27 @@ module Google
118
153
  # bookstore_web.apps.googleusercontent.com
119
154
  # @!attribute [rw] authorization_url
120
155
  # @return [::String]
121
- # Redirect URL if JWT token is required but no present or is expired.
156
+ # Redirect URL if JWT token is required but not present or is expired.
122
157
  # Implement authorizationUrl of securityDefinitions in OpenAPI spec.
158
+ # @!attribute [rw] jwt_locations
159
+ # @return [::Array<::Google::Api::JwtLocation>]
160
+ # Defines the locations to extract the JWT.
161
+ #
162
+ # JWT locations can be either from HTTP headers or URL query parameters.
163
+ # The rule is that the first match wins. The checking order is: checking
164
+ # all headers first, then URL query parameters.
165
+ #
166
+ # If not specified, default to use following 3 locations:
167
+ # 1) Authorization: Bearer
168
+ # 2) x-goog-iap-jwt-assertion
169
+ # 3) access_token query parameter
170
+ #
171
+ # Default locations can be specified as followings:
172
+ # jwt_locations:
173
+ # - header: Authorization
174
+ # value_prefix: "Bearer "
175
+ # - header: x-goog-iap-jwt-assertion
176
+ # - query: access_token
123
177
  class AuthProvider
124
178
  include ::Google::Protobuf::MessageExts
125
179
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -158,7 +212,8 @@ module Google
158
212
  end
159
213
 
160
214
  # User-defined authentication requirements, including support for
161
- # [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
215
+ # [JSON Web Token
216
+ # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
162
217
  # @!attribute [rw] provider_id
163
218
  # @return [::String]
164
219
  # {::Google::Api::AuthProvider#id id} from authentication provider.
@@ -39,17 +39,133 @@ module Google
39
39
  # @!attribute [rw] address
40
40
  # @return [::String]
41
41
  # The address of the API backend.
42
+ #
43
+ # The scheme is used to determine the backend protocol and security.
44
+ # The following schemes are accepted:
45
+ #
46
+ # SCHEME PROTOCOL SECURITY
47
+ # http:// HTTP None
48
+ # https:// HTTP TLS
49
+ # grpc:// gRPC None
50
+ # grpcs:// gRPC TLS
51
+ #
52
+ # It is recommended to explicitly include a scheme. Leaving out the scheme
53
+ # may cause constrasting behaviors across platforms.
54
+ #
55
+ # If the port is unspecified, the default is:
56
+ # - 80 for schemes without TLS
57
+ # - 443 for schemes with TLS
58
+ #
59
+ # For HTTP backends, use {::Google::Api::BackendRule#protocol protocol}
60
+ # to specify the protocol version.
42
61
  # @!attribute [rw] deadline
43
62
  # @return [::Float]
44
- # The number of seconds to wait for a response from a request. The default
45
- # deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds.
63
+ # The number of seconds to wait for a response from a request. The default
64
+ # varies based on the request protocol and deployment environment.
46
65
  # @!attribute [rw] min_deadline
47
66
  # @return [::Float]
48
67
  # Minimum deadline in seconds needed for this method. Calls having deadline
49
68
  # value lower than this will be rejected.
69
+ # @!attribute [rw] operation_deadline
70
+ # @return [::Float]
71
+ # The number of seconds to wait for the completion of a long running
72
+ # operation. The default is no deadline.
73
+ # @!attribute [rw] path_translation
74
+ # @return [::Google::Api::BackendRule::PathTranslation]
75
+ # @!attribute [rw] jwt_audience
76
+ # @return [::String]
77
+ # The JWT audience is used when generating a JWT ID token for the backend.
78
+ # This ID token will be added in the HTTP "authorization" header, and sent
79
+ # to the backend.
80
+ # @!attribute [rw] disable_auth
81
+ # @return [::Boolean]
82
+ # When disable_auth is true, a JWT ID token won't be generated and the
83
+ # original "Authorization" HTTP header will be preserved. If the header is
84
+ # used to carry the original token and is expected by the backend, this
85
+ # field must be set to true to preserve the header.
86
+ # @!attribute [rw] protocol
87
+ # @return [::String]
88
+ # The protocol used for sending a request to the backend.
89
+ # The supported values are "http/1.1" and "h2".
90
+ #
91
+ # The default value is inferred from the scheme in the
92
+ # {::Google::Api::BackendRule#address address} field:
93
+ #
94
+ # SCHEME PROTOCOL
95
+ # http:// http/1.1
96
+ # https:// http/1.1
97
+ # grpc:// h2
98
+ # grpcs:// h2
99
+ #
100
+ # For secure HTTP backends (https://) that support HTTP/2, set this field
101
+ # to "h2" for improved performance.
102
+ #
103
+ # Configuring this field to non-default values is only supported for secure
104
+ # HTTP backends. This field will be ignored for all other backends.
105
+ #
106
+ # See
107
+ # https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
108
+ # for more details on the supported values.
50
109
  class BackendRule
51
110
  include ::Google::Protobuf::MessageExts
52
111
  extend ::Google::Protobuf::MessageExts::ClassMethods
112
+
113
+ # Path Translation specifies how to combine the backend address with the
114
+ # request path in order to produce the appropriate forwarding URL for the
115
+ # request.
116
+ #
117
+ # Path Translation is applicable only to HTTP-based backends. Backends which
118
+ # do not accept requests over HTTP/HTTPS should leave `path_translation`
119
+ # unspecified.
120
+ module PathTranslation
121
+ PATH_TRANSLATION_UNSPECIFIED = 0
122
+
123
+ # Use the backend address as-is, with no modification to the path. If the
124
+ # URL pattern contains variables, the variable names and values will be
125
+ # appended to the query string. If a query string parameter and a URL
126
+ # pattern variable have the same name, this may result in duplicate keys in
127
+ # the query string.
128
+ #
129
+ # # Examples
130
+ #
131
+ # Given the following operation config:
132
+ #
133
+ # Method path: /api/company/{cid}/user/{uid}
134
+ # Backend address: https://example.cloudfunctions.net/getUser
135
+ #
136
+ # Requests to the following request paths will call the backend at the
137
+ # translated path:
138
+ #
139
+ # Request path: /api/company/widgetworks/user/johndoe
140
+ # Translated:
141
+ # https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe
142
+ #
143
+ # Request path: /api/company/widgetworks/user/johndoe?timezone=EST
144
+ # Translated:
145
+ # https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe
146
+ CONSTANT_ADDRESS = 1
147
+
148
+ # The request path will be appended to the backend address.
149
+ #
150
+ # # Examples
151
+ #
152
+ # Given the following operation config:
153
+ #
154
+ # Method path: /api/company/{cid}/user/{uid}
155
+ # Backend address: https://example.appspot.com
156
+ #
157
+ # Requests to the following request paths will call the backend at the
158
+ # translated path:
159
+ #
160
+ # Request path: /api/company/widgetworks/user/johndoe
161
+ # Translated:
162
+ # https://example.appspot.com/api/company/widgetworks/user/johndoe
163
+ #
164
+ # Request path: /api/company/widgetworks/user/johndoe?timezone=EST
165
+ # Translated:
166
+ # https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
167
+ APPEND_PATH_TO_ADDRESS = 2
168
+ end
53
169
  end
54
170
  end
55
171
  end
@@ -22,22 +22,33 @@ module Google
22
22
  # Billing related configuration of the service.
23
23
  #
24
24
  # The following example shows how to configure monitored resources and metrics
25
- # for billing:
25
+ # for billing, `consumer_destinations` is the only supported destination and
26
+ # the monitored resources need at least one label key
27
+ # `cloud.googleapis.com/location` to indicate the location of the billing
28
+ # usage, using different monitored resources between monitoring and billing is
29
+ # recommended so they can be evolved independently:
30
+ #
26
31
  #
27
32
  # monitored_resources:
28
- # - type: library.googleapis.com/branch
33
+ # - type: library.googleapis.com/billing_branch
29
34
  # labels:
30
- # - key: /city
31
- # description: The city where the library branch is located in.
32
- # - key: /name
33
- # description: The name of the branch.
35
+ # - key: cloud.googleapis.com/location
36
+ # description: |
37
+ # Predefined label to support billing location restriction.
38
+ # - key: city
39
+ # description: |
40
+ # Custom label to define the city where the library branch is located
41
+ # in.
42
+ # - key: name
43
+ # description: Custom label to define the name of the library branch.
34
44
  # metrics:
35
45
  # - name: library.googleapis.com/book/borrowed_count
36
46
  # metric_kind: DELTA
37
47
  # value_type: INT64
48
+ # unit: "1"
38
49
  # billing:
39
50
  # consumer_destinations:
40
- # - monitored_resource: library.googleapis.com/branch
51
+ # - monitored_resource: library.googleapis.com/billing_branch
41
52
  # metrics:
42
53
  # - library.googleapis.com/book/borrowed_count
43
54
  # @!attribute [rw] consumer_destinations
@@ -33,7 +33,7 @@ module Google
33
33
  # 'key' is used. If the field has no unique identifier, the numeric index
34
34
  # is used.
35
35
  # Examples:
36
- # - visibility.rules[selector=="google.LibraryService.CreateBook"].restriction
36
+ # - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction
37
37
  # - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value
38
38
  # - logging.producer_destinations[0]
39
39
  # @!attribute [rw] old_value