google-cloud-recommender-v1 0.4.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Recommender
23
23
  module V1
24
- VERSION = "0.4.3"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
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}"
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 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
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
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
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
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Recommender
23
+ module V1
24
+ # An insight along with the information used to derive the insight. The insight
25
+ # may have associated recomendations as well.
26
+ # @!attribute [rw] name
27
+ # @return [::String]
28
+ # Name of the insight.
29
+ # @!attribute [rw] description
30
+ # @return [::String]
31
+ # Free-form human readable summary in English. The maximum length is 500
32
+ # characters.
33
+ # @!attribute [rw] target_resources
34
+ # @return [::Array<::String>]
35
+ # Fully qualified resource names that this insight is targeting.
36
+ # @!attribute [rw] insight_subtype
37
+ # @return [::String]
38
+ # Insight subtype. Insight content schema will be stable for a given subtype.
39
+ # @!attribute [rw] content
40
+ # @return [::Google::Protobuf::Struct]
41
+ # A struct of custom fields to explain the insight.
42
+ # Example: "grantedPermissionsCount": "1000"
43
+ # @!attribute [rw] last_refresh_time
44
+ # @return [::Google::Protobuf::Timestamp]
45
+ # Timestamp of the latest data used to generate the insight.
46
+ # @!attribute [rw] observation_period
47
+ # @return [::Google::Protobuf::Duration]
48
+ # Observation period that led to the insight. The source data used to
49
+ # generate the insight ends at last_refresh_time and begins at
50
+ # (last_refresh_time - observation_period).
51
+ # @!attribute [rw] state_info
52
+ # @return [::Google::Cloud::Recommender::V1::InsightStateInfo]
53
+ # Information state and metadata.
54
+ # @!attribute [rw] category
55
+ # @return [::Google::Cloud::Recommender::V1::Insight::Category]
56
+ # Category being targeted by the insight.
57
+ # @!attribute [rw] etag
58
+ # @return [::String]
59
+ # Fingerprint of the Insight. Provides optimistic locking when updating
60
+ # states.
61
+ # @!attribute [rw] associated_recommendations
62
+ # @return [::Array<::Google::Cloud::Recommender::V1::Insight::RecommendationReference>]
63
+ # Recommendations derived from this insight.
64
+ class Insight
65
+ include ::Google::Protobuf::MessageExts
66
+ extend ::Google::Protobuf::MessageExts::ClassMethods
67
+
68
+ # Reference to an associated recommendation.
69
+ # @!attribute [rw] recommendation
70
+ # @return [::String]
71
+ # Recommendation resource name, e.g.
72
+ # projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID]
73
+ class RecommendationReference
74
+ include ::Google::Protobuf::MessageExts
75
+ extend ::Google::Protobuf::MessageExts::ClassMethods
76
+ end
77
+
78
+ # Insight category.
79
+ module Category
80
+ # Unspecified category.
81
+ CATEGORY_UNSPECIFIED = 0
82
+
83
+ # The insight is related to cost.
84
+ COST = 1
85
+
86
+ # The insight is related to security.
87
+ SECURITY = 2
88
+
89
+ # The insight is related to performance.
90
+ PERFORMANCE = 3
91
+
92
+ # This insight is related to manageability.
93
+ MANAGEABILITY = 4
94
+ end
95
+ end
96
+
97
+ # Information related to insight state.
98
+ # @!attribute [rw] state
99
+ # @return [::Google::Cloud::Recommender::V1::InsightStateInfo::State]
100
+ # Insight state.
101
+ # @!attribute [rw] state_metadata
102
+ # @return [::Google::Protobuf::Map{::String => ::String}]
103
+ # A map of metadata for the state, provided by user or automations systems.
104
+ class InsightStateInfo
105
+ include ::Google::Protobuf::MessageExts
106
+ extend ::Google::Protobuf::MessageExts::ClassMethods
107
+
108
+ # @!attribute [rw] key
109
+ # @return [::String]
110
+ # @!attribute [rw] value
111
+ # @return [::String]
112
+ class StateMetadataEntry
113
+ include ::Google::Protobuf::MessageExts
114
+ extend ::Google::Protobuf::MessageExts::ClassMethods
115
+ end
116
+
117
+ # Represents insight state.
118
+ module State
119
+ # Unspecified state.
120
+ STATE_UNSPECIFIED = 0
121
+
122
+ # Insight is active. Content for ACTIVE insights can be updated by Google.
123
+ # ACTIVE insights can be marked DISMISSED OR ACCEPTED.
124
+ ACTIVE = 1
125
+
126
+ # Some action has been taken based on this insight. Insights become
127
+ # accepted when a recommendation derived from the insight has been marked
128
+ # CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked
129
+ # ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED
130
+ # insights can only be marked ACCEPTED (which may update state metadata).
131
+ ACCEPTED = 2
132
+
133
+ # Insight is dismissed. Content for DISMISSED insights can be updated by
134
+ # Google. DISMISSED insights can be marked as ACTIVE.
135
+ DISMISSED = 3
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -64,9 +64,22 @@ module Google
64
64
  # @return [::String]
