Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="recommender_v1.html">Recommender API</a> . <a href="recommender_v1.projects.html">projects</a> . <a href="recommender_v1.projects.locations.html">locations</a> . <a href="recommender_v1.projects.locations.recommenders.html">recommenders</a> . <a href="recommender_v1.projects.locations.recommenders.recommendations.html">recommendations</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 78 | <code><a href="#close">close()</a></code></p> |
| 79 | <p class="firstline">Close httplib2 connections.</p> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 80 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 81 | <code><a href="#get">get(name, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#list">list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> |
| 85 | <p class="firstline">Lists recommendations for a Cloud project. Requires the recommender.*.list IAM permission for the specified recommender.</p> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 86 | <p class="toc_element"> |
| 87 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 88 | <p class="firstline">Retrieves the next page of results.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#markClaimed">markClaimed(name, body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 91 | <p class="firstline">Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED, SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.</p> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 92 | <p class="toc_element"> |
| 93 | <code><a href="#markFailed">markFailed(name, body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 94 | <p class="firstline">Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.</p> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 95 | <p class="toc_element"> |
| 96 | <code><a href="#markSucceeded">markSucceeded(name, body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 97 | <p class="firstline">Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.</p> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 100 | <code class="details" id="close">close()</code> |
| 101 | <pre>Close httplib2 connections.</pre> |
| 102 | </div> |
| 103 | |
| 104 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 105 | <code class="details" id="get">get(name, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 106 | <pre>Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 107 | |
| 108 | Args: |
| 109 | name: string, Required. Name of the recommendation. (required) |
| 110 | x__xgafv: string, V1 error format. |
| 111 | Allowed values |
| 112 | 1 - v1 error format |
| 113 | 2 - v2 error format |
| 114 | |
| 115 | Returns: |
| 116 | An object of the form: |
| 117 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 118 | { # A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc |
| 119 | "recommenderSubtype": "A String", # Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to `content` or `primary_impact.category` are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" |
| 120 | "etag": "A String", # Fingerprint of the Recommendation. Provides optimistic locking when updating states. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 121 | "content": { # Contains what resources are changing and how they are changing. # Content of the recommendation describing recommended changes to resources. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 122 | "operationGroups": [ # Operations to one or more Google Cloud resources grouped in such a way that, all operations within one group are expected to be performed atomically and in an order. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 123 | { # Group of operations that need to be performed atomically. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 124 | "operations": [ # List of operations across one or more resources that belong to this group. Loosely based on RFC6902 and should be performed in the order they appear. |
| 125 | { # Contains an operation for a resource loosely based on the JSON-PATCH format with support for: * Custom filters for describing partial array patch. * Extended path values for describing nested arrays. * Custom fields for describing the resource for which the operation is being described. * Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC. |
| 126 | "sourcePath": "A String", # Can be set with action 'copy' or 'move' to indicate the source field within resource or source_resource, ignored if provided for other operation types. |
| 127 | "sourceResource": "A String", # Can be set with action 'copy' to copy resource configuration across different resources of the same type. Example: A resource clone can be done via action = 'copy', path = "/", from = "/", source_resource = and resource_name = . This field is empty for all other values of `action`. |
| 128 | "path": "A String", # Path to the target field being operated on. If the operation is at the resource level, then path should be "/". This field is always populated. |
| 129 | "action": "A String", # Type of this operation. Contains one of 'and', 'remove', 'replace', 'move', 'copy', 'test' and custom operations. This field is case-insensitive and always populated. |
| 130 | "valueMatcher": { # Contains various matching options for values for a GCP resource field. # Can be set for action 'test' for advanced matching for the value of 'path' field. Either this or `value` will be set for 'test' operation. |
| 131 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 132 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 133 | "value": "", # Value for the `path` field. Will be set for actions:'add'/'replace'. Maybe set for action: 'test'. Either this or `value_matcher` will be set for 'test' operation. An exact match must be performed. |
| 134 | "resource": "A String", # Contains the fully qualified resource name. This field is always populated. ex: //cloudresourcemanager.googleapis.com/projects/foo. |
| 135 | "pathFilters": { # Set of filters to apply if `path` refers to array elements or nested array elements in order to narrow down to a single unique element that is being tested/modified. This is intended to be an exact match per filter. To perform advanced matching, use path_value_matchers. * Example: { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/condition" : null } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/members/*" : ["x@google.com", "y@google.com"] } When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 136 | "a_key": "", |
| 137 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 138 | "pathValueMatchers": { # Similar to path_filters, this contains set of filters to apply if `path` field referes to array elements. This is meant to support value matching beyond exact match. To perform exact match, use path_filters. When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
| 139 | "a_key": { # Contains various matching options for values for a GCP resource field. |
| 140 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
| 141 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 142 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 143 | "resourceType": "A String", # Type of GCP resource being modified/tested. This field is always populated. Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 144 | }, |
| 145 | ], |
| 146 | }, |
| 147 | ], |
| 148 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 149 | "lastRefreshTime": "A String", # Last time this recommendation was refreshed by the system that created it in the first place. |
| 150 | "additionalImpact": [ # Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 151 | { # Contains the impact a recommendation can have for a given category. |
| 152 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 153 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 154 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 155 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 156 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 157 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 158 | "duration": "A String", # Duration for which this cost applies. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 159 | }, |
| 160 | "category": "A String", # Category that is being targeted. |
| 161 | }, |
| 162 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 163 | "description": "A String", # Free-form human readable summary in English. The maximum length is 500 characters. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 164 | "stateInfo": { # Information for state. Contains state and metadata. # Information for state. Contains state and metadata. |
| 165 | "stateMetadata": { # A map of metadata for the state, provided by user or automations systems. |
| 166 | "a_key": "A String", |
| 167 | }, |
| 168 | "state": "A String", # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. |
| 169 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 170 | "primaryImpact": { # Contains the impact a recommendation can have for a given category. # The primary impact that this recommendation can have while trying to optimize for one category. |
| 171 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
| 172 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 173 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 174 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| 175 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| 176 | }, |
| 177 | "duration": "A String", # Duration for which this cost applies. |
| 178 | }, |
| 179 | "category": "A String", # Category that is being targeted. |
| 180 | }, |
| 181 | "name": "A String", # Name of recommendation. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 182 | "associatedInsights": [ # Insights that led to this recommendation. |
| 183 | { # Reference to an associated insight. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 184 | "insight": "A String", # Insight resource name, e.g. projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 185 | }, |
| 186 | ], |
| 187 | }</pre> |
| 188 | </div> |
| 189 | |
| 190 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 191 | <code class="details" id="list">list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</code> |
| 192 | <pre>Lists recommendations for a Cloud project. Requires the recommender.*.list IAM permission for the specified recommender. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 193 | |
| 194 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 195 | parent: string, Required. The container resource on which to execute the request. Acceptable formats: 1. "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]", LOCATION here refers to GCP Locations: https://cloud.google.com/about/locations/ RECOMMENDER_ID refers to supported recommenders: https://cloud.google.com/recommender/docs/recommenders. (required) |
| 196 | filter: string, Filter expression to restrict the recommendations returned. Supported filter fields: state_info.state Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED" |
| 197 | pageSize: integer, Optional. The maximum number of results to return from this request. Non-positive values are ignored. If not specified, the server will determine the number of results to return. |
| 198 | pageToken: string, Optional. If present, retrieves the next batch of results from the preceding call to this method. `page_token` must be the value of `next_page_token` from the previous response. The values of other method parameters must be identical to those in the previous call. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 199 | x__xgafv: string, V1 error format. |
| 200 | Allowed values |
| 201 | 1 - v1 error format |
| 202 | 2 - v2 error format |
| 203 | |
| 204 | Returns: |
| 205 | An object of the form: |
| 206 | |
| 207 | { # Response to the `ListRecommendations` method. |
| 208 | "recommendations": [ # The set of recommendations for the `parent` resource. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 209 | { # A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc |
| 210 | "recommenderSubtype": "A String", # Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to `content` or `primary_impact.category` are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" |
| 211 | "etag": "A String", # Fingerprint of the Recommendation. Provides optimistic locking when updating states. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 212 | "content": { # Contains what resources are changing and how they are changing. # Content of the recommendation describing recommended changes to resources. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 213 | "operationGroups": [ # Operations to one or more Google Cloud resources grouped in such a way that, all operations within one group are expected to be performed atomically and in an order. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 214 | { # Group of operations that need to be performed atomically. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 215 | "operations": [ # List of operations across one or more resources that belong to this group. Loosely based on RFC6902 and should be performed in the order they appear. |
| 216 | { # Contains an operation for a resource loosely based on the JSON-PATCH format with support for: * Custom filters for describing partial array patch. * Extended path values for describing nested arrays. * Custom fields for describing the resource for which the operation is being described. * Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC. |
| 217 | "sourcePath": "A String", # Can be set with action 'copy' or 'move' to indicate the source field within resource or source_resource, ignored if provided for other operation types. |
| 218 | "sourceResource": "A String", # Can be set with action 'copy' to copy resource configuration across different resources of the same type. Example: A resource clone can be done via action = 'copy', path = "/", from = "/", source_resource = and resource_name = . This field is empty for all other values of `action`. |
| 219 | "path": "A String", # Path to the target field being operated on. If the operation is at the resource level, then path should be "/". This field is always populated. |
| 220 | "action": "A String", # Type of this operation. Contains one of 'and', 'remove', 'replace', 'move', 'copy', 'test' and custom operations. This field is case-insensitive and always populated. |
| 221 | "valueMatcher": { # Contains various matching options for values for a GCP resource field. # Can be set for action 'test' for advanced matching for the value of 'path' field. Either this or `value` will be set for 'test' operation. |
| 222 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 223 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 224 | "value": "", # Value for the `path` field. Will be set for actions:'add'/'replace'. Maybe set for action: 'test'. Either this or `value_matcher` will be set for 'test' operation. An exact match must be performed. |
| 225 | "resource": "A String", # Contains the fully qualified resource name. This field is always populated. ex: //cloudresourcemanager.googleapis.com/projects/foo. |
| 226 | "pathFilters": { # Set of filters to apply if `path` refers to array elements or nested array elements in order to narrow down to a single unique element that is being tested/modified. This is intended to be an exact match per filter. To perform advanced matching, use path_value_matchers. * Example: { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/condition" : null } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/members/*" : ["x@google.com", "y@google.com"] } When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 227 | "a_key": "", |
| 228 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 229 | "pathValueMatchers": { # Similar to path_filters, this contains set of filters to apply if `path` field referes to array elements. This is meant to support value matching beyond exact match. To perform exact match, use path_filters. When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
| 230 | "a_key": { # Contains various matching options for values for a GCP resource field. |
| 231 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
| 232 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 233 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 234 | "resourceType": "A String", # Type of GCP resource being modified/tested. This field is always populated. Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 235 | }, |
| 236 | ], |
| 237 | }, |
| 238 | ], |
| 239 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 240 | "lastRefreshTime": "A String", # Last time this recommendation was refreshed by the system that created it in the first place. |
| 241 | "additionalImpact": [ # Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 242 | { # Contains the impact a recommendation can have for a given category. |
| 243 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 244 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 245 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 246 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 247 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 248 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 249 | "duration": "A String", # Duration for which this cost applies. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 250 | }, |
| 251 | "category": "A String", # Category that is being targeted. |
| 252 | }, |
| 253 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 254 | "description": "A String", # Free-form human readable summary in English. The maximum length is 500 characters. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 255 | "stateInfo": { # Information for state. Contains state and metadata. # Information for state. Contains state and metadata. |
| 256 | "stateMetadata": { # A map of metadata for the state, provided by user or automations systems. |
| 257 | "a_key": "A String", |
| 258 | }, |
| 259 | "state": "A String", # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. |
| 260 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 261 | "primaryImpact": { # Contains the impact a recommendation can have for a given category. # The primary impact that this recommendation can have while trying to optimize for one category. |
| 262 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
| 263 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 264 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 265 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| 266 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| 267 | }, |
| 268 | "duration": "A String", # Duration for which this cost applies. |
| 269 | }, |
| 270 | "category": "A String", # Category that is being targeted. |
| 271 | }, |
| 272 | "name": "A String", # Name of recommendation. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 273 | "associatedInsights": [ # Insights that led to this recommendation. |
| 274 | { # Reference to an associated insight. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 275 | "insight": "A String", # Insight resource name, e.g. projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 276 | }, |
| 277 | ], |
| 278 | }, |
| 279 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 280 | "nextPageToken": "A String", # A token that can be used to request the next page of results. This field is empty if there are no additional results. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 281 | }</pre> |
| 282 | </div> |
| 283 | |
| 284 | <div class="method"> |
| 285 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 286 | <pre>Retrieves the next page of results. |
| 287 | |
| 288 | Args: |
| 289 | previous_request: The request for the previous page. (required) |
| 290 | previous_response: The response from the request for the previous page. (required) |
| 291 | |
| 292 | Returns: |
| 293 | A request object that you can call 'execute()' on to request the next |
| 294 | page. Returns None if there are no more items in the collection. |
| 295 | </pre> |
| 296 | </div> |
| 297 | |
| 298 | <div class="method"> |
| 299 | <code class="details" id="markClaimed">markClaimed(name, body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 300 | <pre>Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED, SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 301 | |
| 302 | Args: |
| 303 | name: string, Required. Name of the recommendation. (required) |
| 304 | body: object, The request body. |
| 305 | The object takes the form of: |
| 306 | |
| 307 | { # Request for the `MarkRecommendationClaimed` Method. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 308 | "stateMetadata": { # State properties to include with this state. Overwrites any existing `state_metadata`. Keys must match the regex /^a-z0-9{0,62}$/. Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 309 | "a_key": "A String", |
| 310 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 311 | "etag": "A String", # Required. Fingerprint of the Recommendation. Provides optimistic locking. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | x__xgafv: string, V1 error format. |
| 315 | Allowed values |
| 316 | 1 - v1 error format |
| 317 | 2 - v2 error format |
| 318 | |
| 319 | Returns: |
| 320 | An object of the form: |
| 321 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 322 | { # A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc |
| 323 | "recommenderSubtype": "A String", # Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to `content` or `primary_impact.category` are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" |
| 324 | "etag": "A String", # Fingerprint of the Recommendation. Provides optimistic locking when updating states. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 325 | "content": { # Contains what resources are changing and how they are changing. # Content of the recommendation describing recommended changes to resources. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 326 | "operationGroups": [ # Operations to one or more Google Cloud resources grouped in such a way that, all operations within one group are expected to be performed atomically and in an order. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 327 | { # Group of operations that need to be performed atomically. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 328 | "operations": [ # List of operations across one or more resources that belong to this group. Loosely based on RFC6902 and should be performed in the order they appear. |
| 329 | { # Contains an operation for a resource loosely based on the JSON-PATCH format with support for: * Custom filters for describing partial array patch. * Extended path values for describing nested arrays. * Custom fields for describing the resource for which the operation is being described. * Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC. |
| 330 | "sourcePath": "A String", # Can be set with action 'copy' or 'move' to indicate the source field within resource or source_resource, ignored if provided for other operation types. |
| 331 | "sourceResource": "A String", # Can be set with action 'copy' to copy resource configuration across different resources of the same type. Example: A resource clone can be done via action = 'copy', path = "/", from = "/", source_resource = and resource_name = . This field is empty for all other values of `action`. |
| 332 | "path": "A String", # Path to the target field being operated on. If the operation is at the resource level, then path should be "/". This field is always populated. |
| 333 | "action": "A String", # Type of this operation. Contains one of 'and', 'remove', 'replace', 'move', 'copy', 'test' and custom operations. This field is case-insensitive and always populated. |
| 334 | "valueMatcher": { # Contains various matching options for values for a GCP resource field. # Can be set for action 'test' for advanced matching for the value of 'path' field. Either this or `value` will be set for 'test' operation. |
| 335 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 336 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 337 | "value": "", # Value for the `path` field. Will be set for actions:'add'/'replace'. Maybe set for action: 'test'. Either this or `value_matcher` will be set for 'test' operation. An exact match must be performed. |
| 338 | "resource": "A String", # Contains the fully qualified resource name. This field is always populated. ex: //cloudresourcemanager.googleapis.com/projects/foo. |
| 339 | "pathFilters": { # Set of filters to apply if `path` refers to array elements or nested array elements in order to narrow down to a single unique element that is being tested/modified. This is intended to be an exact match per filter. To perform advanced matching, use path_value_matchers. * Example: { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/condition" : null } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/members/*" : ["x@google.com", "y@google.com"] } When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 340 | "a_key": "", |
| 341 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 342 | "pathValueMatchers": { # Similar to path_filters, this contains set of filters to apply if `path` field referes to array elements. This is meant to support value matching beyond exact match. To perform exact match, use path_filters. When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
| 343 | "a_key": { # Contains various matching options for values for a GCP resource field. |
| 344 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
| 345 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 346 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 347 | "resourceType": "A String", # Type of GCP resource being modified/tested. This field is always populated. Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 348 | }, |
| 349 | ], |
| 350 | }, |
| 351 | ], |
| 352 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 353 | "lastRefreshTime": "A String", # Last time this recommendation was refreshed by the system that created it in the first place. |
| 354 | "additionalImpact": [ # Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 355 | { # Contains the impact a recommendation can have for a given category. |
| 356 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 357 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 358 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 359 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 360 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 361 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 362 | "duration": "A String", # Duration for which this cost applies. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 363 | }, |
| 364 | "category": "A String", # Category that is being targeted. |
| 365 | }, |
| 366 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 367 | "description": "A String", # Free-form human readable summary in English. The maximum length is 500 characters. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 368 | "stateInfo": { # Information for state. Contains state and metadata. # Information for state. Contains state and metadata. |
| 369 | "stateMetadata": { # A map of metadata for the state, provided by user or automations systems. |
| 370 | "a_key": "A String", |
| 371 | }, |
| 372 | "state": "A String", # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. |
| 373 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 374 | "primaryImpact": { # Contains the impact a recommendation can have for a given category. # The primary impact that this recommendation can have while trying to optimize for one category. |
| 375 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
| 376 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 377 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 378 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| 379 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| 380 | }, |
| 381 | "duration": "A String", # Duration for which this cost applies. |
| 382 | }, |
| 383 | "category": "A String", # Category that is being targeted. |
| 384 | }, |
| 385 | "name": "A String", # Name of recommendation. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 386 | "associatedInsights": [ # Insights that led to this recommendation. |
| 387 | { # Reference to an associated insight. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 388 | "insight": "A String", # Insight resource name, e.g. projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 389 | }, |
| 390 | ], |
| 391 | }</pre> |
| 392 | </div> |
| 393 | |
| 394 | <div class="method"> |
| 395 | <code class="details" id="markFailed">markFailed(name, body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 396 | <pre>Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 397 | |
| 398 | Args: |
| 399 | name: string, Required. Name of the recommendation. (required) |
| 400 | body: object, The request body. |
| 401 | The object takes the form of: |
| 402 | |
| 403 | { # Request for the `MarkRecommendationFailed` Method. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 404 | "stateMetadata": { # State properties to include with this state. Overwrites any existing `state_metadata`. Keys must match the regex /^a-z0-9{0,62}$/. Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 405 | "a_key": "A String", |
| 406 | }, |
| 407 | "etag": "A String", # Required. Fingerprint of the Recommendation. Provides optimistic locking. |
| 408 | } |
| 409 | |
| 410 | x__xgafv: string, V1 error format. |
| 411 | Allowed values |
| 412 | 1 - v1 error format |
| 413 | 2 - v2 error format |
| 414 | |
| 415 | Returns: |
| 416 | An object of the form: |
| 417 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 418 | { # A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc |
| 419 | "recommenderSubtype": "A String", # Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to `content` or `primary_impact.category` are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" |
| 420 | "etag": "A String", # Fingerprint of the Recommendation. Provides optimistic locking when updating states. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 421 | "content": { # Contains what resources are changing and how they are changing. # Content of the recommendation describing recommended changes to resources. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 422 | "operationGroups": [ # Operations to one or more Google Cloud resources grouped in such a way that, all operations within one group are expected to be performed atomically and in an order. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 423 | { # Group of operations that need to be performed atomically. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 424 | "operations": [ # List of operations across one or more resources that belong to this group. Loosely based on RFC6902 and should be performed in the order they appear. |
| 425 | { # Contains an operation for a resource loosely based on the JSON-PATCH format with support for: * Custom filters for describing partial array patch. * Extended path values for describing nested arrays. * Custom fields for describing the resource for which the operation is being described. * Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC. |
| 426 | "sourcePath": "A String", # Can be set with action 'copy' or 'move' to indicate the source field within resource or source_resource, ignored if provided for other operation types. |
| 427 | "sourceResource": "A String", # Can be set with action 'copy' to copy resource configuration across different resources of the same type. Example: A resource clone can be done via action = 'copy', path = "/", from = "/", source_resource = and resource_name = . This field is empty for all other values of `action`. |
| 428 | "path": "A String", # Path to the target field being operated on. If the operation is at the resource level, then path should be "/". This field is always populated. |
| 429 | "action": "A String", # Type of this operation. Contains one of 'and', 'remove', 'replace', 'move', 'copy', 'test' and custom operations. This field is case-insensitive and always populated. |
| 430 | "valueMatcher": { # Contains various matching options for values for a GCP resource field. # Can be set for action 'test' for advanced matching for the value of 'path' field. Either this or `value` will be set for 'test' operation. |
| 431 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 432 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 433 | "value": "", # Value for the `path` field. Will be set for actions:'add'/'replace'. Maybe set for action: 'test'. Either this or `value_matcher` will be set for 'test' operation. An exact match must be performed. |
| 434 | "resource": "A String", # Contains the fully qualified resource name. This field is always populated. ex: //cloudresourcemanager.googleapis.com/projects/foo. |
| 435 | "pathFilters": { # Set of filters to apply if `path` refers to array elements or nested array elements in order to narrow down to a single unique element that is being tested/modified. This is intended to be an exact match per filter. To perform advanced matching, use path_value_matchers. * Example: { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/condition" : null } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/members/*" : ["x@google.com", "y@google.com"] } When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 436 | "a_key": "", |
| 437 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 438 | "pathValueMatchers": { # Similar to path_filters, this contains set of filters to apply if `path` field referes to array elements. This is meant to support value matching beyond exact match. To perform exact match, use path_filters. When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
| 439 | "a_key": { # Contains various matching options for values for a GCP resource field. |
| 440 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
| 441 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 442 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 443 | "resourceType": "A String", # Type of GCP resource being modified/tested. This field is always populated. Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 444 | }, |
| 445 | ], |
| 446 | }, |
| 447 | ], |
| 448 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 449 | "lastRefreshTime": "A String", # Last time this recommendation was refreshed by the system that created it in the first place. |
| 450 | "additionalImpact": [ # Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 451 | { # Contains the impact a recommendation can have for a given category. |
| 452 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 453 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 454 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 455 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 456 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 457 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 458 | "duration": "A String", # Duration for which this cost applies. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 459 | }, |
| 460 | "category": "A String", # Category that is being targeted. |
| 461 | }, |
| 462 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 463 | "description": "A String", # Free-form human readable summary in English. The maximum length is 500 characters. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 464 | "stateInfo": { # Information for state. Contains state and metadata. # Information for state. Contains state and metadata. |
| 465 | "stateMetadata": { # A map of metadata for the state, provided by user or automations systems. |
| 466 | "a_key": "A String", |
| 467 | }, |
| 468 | "state": "A String", # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. |
| 469 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 470 | "primaryImpact": { # Contains the impact a recommendation can have for a given category. # The primary impact that this recommendation can have while trying to optimize for one category. |
| 471 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
| 472 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 473 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 474 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| 475 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| 476 | }, |
| 477 | "duration": "A String", # Duration for which this cost applies. |
| 478 | }, |
| 479 | "category": "A String", # Category that is being targeted. |
| 480 | }, |
| 481 | "name": "A String", # Name of recommendation. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 482 | "associatedInsights": [ # Insights that led to this recommendation. |
| 483 | { # Reference to an associated insight. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 484 | "insight": "A String", # Insight resource name, e.g. projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 485 | }, |
| 486 | ], |
| 487 | }</pre> |
| 488 | </div> |
| 489 | |
| 490 | <div class="method"> |
| 491 | <code class="details" id="markSucceeded">markSucceeded(name, body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 492 | <pre>Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 493 | |
| 494 | Args: |
| 495 | name: string, Required. Name of the recommendation. (required) |
| 496 | body: object, The request body. |
| 497 | The object takes the form of: |
| 498 | |
| 499 | { # Request for the `MarkRecommendationSucceeded` Method. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 500 | "stateMetadata": { # State properties to include with this state. Overwrites any existing `state_metadata`. Keys must match the regex /^a-z0-9{0,62}$/. Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 501 | "a_key": "A String", |
| 502 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 503 | "etag": "A String", # Required. Fingerprint of the Recommendation. Provides optimistic locking. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | x__xgafv: string, V1 error format. |
| 507 | Allowed values |
| 508 | 1 - v1 error format |
| 509 | 2 - v2 error format |
| 510 | |
| 511 | Returns: |
| 512 | An object of the form: |
| 513 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 514 | { # A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc |
| 515 | "recommenderSubtype": "A String", # Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to `content` or `primary_impact.category` are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" |
| 516 | "etag": "A String", # Fingerprint of the Recommendation. Provides optimistic locking when updating states. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 517 | "content": { # Contains what resources are changing and how they are changing. # Content of the recommendation describing recommended changes to resources. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 518 | "operationGroups": [ # Operations to one or more Google Cloud resources grouped in such a way that, all operations within one group are expected to be performed atomically and in an order. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 519 | { # Group of operations that need to be performed atomically. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 520 | "operations": [ # List of operations across one or more resources that belong to this group. Loosely based on RFC6902 and should be performed in the order they appear. |
| 521 | { # Contains an operation for a resource loosely based on the JSON-PATCH format with support for: * Custom filters for describing partial array patch. * Extended path values for describing nested arrays. * Custom fields for describing the resource for which the operation is being described. * Allows extension to custom operations not natively supported by RFC6902. See https://tools.ietf.org/html/rfc6902 for details on the original RFC. |
| 522 | "sourcePath": "A String", # Can be set with action 'copy' or 'move' to indicate the source field within resource or source_resource, ignored if provided for other operation types. |
| 523 | "sourceResource": "A String", # Can be set with action 'copy' to copy resource configuration across different resources of the same type. Example: A resource clone can be done via action = 'copy', path = "/", from = "/", source_resource = and resource_name = . This field is empty for all other values of `action`. |
| 524 | "path": "A String", # Path to the target field being operated on. If the operation is at the resource level, then path should be "/". This field is always populated. |
| 525 | "action": "A String", # Type of this operation. Contains one of 'and', 'remove', 'replace', 'move', 'copy', 'test' and custom operations. This field is case-insensitive and always populated. |
| 526 | "valueMatcher": { # Contains various matching options for values for a GCP resource field. # Can be set for action 'test' for advanced matching for the value of 'path' field. Either this or `value` will be set for 'test' operation. |
| 527 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 528 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 529 | "value": "", # Value for the `path` field. Will be set for actions:'add'/'replace'. Maybe set for action: 'test'. Either this or `value_matcher` will be set for 'test' operation. An exact match must be performed. |
| 530 | "resource": "A String", # Contains the fully qualified resource name. This field is always populated. ex: //cloudresourcemanager.googleapis.com/projects/foo. |
| 531 | "pathFilters": { # Set of filters to apply if `path` refers to array elements or nested array elements in order to narrow down to a single unique element that is being tested/modified. This is intended to be an exact match per filter. To perform advanced matching, use path_value_matchers. * Example: { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/condition" : null } * Example: { "/bindings/*/role": "roles/admin" "/bindings/*/members/*" : ["x@google.com", "y@google.com"] } When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 532 | "a_key": "", |
| 533 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 534 | "pathValueMatchers": { # Similar to path_filters, this contains set of filters to apply if `path` field referes to array elements. This is meant to support value matching beyond exact match. To perform exact match, use path_filters. When both path_filters and path_value_matchers are set, an implicit AND must be performed. |
| 535 | "a_key": { # Contains various matching options for values for a GCP resource field. |
| 536 | "matchesPattern": "A String", # To be used for full regex matching. The regular expression is using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be used with RE2::FullMatch |
| 537 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 538 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 539 | "resourceType": "A String", # Type of GCP resource being modified/tested. This field is always populated. Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 540 | }, |
| 541 | ], |
| 542 | }, |
| 543 | ], |
| 544 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 545 | "lastRefreshTime": "A String", # Last time this recommendation was refreshed by the system that created it in the first place. |
| 546 | "additionalImpact": [ # Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 547 | { # Contains the impact a recommendation can have for a given category. |
| 548 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 549 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 550 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 551 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 552 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 553 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 554 | "duration": "A String", # Duration for which this cost applies. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 555 | }, |
| 556 | "category": "A String", # Category that is being targeted. |
| 557 | }, |
| 558 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 559 | "description": "A String", # Free-form human readable summary in English. The maximum length is 500 characters. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 560 | "stateInfo": { # Information for state. Contains state and metadata. # Information for state. Contains state and metadata. |
| 561 | "stateMetadata": { # A map of metadata for the state, provided by user or automations systems. |
| 562 | "a_key": "A String", |
| 563 | }, |
| 564 | "state": "A String", # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. |
| 565 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 566 | "primaryImpact": { # Contains the impact a recommendation can have for a given category. # The primary impact that this recommendation can have while trying to optimize for one category. |
| 567 | "costProjection": { # Contains metadata about how much money a recommendation can save or incur. # Use with CategoryType.COST |
| 568 | "cost": { # Represents an amount of money with its currency type. # An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. |
| 569 | "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 570 | "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| 571 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| 572 | }, |
| 573 | "duration": "A String", # Duration for which this cost applies. |
| 574 | }, |
| 575 | "category": "A String", # Category that is being targeted. |
| 576 | }, |
| 577 | "name": "A String", # Name of recommendation. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 578 | "associatedInsights": [ # Insights that led to this recommendation. |
| 579 | { # Reference to an associated insight. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame^] | 580 | "insight": "A String", # Insight resource name, e.g. projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 581 | }, |
| 582 | ], |
| 583 | }</pre> |
| 584 | </div> |
| 585 | |
| 586 | </body></html> |