google-cloud-recommender-v1 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +64 -0
- data/lib/google/cloud/recommender/v1.rb +3 -0
- data/lib/google/cloud/recommender/v1/recommender/client.rb +33 -5
- data/lib/google/cloud/recommender/v1/recommender/paths.rb +268 -40
- data/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb +8 -8
- data/lib/google/cloud/recommender/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/cloud/recommender/v1/recommendation.rb +3 -3
- data/proto_docs/google/cloud/recommender/v1/recommender_service.rb +4 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34763615f0d6f665a9d78c676053d43392dc35117fb30e3bb548f46be6e32846
|
4
|
+
data.tar.gz: dd9d60f5be38021c739191c42478f045b4f39f5a4200aaef6912341ed6ed6d96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67397c50831828aa8e16213259a838ff5cf2285212c0739072184c35b4afd8d4773edee822667993741269a8e1d0812e6bbbe651d135e13a6164dbdea6c69dcd
|
7
|
+
data.tar.gz: 46e0e00c2a64939668436f52a17878f8bd68b9b4094f0ae5b04a69e77e515dcce1531d1f5209f66840bccc016d7d60f59c62fcde836d2c0ec9371a8c7792943d
|
data/README.md
CHANGED
@@ -6,6 +6,12 @@ Recommender is a service on Google Cloud that provides usage recommendations for
|
|
6
6
|
|
7
7
|
https://github.com/googleapis/google-cloud-ruby
|
8
8
|
|
9
|
+
This gem is a _versioned_ client. It provides basic client classes for a
|
10
|
+
specific version of the Recommender V1 API. Most users should consider using
|
11
|
+
the main client gem,
|
12
|
+
[google-cloud-recommender](https://rubygems.org/gems/google-cloud-recommender).
|
13
|
+
See the section below titled *Which client should I use?* for more information.
|
14
|
+
|
9
15
|
## Installation
|
10
16
|
|
11
17
|
```
|
@@ -73,3 +79,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
|
|
73
79
|
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
74
80
|
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
75
81
|
about the Ruby support schedule.
|
82
|
+
|
83
|
+
## Which client should I use?
|
84
|
+
|
85
|
+
Most modern Ruby client libraries for Google APIs come in two flavors: the main
|
86
|
+
client library with a name such as `google-cloud-recommender`,
|
87
|
+
and lower-level _versioned_ client libraries with names such as
|
88
|
+
`google-cloud-recommender-v1`.
|
89
|
+
_In most cases, you should install the main client._
|
90
|
+
|
91
|
+
### What's the difference between the main client and a versioned client?
|
92
|
+
|
93
|
+
A _versioned client_ provides a basic set of data types and client classes for
|
94
|
+
a _single version_ of a specific service. (That is, for a service with multiple
|
95
|
+
versions, there might be a separate versioned client for each service version.)
|
96
|
+
Most versioned clients are written and maintained by a code generator.
|
97
|
+
|
98
|
+
The _main client_ is designed to provide you with the _recommended_ client
|
99
|
+
interfaces for the service. There will be only one main client for any given
|
100
|
+
service, even a service with multiple versions. The main client includes
|
101
|
+
factory methods for constructing the client objects we recommend for most
|
102
|
+
users. In some cases, those will be classes provided by an underlying versioned
|
103
|
+
client; in other cases, they will be handwritten higher-level client objects
|
104
|
+
with additional capabilities, convenience methods, or best practices built in.
|
105
|
+
Generally, the main client will default to a recommended service version,
|
106
|
+
although in some cases you can override this if you need to talk to a specific
|
107
|
+
service version.
|
108
|
+
|
109
|
+
### Why would I want to use the main client?
|
110
|
+
|
111
|
+
We recommend that most users install the main client gem for a service. You can
|
112
|
+
identify this gem as the one _without_ a version in its name, e.g.
|
113
|
+
`google-cloud-recommender`.
|
114
|
+
The main client is recommended because it will embody the best practices for
|
115
|
+
accessing the service, and may also provide more convenient interfaces or
|
116
|
+
tighter integration into frameworks and third-party libraries. In addition, the
|
117
|
+
documentation and samples published by Google will generally demonstrate use of
|
118
|
+
the main client.
|
119
|
+
|
120
|
+
### Why would I want to use a versioned client?
|
121
|
+
|
122
|
+
You can use a versioned client if you are content with a possibly lower-level
|
123
|
+
class interface, you explicitly want to avoid features provided by the main
|
124
|
+
client, or you want to access a specific service version not be covered by the
|
125
|
+
main client. You can identify versioned client gems because the service version
|
126
|
+
is part of the name, e.g. `google-cloud-recommender-v1`.
|
127
|
+
|
128
|
+
### What about the google-apis-<name> clients?
|
129
|
+
|
130
|
+
Client library gems with names that begin with `google-apis-` are based on an
|
131
|
+
older code generation technology. They talk to a REST/JSON backend (whereas
|
132
|
+
most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
|
133
|
+
not offer the same performance, features, and ease of use provided by more
|
134
|
+
modern clients.
|
135
|
+
|
136
|
+
The `google-apis-` clients have wide coverage across Google services, so you
|
137
|
+
might need to use one if there is no modern client available for the service.
|
138
|
+
However, if a modern client is available, we generally recommend it over the
|
139
|
+
older `google-apis-` clients.
|
@@ -68,12 +68,30 @@ module Google
|
|
68
68
|
end
|
69
69
|
default_config = Client::Configuration.new parent_config
|
70
70
|
|
71
|
+
default_config.rpcs.list_insights.timeout = 60.0
|
72
|
+
default_config.rpcs.list_insights.retry_policy = {
|
73
|
+
initial_delay: 0.1,
|
74
|
+
max_delay: 60.0,
|
75
|
+
multiplier: 1.3,
|
76
|
+
retry_codes: [4, 14]
|
77
|
+
}
|
78
|
+
|
79
|
+
default_config.rpcs.get_insight.timeout = 60.0
|
80
|
+
default_config.rpcs.get_insight.retry_policy = {
|
81
|
+
initial_delay: 0.1,
|
82
|
+
max_delay: 60.0,
|
83
|
+
multiplier: 1.3,
|
84
|
+
retry_codes: [4, 14]
|
85
|
+
}
|
86
|
+
|
87
|
+
default_config.rpcs.mark_insight_accepted.timeout = 60.0
|
88
|
+
|
71
89
|
default_config.rpcs.list_recommendations.timeout = 60.0
|
72
90
|
default_config.rpcs.list_recommendations.retry_policy = {
|
73
91
|
initial_delay: 0.1,
|
74
92
|
max_delay: 60.0,
|
75
93
|
multiplier: 1.3,
|
76
|
-
retry_codes: [
|
94
|
+
retry_codes: [4, 14]
|
77
95
|
}
|
78
96
|
|
79
97
|
default_config.rpcs.get_recommendation.timeout = 60.0
|
@@ -81,7 +99,7 @@ module Google
|
|
81
99
|
initial_delay: 0.1,
|
82
100
|
max_delay: 60.0,
|
83
101
|
multiplier: 1.3,
|
84
|
-
retry_codes: [
|
102
|
+
retry_codes: [4, 14]
|
85
103
|
}
|
86
104
|
|
87
105
|
default_config.rpcs.mark_recommendation_claimed.timeout = 60.0
|
@@ -151,7 +169,13 @@ module Google
|
|
151
169
|
|
152
170
|
# Create credentials
|
153
171
|
credentials = @config.credentials
|
154
|
-
|
172
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
173
|
+
# but only if the default endpoint does not have a region prefix.
|
174
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
175
|
+
@config.endpoint == Client.configure.endpoint &&
|
176
|
+
!@config.endpoint.split(".").first.include?("-")
|
177
|
+
credentials ||= Credentials.default scope: @config.scope,
|
178
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
155
179
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
156
180
|
credentials = Credentials.new credentials, scope: @config.scope
|
157
181
|
end
|
@@ -197,6 +221,8 @@ module Google
|
|
197
221
|
#
|
198
222
|
# LOCATION here refers to GCP Locations:
|
199
223
|
# https://cloud.google.com/about/locations/
|
224
|
+
# INSIGHT_TYPE_ID refers to supported insight types:
|
225
|
+
# https://cloud.google.com/recommender/docs/insights/insight-types.)
|
200
226
|
# @param page_size [::Integer]
|
201
227
|
# Optional. The maximum number of results to return from this request. Non-positive
|
202
228
|
# values are ignored. If not specified, the server will determine the number
|
@@ -428,6 +454,8 @@ module Google
|
|
428
454
|
#
|
429
455
|
# LOCATION here refers to GCP Locations:
|
430
456
|
# https://cloud.google.com/about/locations/
|
457
|
+
# RECOMMENDER_ID refers to supported recommenders:
|
458
|
+
# https://cloud.google.com/recommender/docs/recommenders.
|
431
459
|
# @param page_size [::Integer]
|
432
460
|
# Optional. The maximum number of results to return from this request. Non-positive
|
433
461
|
# values are ignored. If not specified, the server will determine the number
|
@@ -888,7 +916,7 @@ module Google
|
|
888
916
|
|
889
917
|
config_attr :endpoint, "recommender.googleapis.com", ::String
|
890
918
|
config_attr :credentials, nil do |value|
|
891
|
-
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
919
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
892
920
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
893
921
|
allowed.any? { |klass| klass === value }
|
894
922
|
end
|
@@ -928,7 +956,7 @@ module Google
|
|
928
956
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
929
957
|
# the following configuration fields:
|
930
958
|
#
|
931
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
959
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
932
960
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
933
961
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
934
962
|
# include the following keys:
|
@@ -27,81 +27,309 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Create a fully-qualified Insight resource string.
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# @overload insight_path(project:, location:, insight_type:, insight:)
|
31
|
+
# The resource will be in the following format:
|
31
32
|
#
|
32
|
-
#
|
33
|
+
# `projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
|
33
34
|
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
35
|
+
# @param project [String]
|
36
|
+
# @param location [String]
|
37
|
+
# @param insight_type [String]
|
38
|
+
# @param insight [String]
|
39
|
+
#
|
40
|
+
# @overload insight_path(billing_account:, location:, insight_type:, insight:)
|
41
|
+
# The resource will be in the following format:
|
42
|
+
#
|
43
|
+
# `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
|
44
|
+
#
|
45
|
+
# @param billing_account [String]
|
46
|
+
# @param location [String]
|
47
|
+
# @param insight_type [String]
|
48
|
+
# @param insight [String]
|
49
|
+
#
|
50
|
+
# @overload insight_path(folder:, location:, insight_type:, insight:)
|
51
|
+
# The resource will be in the following format:
|
52
|
+
#
|
53
|
+
# `folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
|
54
|
+
#
|
55
|
+
# @param folder [String]
|
56
|
+
# @param location [String]
|
57
|
+
# @param insight_type [String]
|
58
|
+
# @param insight [String]
|
59
|
+
#
|
60
|
+
# @overload insight_path(organization:, location:, insight_type:, insight:)
|
61
|
+
# The resource will be in the following format:
|
62
|
+
#
|
63
|
+
# `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
|
64
|
+
#
|
65
|
+
# @param organization [String]
|
66
|
+
# @param location [String]
|
67
|
+
# @param insight_type [String]
|
68
|
+
# @param insight [String]
|
38
69
|
#
|
39
70
|
# @return [::String]
|
40
|
-
def insight_path
|
41
|
-
|
42
|
-
|
43
|
-
|
71
|
+
def insight_path **args
|
72
|
+
resources = {
|
73
|
+
"insight:insight_type:location:project" => (proc do |project:, location:, insight_type:, insight:|
|
74
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
75
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
76
|
+
raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
|
77
|
+
|
78
|
+
"projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
|
79
|
+
end),
|
80
|
+
"billing_account:insight:insight_type:location" => (proc do |billing_account:, location:, insight_type:, insight:|
|
81
|
+
raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
|
82
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
83
|
+
raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
|
84
|
+
|
85
|
+
"billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
|
86
|
+
end),
|
87
|
+
"folder:insight:insight_type:location" => (proc do |folder:, location:, insight_type:, insight:|
|
88
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
89
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
90
|
+
raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
|
91
|
+
|
92
|
+
"folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
|
93
|
+
end),
|
94
|
+
"insight:insight_type:location:organization" => (proc do |organization:, location:, insight_type:, insight:|
|
95
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
96
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
97
|
+
raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
|
98
|
+
|
99
|
+
"organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
|
100
|
+
end)
|
101
|
+
}
|
44
102
|
|
45
|
-
"
|
103
|
+
resource = resources[args.keys.sort.join(":")]
|
104
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
105
|
+
resource.call(**args)
|
46
106
|
end
|
47
107
|
|
48
108
|
##
|
49
109
|
# Create a fully-qualified InsightType resource string.
|
50
110
|
#
|
51
|
-
#
|
111
|
+
# @overload insight_type_path(project:, location:, insight_type:)
|
112
|
+
# The resource will be in the following format:
|
52
113
|
#
|
53
|
-
#
|
114
|
+
# `projects/{project}/locations/{location}/insightTypes/{insight_type}`
|
54
115
|
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
116
|
+
# @param project [String]
|
117
|
+
# @param location [String]
|
118
|
+
# @param insight_type [String]
|
119
|
+
#
|
120
|
+
# @overload insight_type_path(billing_account:, location:, insight_type:)
|
121
|
+
# The resource will be in the following format:
|
122
|
+
#
|
123
|
+
# `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}`
|
124
|
+
#
|
125
|
+
# @param billing_account [String]
|
126
|
+
# @param location [String]
|
127
|
+
# @param insight_type [String]
|
128
|
+
#
|
129
|
+
# @overload insight_type_path(folder:, location:, insight_type:)
|
130
|
+
# The resource will be in the following format:
|
131
|
+
#
|
132
|
+
# `folders/{folder}/locations/{location}/insightTypes/{insight_type}`
|
133
|
+
#
|
134
|
+
# @param folder [String]
|
135
|
+
# @param location [String]
|
136
|
+
# @param insight_type [String]
|
137
|
+
#
|
138
|
+
# @overload insight_type_path(organization:, location:, insight_type:)
|
139
|
+
# The resource will be in the following format:
|
140
|
+
#
|
141
|
+
# `organizations/{organization}/locations/{location}/insightTypes/{insight_type}`
|
142
|
+
#
|
143
|
+
# @param organization [String]
|
144
|
+
# @param location [String]
|
145
|
+
# @param insight_type [String]
|
58
146
|
#
|
59
147
|
# @return [::String]
|
60
|
-
def insight_type_path
|
61
|
-
|
62
|
-
|
148
|
+
def insight_type_path **args
|
149
|
+
resources = {
|
150
|
+
"insight_type:location:project" => (proc do |project:, location:, insight_type:|
|
151
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
152
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
153
|
+
|
154
|
+
"projects/#{project}/locations/#{location}/insightTypes/#{insight_type}"
|
155
|
+
end),
|
156
|
+
"billing_account:insight_type:location" => (proc do |billing_account:, location:, insight_type:|
|
157
|
+
raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
|
158
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
159
|
+
|
160
|
+
"billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}"
|
161
|
+
end),
|
162
|
+
"folder:insight_type:location" => (proc do |folder:, location:, insight_type:|
|
163
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
164
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
165
|
+
|
166
|
+
"folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}"
|
167
|
+
end),
|
168
|
+
"insight_type:location:organization" => (proc do |organization:, location:, insight_type:|
|
169
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
170
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
171
|
+
|
172
|
+
"organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}"
|
173
|
+
end)
|
174
|
+
}
|
63
175
|
|
64
|
-
"
|
176
|
+
resource = resources[args.keys.sort.join(":")]
|
177
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
178
|
+
resource.call(**args)
|
65
179
|
end
|
66
180
|
|
67
181
|
##
|
68
182
|
# Create a fully-qualified Recommendation resource string.
|
69
183
|
#
|
70
|
-
#
|
184
|
+
# @overload recommendation_path(project:, location:, recommender:, recommendation:)
|
185
|
+
# The resource will be in the following format:
|
71
186
|
#
|
72
|
-
#
|
187
|
+
# `projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
|
73
188
|
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
189
|
+
# @param project [String]
|
190
|
+
# @param location [String]
|
191
|
+
# @param recommender [String]
|
192
|
+
# @param recommendation [String]
|
193
|
+
#
|
194
|
+
# @overload recommendation_path(billing_account:, location:, recommender:, recommendation:)
|
195
|
+
# The resource will be in the following format:
|
196
|
+
#
|
197
|
+
# `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
|
198
|
+
#
|
199
|
+
# @param billing_account [String]
|
200
|
+
# @param location [String]
|
201
|
+
# @param recommender [String]
|
202
|
+
# @param recommendation [String]
|
203
|
+
#
|
204
|
+
# @overload recommendation_path(folder:, location:, recommender:, recommendation:)
|
205
|
+
# The resource will be in the following format:
|
206
|
+
#
|
207
|
+
# `folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
|
208
|
+
#
|
209
|
+
# @param folder [String]
|
210
|
+
# @param location [String]
|
211
|
+
# @param recommender [String]
|
212
|
+
# @param recommendation [String]
|
213
|
+
#
|
214
|
+
# @overload recommendation_path(organization:, location:, recommender:, recommendation:)
|
215
|
+
# The resource will be in the following format:
|
216
|
+
#
|
217
|
+
# `organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
|
218
|
+
#
|
219
|
+
# @param organization [String]
|
220
|
+
# @param location [String]
|
221
|
+
# @param recommender [String]
|
222
|
+
# @param recommendation [String]
|
78
223
|
#
|
79
224
|
# @return [::String]
|
80
|
-
def recommendation_path
|
81
|
-
|
82
|
-
|
83
|
-
|
225
|
+
def recommendation_path **args
|
226
|
+
resources = {
|
227
|
+
"location:project:recommendation:recommender" => (proc do |project:, location:, recommender:, recommendation:|
|
228
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
229
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
230
|
+
raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
|
231
|
+
|
232
|
+
"projects/#{project}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
|
233
|
+
end),
|
234
|
+
"billing_account:location:recommendation:recommender" => (proc do |billing_account:, location:, recommender:, recommendation:|
|
235
|
+
raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
|
236
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
237
|
+
raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
|
238
|
+
|
239
|
+
"billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
|
240
|
+
end),
|
241
|
+
"folder:location:recommendation:recommender" => (proc do |folder:, location:, recommender:, recommendation:|
|
242
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
243
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
244
|
+
raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
|
245
|
+
|
246
|
+
"folders/#{folder}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
|
247
|
+
end),
|
248
|
+
"location:organization:recommendation:recommender" => (proc do |organization:, location:, recommender:, recommendation:|
|
249
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
250
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
251
|
+
raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
|
252
|
+
|
253
|
+
"organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
|
254
|
+
end)
|
255
|
+
}
|
84
256
|
|
85
|
-
"
|
257
|
+
resource = resources[args.keys.sort.join(":")]
|
258
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
259
|
+
resource.call(**args)
|
86
260
|
end
|
87
261
|
|
88
262
|
##
|
89
263
|
# Create a fully-qualified Recommender resource string.
|
90
264
|
#
|
91
|
-
#
|
265
|
+
# @overload recommender_path(project:, location:, recommender:)
|
266
|
+
# The resource will be in the following format:
|
92
267
|
#
|
93
|
-
#
|
268
|
+
# `projects/{project}/locations/{location}/recommenders/{recommender}`
|
94
269
|
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
270
|
+
# @param project [String]
|
271
|
+
# @param location [String]
|
272
|
+
# @param recommender [String]
|
273
|
+
#
|
274
|
+
# @overload recommender_path(billing_account:, location:, recommender:)
|
275
|
+
# The resource will be in the following format:
|
276
|
+
#
|
277
|
+
# `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}`
|
278
|
+
#
|
279
|
+
# @param billing_account [String]
|
280
|
+
# @param location [String]
|
281
|
+
# @param recommender [String]
|
282
|
+
#
|
283
|
+
# @overload recommender_path(folder:, location:, recommender:)
|
284
|
+
# The resource will be in the following format:
|
285
|
+
#
|
286
|
+
# `folders/{folder}/locations/{location}/recommenders/{recommender}`
|
287
|
+
#
|
288
|
+
# @param folder [String]
|
289
|
+
# @param location [String]
|
290
|
+
# @param recommender [String]
|
291
|
+
#
|
292
|
+
# @overload recommender_path(organization:, location:, recommender:)
|
293
|
+
# The resource will be in the following format:
|
294
|
+
#
|
295
|
+
# `organizations/{organization}/locations/{location}/recommenders/{recommender}`
|
296
|
+
#
|
297
|
+
# @param organization [String]
|
298
|
+
# @param location [String]
|
299
|
+
# @param recommender [String]
|
98
300
|
#
|
99
301
|
# @return [::String]
|
100
|
-
def recommender_path
|
101
|
-
|
102
|
-
|
302
|
+
def recommender_path **args
|
303
|
+
resources = {
|
304
|
+
"location:project:recommender" => (proc do |project:, location:, recommender:|
|
305
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
306
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
307
|
+
|
308
|
+
"projects/#{project}/locations/#{location}/recommenders/#{recommender}"
|
309
|
+
end),
|
310
|
+
"billing_account:location:recommender" => (proc do |billing_account:, location:, recommender:|
|
311
|
+
raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
|
312
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
313
|
+
|
314
|
+
"billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}"
|
315
|
+
end),
|
316
|
+
"folder:location:recommender" => (proc do |folder:, location:, recommender:|
|
317
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
318
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
319
|
+
|
320
|
+
"folders/#{folder}/locations/#{location}/recommenders/#{recommender}"
|
321
|
+
end),
|
322
|
+
"location:organization:recommender" => (proc do |organization:, location:, recommender:|
|
323
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
324
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
325
|
+
|
326
|
+
"organizations/#{organization}/locations/#{location}/recommenders/#{recommender}"
|
327
|
+
end)
|
328
|
+
}
|
103
329
|
|
104
|
-
"
|
330
|
+
resource = resources[args.keys.sort.join(":")]
|
331
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
332
|
+
resource.call(**args)
|
105
333
|
end
|
106
334
|
|
107
335
|
extend self
|
@@ -38,23 +38,23 @@ module Google
|
|
38
38
|
|
39
39
|
# Lists insights for a Cloud project. Requires the recommender.*.list IAM
|
40
40
|
# permission for the specified insight type.
|
41
|
-
rpc :ListInsights, ListInsightsRequest, ListInsightsResponse
|
41
|
+
rpc :ListInsights, ::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Google::Cloud::Recommender::V1::ListInsightsResponse
|
42
42
|
# Gets the requested insight. Requires the recommender.*.get IAM permission
|
43
43
|
# for the specified insight type.
|
44
|
-
rpc :GetInsight, GetInsightRequest, Insight
|
44
|
+
rpc :GetInsight, ::Google::Cloud::Recommender::V1::GetInsightRequest, ::Google::Cloud::Recommender::V1::Insight
|
45
45
|
# Marks the Insight State as Accepted. Users can use this method to
|
46
46
|
# indicate to the Recommender API that they have applied some action based
|
47
47
|
# on the insight. This stops the insight content from being updated.
|
48
48
|
#
|
49
49
|
# MarkInsightAccepted can be applied to insights in ACTIVE state. Requires
|
50
50
|
# the recommender.*.update IAM permission for the specified insight.
|
51
|
-
rpc :MarkInsightAccepted, MarkInsightAcceptedRequest, Insight
|
51
|
+
rpc :MarkInsightAccepted, ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Google::Cloud::Recommender::V1::Insight
|
52
52
|
# Lists recommendations for a Cloud project. Requires the recommender.*.list
|
53
53
|
# IAM permission for the specified recommender.
|
54
|
-
rpc :ListRecommendations, ListRecommendationsRequest, ListRecommendationsResponse
|
54
|
+
rpc :ListRecommendations, ::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Google::Cloud::Recommender::V1::ListRecommendationsResponse
|
55
55
|
# Gets the requested recommendation. Requires the recommender.*.get
|
56
56
|
# IAM permission for the specified recommender.
|
57
|
-
rpc :GetRecommendation, GetRecommendationRequest, Recommendation
|
57
|
+
rpc :GetRecommendation, ::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Google::Cloud::Recommender::V1::Recommendation
|
58
58
|
# Marks the Recommendation State as Claimed. Users can use this method to
|
59
59
|
# indicate to the Recommender API that they are starting to apply the
|
60
60
|
# recommendation themselves. This stops the recommendation content from being
|
@@ -65,7 +65,7 @@ module Google
|
|
65
65
|
#
|
66
66
|
# Requires the recommender.*.update IAM permission for the specified
|
67
67
|
# recommender.
|
68
|
-
rpc :MarkRecommendationClaimed, MarkRecommendationClaimedRequest, Recommendation
|
68
|
+
rpc :MarkRecommendationClaimed, ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Google::Cloud::Recommender::V1::Recommendation
|
69
69
|
# Marks the Recommendation State as Succeeded. Users can use this method to
|
70
70
|
# indicate to the Recommender API that they have applied the recommendation
|
71
71
|
# themselves, and the operation was successful. This stops the recommendation
|
@@ -77,7 +77,7 @@ module Google
|
|
77
77
|
#
|
78
78
|
# Requires the recommender.*.update IAM permission for the specified
|
79
79
|
# recommender.
|
80
|
-
rpc :MarkRecommendationSucceeded, MarkRecommendationSucceededRequest, Recommendation
|
80
|
+
rpc :MarkRecommendationSucceeded, ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Google::Cloud::Recommender::V1::Recommendation
|
81
81
|
# Marks the Recommendation State as Failed. Users can use this method to
|
82
82
|
# indicate to the Recommender API that they have applied the recommendation
|
83
83
|
# themselves, and the operation failed. This stops the recommendation content
|
@@ -89,7 +89,7 @@ module Google
|
|
89
89
|
#
|
90
90
|
# Requires the recommender.*.update IAM permission for the specified
|
91
91
|
# recommender.
|
92
|
-
rpc :MarkRecommendationFailed, MarkRecommendationFailedRequest, Recommendation
|
92
|
+
rpc :MarkRecommendationFailed, ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Google::Cloud::Recommender::V1::Recommendation
|
93
93
|
end
|
94
94
|
|
95
95
|
Stub = Service.rpc_stub_class
|
@@ -54,6 +54,12 @@ module Google
|
|
54
54
|
# This indicates that the field may be set once in a request to create a
|
55
55
|
# resource, but may not be changed thereafter.
|
56
56
|
IMMUTABLE = 5
|
57
|
+
|
58
|
+
# Denotes that a (repeated) field is an unordered list.
|
59
|
+
# This indicates that the service may provide the elements of the list
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
|
+
# provided. Additionally, the list's order may or may not be stable.
|
62
|
+
UNORDERED_LIST = 6
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
@@ -43,12 +43,12 @@ module Google
|
|
43
43
|
#
|
44
44
|
# The ResourceDescriptor Yaml config will look like:
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
46
|
+
# resources:
|
47
|
+
# - type: "pubsub.googleapis.com/Topic"
|
48
|
+
# name_descriptor:
|
49
|
+
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
+
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
+
# parent_name_extractor: "projects/{project}"
|
52
52
|
#
|
53
53
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
54
|
# live under multiple parents.
|
@@ -183,15 +183,24 @@ module Google
|
|
183
183
|
# }
|
184
184
|
# @!attribute [rw] plural
|
185
185
|
# @return [::String]
|
186
|
-
# The plural name used in the resource name, such as
|
187
|
-
# the name of 'projects/\\{project}'
|
188
|
-
#
|
186
|
+
# The plural name used in the resource name and permission names, such as
|
187
|
+
# 'projects' for the resource name of 'projects/\\{project}' and the permission
|
188
|
+
# name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
|
189
|
+
# concept of the `plural` field in k8s CRD spec
|
189
190
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
191
|
+
#
|
192
|
+
# Note: The plural form is required even for singleton resources. See
|
193
|
+
# https://aip.dev/156
|
190
194
|
# @!attribute [rw] singular
|
191
195
|
# @return [::String]
|
192
196
|
# The same concept of the `singular` field in k8s CRD spec
|
193
197
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
194
198
|
# Such as "project" for the `resourcemanager.googleapis.com/Project` type.
|
199
|
+
# @!attribute [rw] style
|
200
|
+
# @return [::Array<::Google::Api::ResourceDescriptor::Style>]
|
201
|
+
# Style flag(s) for this resource.
|
202
|
+
# These indicate that a resource is expected to conform to a given
|
203
|
+
# style. See the specific style flags for additional information.
|
195
204
|
class ResourceDescriptor
|
196
205
|
include ::Google::Protobuf::MessageExts
|
197
206
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -211,6 +220,22 @@ module Google
|
|
211
220
|
# that from being necessary once there are multiple patterns.)
|
212
221
|
FUTURE_MULTI_PATTERN = 2
|
213
222
|
end
|
223
|
+
|
224
|
+
# A flag representing a specific style that a resource claims to conform to.
|
225
|
+
module Style
|
226
|
+
# The unspecified value. Do not use.
|
227
|
+
STYLE_UNSPECIFIED = 0
|
228
|
+
|
229
|
+
# This resource is intended to be "declarative-friendly".
|
230
|
+
#
|
231
|
+
# Declarative-friendly resources must be more strictly consistent, and
|
232
|
+
# setting this to true communicates to tools that this resource should
|
233
|
+
# adhere to declarative-friendly expectations.
|
234
|
+
#
|
235
|
+
# Note: This is used by the API linter (linter.aip.dev) to enable
|
236
|
+
# additional checks.
|
237
|
+
DECLARATIVE_FRIENDLY = 1
|
238
|
+
end
|
214
239
|
end
|
215
240
|
|
216
241
|
# Defines a proto annotation that describes a string field that refers to
|
@@ -226,6 +251,17 @@ module Google
|
|
226
251
|
# type: "pubsub.googleapis.com/Topic"
|
227
252
|
# }];
|
228
253
|
# }
|
254
|
+
#
|
255
|
+
# Occasionally, a field may reference an arbitrary resource. In this case,
|
256
|
+
# APIs use the special value * in their resource reference.
|
257
|
+
#
|
258
|
+
# Example:
|
259
|
+
#
|
260
|
+
# message GetIamPolicyRequest {
|
261
|
+
# string resource = 2 [(google.api.resource_reference) = {
|
262
|
+
# type: "*"
|
263
|
+
# }];
|
264
|
+
# }
|
229
265
|
# @!attribute [rw] child_type
|
230
266
|
# @return [::String]
|
231
267
|
# The resource type of a child collection that the annotated field
|
@@ -234,11 +270,11 @@ module Google
|
|
234
270
|
#
|
235
271
|
# Example:
|
236
272
|
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
273
|
+
# message ListLogEntriesRequest {
|
274
|
+
# string parent = 1 [(google.api.resource_reference) = {
|
275
|
+
# child_type: "logging.googleapis.com/LogEntry"
|
276
|
+
# };
|
277
|
+
# }
|
242
278
|
class ResourceReference
|
243
279
|
include ::Google::Protobuf::MessageExts
|
244
280
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -163,12 +163,12 @@ module Google
|
|
163
163
|
# "/versions/*/targetSize/percent": 20
|
164
164
|
# }
|
165
165
|
# * Example: {
|
166
|
-
# "/bindings/*/role": "roles/
|
166
|
+
# "/bindings/*/role": "roles/owner"
|
167
167
|
# "/bindings/*/condition" : null
|
168
168
|
# }
|
169
169
|
# * Example: {
|
170
|
-
# "/bindings/*/role": "roles/
|
171
|
-
# "/bindings/*/members/*" : ["x@
|
170
|
+
# "/bindings/*/role": "roles/owner"
|
171
|
+
# "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
|
172
172
|
# }
|
173
173
|
# When both path_filters and path_value_matchers are set, an implicit AND
|
174
174
|
# must be performed.
|
@@ -32,6 +32,8 @@ module Google
|
|
32
32
|
#
|
33
33
|
# LOCATION here refers to GCP Locations:
|
34
34
|
# https://cloud.google.com/about/locations/
|
35
|
+
# INSIGHT_TYPE_ID refers to supported insight types:
|
36
|
+
# https://cloud.google.com/recommender/docs/insights/insight-types.)
|
35
37
|
# @!attribute [rw] page_size
|
36
38
|
# @return [::Integer]
|
37
39
|
# Optional. The maximum number of results to return from this request. Non-positive
|
@@ -111,6 +113,8 @@ module Google
|
|
111
113
|
#
|
112
114
|
# LOCATION here refers to GCP Locations:
|
113
115
|
# https://cloud.google.com/about/locations/
|
116
|
+
# RECOMMENDER_ID refers to supported recommenders:
|
117
|
+
# https://cloud.google.com/recommender/docs/recommenders.
|
114
118
|
# @!attribute [rw] page_size
|
115
119
|
# @return [::Integer]
|
116
120
|
# Optional. The maximum number of results to return from this request. Non-positive
|
@@ -70,7 +70,16 @@ module Google
|
|
70
70
|
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
71
71
|
#
|
72
72
|
#
|
73
|
-
# Example 5: Compute Timestamp from
|
73
|
+
# Example 5: Compute Timestamp from Java `Instant.now()`.
|
74
|
+
#
|
75
|
+
# Instant now = Instant.now();
|
76
|
+
#
|
77
|
+
# Timestamp timestamp =
|
78
|
+
# Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
79
|
+
# .setNanos(now.getNano()).build();
|
80
|
+
#
|
81
|
+
#
|
82
|
+
# Example 6: Compute Timestamp from current time in Python.
|
74
83
|
#
|
75
84
|
# timestamp = Timestamp()
|
76
85
|
# timestamp.GetCurrentTime()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-recommender-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -151,7 +151,9 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.9'
|
153
153
|
description: Recommender is a service on Google Cloud that provides usage recommendations
|
154
|
-
for Cloud products and services.
|
154
|
+
for Cloud products and services. Note that google-cloud-recommender-v1 is a version-specific
|
155
|
+
client library. For most uses, we recommend installing the main client library google-cloud-recommender
|
156
|
+
instead. See the readme for more details.
|
155
157
|
email: googleapis-packages@google.com
|
156
158
|
executables: []
|
157
159
|
extensions: []
|
@@ -201,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
203
|
- !ruby/object:Gem::Version
|
202
204
|
version: '0'
|
203
205
|
requirements: []
|
204
|
-
rubygems_version: 3.
|
206
|
+
rubygems_version: 3.2.6
|
205
207
|
signing_key:
|
206
208
|
specification_version: 4
|
207
209
|
summary: API Client library for the Recommender V1 API
|