65
65
  # Fingerprint of the Recommendation. Provides optimistic locking when
66
66
  # updating states.
67
+ # @!attribute [rw] associated_insights
68
+ # @return [::Array<::Google::Cloud::Recommender::V1::Recommendation::InsightReference>]
69
+ # Insights that led to this recommendation.
67
70
  class Recommendation
68
71
  include ::Google::Protobuf::MessageExts
69
72
  extend ::Google::Protobuf::MessageExts::ClassMethods
73
+
74
+ # Reference to an associated insight.
75
+ # @!attribute [rw] insight
76
+ # @return [::String]
77
+ # Insight resource name, e.g.
78
+ # projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID]
79
+ class InsightReference
80
+ include ::Google::Protobuf::MessageExts
81
+ extend ::Google::Protobuf::MessageExts::ClassMethods
82
+ end
70
83
  end
71
84
 
72
85
  # Contains what resources are changing and how they are changing.
@@ -150,12 +163,12 @@ module Google
150
163
  # "/versions/*/targetSize/percent": 20
151
164
  # }
152
165
  # * Example: {
153
- # "/bindings/*/role": "roles/admin"
166
+ # "/bindings/*/role": "roles/owner"
154
167
  # "/bindings/*/condition" : null
155
168
  # }
156
169
  # * Example: {
157
- # "/bindings/*/role": "roles/admin"
158
- # "/bindings/*/members/*" : ["x@google.com", "y@google.com"]
170
+ # "/bindings/*/role": "roles/owner"
171
+ # "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
159
172
  # }
160
173
  # When both path_filters and path_value_matchers are set, an implicit AND
161
174
  # must be performed.
@@ -264,7 +277,7 @@ module Google
264
277
  extend ::Google::Protobuf::MessageExts::ClassMethods
265
278
  end
266
279
 
267
- # Represents Recommendation State
280
+ # Represents Recommendation State.
268
281
  module State
269
282
  # Default state. Don't use directly.
270
283
  STATE_UNSPECIFIED = 0
@@ -21,6 +21,87 @@ module Google
21
21
  module Cloud
22
22
  module Recommender
23
23
  module V1
24
+ # Request for the `ListInsights` method.
25
+ # @!attribute [rw] parent
26
+ # @return [::String]
27
+ # Required. The container resource on which to execute the request.
28
+ # Acceptable formats:
29
+ #
30
+ # 1.
31
+ # "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]",
32
+ #
33
+ # LOCATION here refers to GCP Locations:
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.)
37
+ # @!attribute [rw] page_size
38
+ # @return [::Integer]
39
+ # Optional. The maximum number of results to return from this request. Non-positive
40
+ # values are ignored. If not specified, the server will determine the number
41
+ # of results to return.
42
+ # @!attribute [rw] page_token
43
+ # @return [::String]
44
+ # Optional. If present, retrieves the next batch of results from the preceding call to
45
+ # this method. `page_token` must be the value of `next_page_token` from the
46
+ # previous response. The values of other method parameters must be identical
47
+ # to those in the previous call.
48
+ # @!attribute [rw] filter
49
+ # @return [::String]
50
+ # Optional. Filter expression to restrict the insights returned. Supported
51
+ # filter fields: state
52
+ # Eg: `state:"DISMISSED" or state:"ACTIVE"
53
+ class ListInsightsRequest
54
+ include ::Google::Protobuf::MessageExts
55
+ extend ::Google::Protobuf::MessageExts::ClassMethods
56
+ end
57
+
58
+ # Response to the `ListInsights` method.
59
+ # @!attribute [rw] insights
60
+ # @return [::Array<::Google::Cloud::Recommender::V1::Insight>]
61
+ # The set of insights for the `parent` resource.
62
+ # @!attribute [rw] next_page_token
63
+ # @return [::String]
64
+ # A token that can be used to request the next page of results. This field is
65
+ # empty if there are no additional results.
66
+ class ListInsightsResponse
67
+ include ::Google::Protobuf::MessageExts
68
+ extend ::Google::Protobuf::MessageExts::ClassMethods
69
+ end
70
+
71
+ # Request to the `GetInsight` method.
72
+ # @!attribute [rw] name
73
+ # @return [::String]
74
+ # Required. Name of the insight.
75
+ class GetInsightRequest
76
+ include ::Google::Protobuf::MessageExts
77
+ extend ::Google::Protobuf::MessageExts::ClassMethods
78
+ end
79
+
80
+ # Request for the `MarkInsightAccepted` method.
81
+ # @!attribute [rw] name
82
+ # @return [::String]
83
+ # Required. Name of the insight.
84
+ # @!attribute [rw] state_metadata
85
+ # @return [::Google::Protobuf::Map{::String => ::String}]
86
+ # Optional. State properties user wish to include with this state. Full replace of the
87
+ # current state_metadata.
88
+ # @!attribute [rw] etag
89
+ # @return [::String]
90
+ # Required. Fingerprint of the Insight. Provides optimistic locking.
91
+ class MarkInsightAcceptedRequest
92
+ include ::Google::Protobuf::MessageExts
93
+ extend ::Google::Protobuf::MessageExts::ClassMethods
94
+
95
+ # @!attribute [rw] key
96
+ # @return [::String]
97
+ # @!attribute [rw] value
98
+ # @return [::String]
99
+ class StateMetadataEntry
100
+ include ::Google::Protobuf::MessageExts
101
+ extend ::Google::Protobuf::MessageExts::ClassMethods
102
+ end
103
+ end
104
+
24
105
  # Request for the `ListRecommendations` method.
25
106
  # @!attribute [rw] parent
26
107
  # @return [::String]
@@ -32,6 +113,8 @@ module Google
32
113
  #
33
114
  # LOCATION here refers to GCP Locations:
34
115
  # https://cloud.google.com/about/locations/
116
+ # RECOMMENDER_ID refers to supported recommenders:
117
+ # https://cloud.google.com/recommender/docs/recommenders.
35
118
  # @!attribute [rw] page_size
36
119
  # @return [::Integer]
37
120
  # Optional. The maximum number of results to return from this request. Non-positive
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.3
4
+ version: 0.6.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: 2020-06-18 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +163,7 @@ files:
163
163
  - README.md
164
164
  - lib/google-cloud-recommender-v1.rb
165
165
  - lib/google/cloud/recommender/v1.rb
166
+ - lib/google/cloud/recommender/v1/insight_pb.rb
166
167
  - lib/google/cloud/recommender/v1/recommendation_pb.rb
167
168
  - lib/google/cloud/recommender/v1/recommender.rb
168
169
  - lib/google/cloud/recommender/v1/recommender/client.rb
@@ -174,6 +175,7 @@ files:
174
175
  - proto_docs/README.md
175
176
  - proto_docs/google/api/field_behavior.rb
176
177
  - proto_docs/google/api/resource.rb
178
+ - proto_docs/google/cloud/recommender/v1/insight.rb
177
179
  - proto_docs/google/cloud/recommender/v1/recommendation.rb
178
180
  - proto_docs/google/cloud/recommender/v1/recommender_service.rb
179
181
  - proto_docs/google/protobuf/duration.rb
@@ -199,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
201
  - !ruby/object:Gem::Version
200
202
  version: '0'
201
203
  requirements: []
202
- rubygems_version: 3.1.3
204
+ rubygems_version: 3.2.6
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: API Client library for the Recommender V1 API