Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -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 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 75 | <h1><a href="pubsub_v1.html">Cloud Pub/Sub API</a> . <a href="pubsub_v1.projects.html">projects</a> . <a href="pubsub_v1.projects.topics.html">topics</a></h1> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 78 | <code><a href="pubsub_v1.projects.topics.snapshots.html">snapshots()</a></code> |
| 79 | </p> |
| 80 | <p class="firstline">Returns the snapshots Resource.</p> |
| 81 | |
| 82 | <p class="toc_element"> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 83 | <code><a href="pubsub_v1.projects.topics.subscriptions.html">subscriptions()</a></code> |
| 84 | </p> |
| 85 | <p class="firstline">Returns the subscriptions Resource.</p> |
| 86 | |
| 87 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 88 | <code><a href="#create">create(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 89 | <p class="firstline">Creates the given topic with the given name. See the</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 90 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 91 | <code><a href="#delete">delete(topic, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 92 | <p class="firstline">Deletes the topic with the given name. Returns `NOT_FOUND` if the topic</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 93 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 94 | <code><a href="#get">get(topic, x__xgafv=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 95 | <p class="firstline">Gets the configuration of a topic.</p> |
| 96 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 97 | <code><a href="#getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 98 | <p class="firstline">Gets the access control policy for a resource.</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 99 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 100 | <code><a href="#list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 101 | <p class="firstline">Lists matching topics.</p> |
| 102 | <p class="toc_element"> |
| 103 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 104 | <p class="firstline">Retrieves the next page of results.</p> |
| 105 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 106 | <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 107 | <p class="firstline">Updates an existing topic. Note that certain properties of a</p> |
| 108 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 109 | <code><a href="#publish">publish(topic, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 110 | <p class="firstline">Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 111 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 112 | <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 113 | <p class="firstline">Sets the access control policy on the specified resource. Replaces any</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 114 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 115 | <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 116 | <p class="firstline">Returns permissions that a caller has on the specified resource.</p> |
| 117 | <h3>Method Details</h3> |
| 118 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 119 | <code class="details" id="create">create(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 120 | <pre>Creates the given topic with the given name. See the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 121 | <a href="https://cloud.google.com/pubsub/docs/admin#resource_names"> |
| 122 | resource name rules</a>. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 123 | |
| 124 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 125 | name: string, Required. The name of the topic. It must have the format |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 126 | `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 127 | and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 128 | underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 129 | signs (`%`). It must be between 3 and 255 characters in length, and it |
| 130 | must not start with `"goog"`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 131 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 132 | The object takes the form of: |
| 133 | |
| 134 | { # A topic resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 135 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 136 | # managing labels</a>. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 137 | "a_key": "A String", |
| 138 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 139 | "name": "A String", # Required. The name of the topic. It must have the format |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 140 | # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 141 | # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 142 | # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 143 | # signs (`%`). It must be between 3 and 255 characters in length, and it |
| 144 | # must not start with `"goog"`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 145 | "messageStoragePolicy": { # Policy constraining the set of Google Cloud Platform regions where messages |
| 146 | # published to the topic may be stored. If not present, then no constraints |
| 147 | # are in effect. |
| 148 | "allowedPersistenceRegions": [ # A list of IDs of GCP regions where messages that are published to the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 149 | # may be persisted in storage. Messages published by publishers running in |
| 150 | # non-allowed GCP regions (or running outside of GCP altogether) will be |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 151 | # routed for storage in one of the allowed regions. An empty list means that |
| 152 | # no regions are allowed, and is not a valid configuration. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 153 | "A String", |
| 154 | ], |
| 155 | }, |
| 156 | "kmsKeyName": "A String", # The resource name of the Cloud KMS CryptoKey to be used to protect access |
| 157 | # to messages published on this topic. |
| 158 | # |
| 159 | # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 163 | Allowed values |
| 164 | 1 - v1 error format |
| 165 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 166 | |
| 167 | Returns: |
| 168 | An object of the form: |
| 169 | |
| 170 | { # A topic resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 171 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 172 | # managing labels</a>. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 173 | "a_key": "A String", |
| 174 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 175 | "name": "A String", # Required. The name of the topic. It must have the format |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 176 | # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 177 | # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 178 | # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 179 | # signs (`%`). It must be between 3 and 255 characters in length, and it |
| 180 | # must not start with `"goog"`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 181 | "messageStoragePolicy": { # Policy constraining the set of Google Cloud Platform regions where messages |
| 182 | # published to the topic may be stored. If not present, then no constraints |
| 183 | # are in effect. |
| 184 | "allowedPersistenceRegions": [ # A list of IDs of GCP regions where messages that are published to the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 185 | # may be persisted in storage. Messages published by publishers running in |
| 186 | # non-allowed GCP regions (or running outside of GCP altogether) will be |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 187 | # routed for storage in one of the allowed regions. An empty list means that |
| 188 | # no regions are allowed, and is not a valid configuration. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 189 | "A String", |
| 190 | ], |
| 191 | }, |
| 192 | "kmsKeyName": "A String", # The resource name of the Cloud KMS CryptoKey to be used to protect access |
| 193 | # to messages published on this topic. |
| 194 | # |
| 195 | # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 196 | }</pre> |
| 197 | </div> |
| 198 | |
| 199 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 200 | <code class="details" id="delete">delete(topic, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 201 | <pre>Deletes the topic with the given name. Returns `NOT_FOUND` if the topic |
| 202 | does not exist. After a topic is deleted, a new topic may be created with |
| 203 | the same name; this is an entirely new topic with none of the old |
| 204 | configuration or subscriptions. Existing subscriptions to this topic are |
| 205 | not deleted, but their `topic` field is set to `_deleted-topic_`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 206 | |
| 207 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 208 | topic: string, Required. Name of the topic to delete. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 209 | Format is `projects/{project}/topics/{topic}`. (required) |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 210 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 211 | Allowed values |
| 212 | 1 - v1 error format |
| 213 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 214 | |
| 215 | Returns: |
| 216 | An object of the form: |
| 217 | |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 218 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 219 | # empty messages in your APIs. A typical example is to use it as the request |
| 220 | # or the response type of an API method. For instance: |
| 221 | # |
| 222 | # service Foo { |
| 223 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 224 | # } |
| 225 | # |
| 226 | # The JSON representation for `Empty` is empty JSON object `{}`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 227 | }</pre> |
| 228 | </div> |
| 229 | |
| 230 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 231 | <code class="details" id="get">get(topic, x__xgafv=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 232 | <pre>Gets the configuration of a topic. |
| 233 | |
| 234 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 235 | topic: string, Required. The name of the topic to get. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 236 | Format is `projects/{project}/topics/{topic}`. (required) |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 237 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 238 | Allowed values |
| 239 | 1 - v1 error format |
| 240 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 241 | |
| 242 | Returns: |
| 243 | An object of the form: |
| 244 | |
| 245 | { # A topic resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 246 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 247 | # managing labels</a>. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 248 | "a_key": "A String", |
| 249 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 250 | "name": "A String", # Required. The name of the topic. It must have the format |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 251 | # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 252 | # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 253 | # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 254 | # signs (`%`). It must be between 3 and 255 characters in length, and it |
| 255 | # must not start with `"goog"`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 256 | "messageStoragePolicy": { # Policy constraining the set of Google Cloud Platform regions where messages |
| 257 | # published to the topic may be stored. If not present, then no constraints |
| 258 | # are in effect. |
| 259 | "allowedPersistenceRegions": [ # A list of IDs of GCP regions where messages that are published to the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 260 | # may be persisted in storage. Messages published by publishers running in |
| 261 | # non-allowed GCP regions (or running outside of GCP altogether) will be |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 262 | # routed for storage in one of the allowed regions. An empty list means that |
| 263 | # no regions are allowed, and is not a valid configuration. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 264 | "A String", |
| 265 | ], |
| 266 | }, |
| 267 | "kmsKeyName": "A String", # The resource name of the Cloud KMS CryptoKey to be used to protect access |
| 268 | # to messages published on this topic. |
| 269 | # |
| 270 | # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 271 | }</pre> |
| 272 | </div> |
| 273 | |
| 274 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 275 | <code class="details" id="getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 276 | <pre>Gets the access control policy for a resource. |
| 277 | Returns an empty policy if the resource exists and does not have a policy |
| 278 | set. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 279 | |
| 280 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 281 | resource: string, REQUIRED: The resource for which the policy is being requested. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 282 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 283 | options_requestedPolicyVersion: integer, Optional. The policy format version to be returned. |
| 284 | |
| 285 | Valid values are 0, 1, and 3. Requests specifying an invalid value will be |
| 286 | rejected. |
| 287 | |
| 288 | Requests for policies with any conditional bindings must specify version 3. |
| 289 | Policies without any conditional bindings may specify any valid value or |
| 290 | leave the field unset. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 291 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 292 | Allowed values |
| 293 | 1 - v1 error format |
| 294 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 295 | |
| 296 | Returns: |
| 297 | An object of the form: |
| 298 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 299 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 300 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 301 | # |
| 302 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 303 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 304 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 305 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 306 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 307 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 308 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 309 | # Optionally, a `binding` can specify a `condition`, which is a logical |
| 310 | # expression that allows access to a resource only if the expression evaluates |
| 311 | # to `true`. A condition can add constraints based on attributes of the |
| 312 | # request, the resource, or both. |
| 313 | # |
| 314 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 315 | # |
| 316 | # { |
| 317 | # "bindings": [ |
| 318 | # { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 319 | # "role": "roles/resourcemanager.organizationAdmin", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 320 | # "members": [ |
| 321 | # "user:mike@example.com", |
| 322 | # "group:admins@example.com", |
| 323 | # "domain:google.com", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 324 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 325 | # ] |
| 326 | # }, |
| 327 | # { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 328 | # "role": "roles/resourcemanager.organizationViewer", |
| 329 | # "members": ["user:eve@example.com"], |
| 330 | # "condition": { |
| 331 | # "title": "expirable access", |
| 332 | # "description": "Does not grant access after Sep 2020", |
| 333 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
| 334 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 335 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 336 | # ], |
| 337 | # "etag": "BwWWja0YfJA=", |
| 338 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 339 | # } |
| 340 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 341 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 342 | # |
| 343 | # bindings: |
| 344 | # - members: |
| 345 | # - user:mike@example.com |
| 346 | # - group:admins@example.com |
| 347 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 348 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 349 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 350 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 351 | # - user:eve@example.com |
| 352 | # role: roles/resourcemanager.organizationViewer |
| 353 | # condition: |
| 354 | # title: expirable access |
| 355 | # description: Does not grant access after Sep 2020 |
| 356 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
| 357 | # - etag: BwWWja0YfJA= |
| 358 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 359 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 360 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 361 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
| 362 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
| 363 | # `condition` that determines how and when the `bindings` are applied. Each |
| 364 | # of the `bindings` must contain at least one member. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 365 | { # Associates `members` with a `role`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 366 | "role": "A String", # Role that is assigned to `members`. |
| 367 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 368 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
| 369 | # `members` can have the following values: |
| 370 | # |
| 371 | # * `allUsers`: A special identifier that represents anyone who is |
| 372 | # on the internet; with or without a Google account. |
| 373 | # |
| 374 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 375 | # who is authenticated with a Google account or a service account. |
| 376 | # |
| 377 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 378 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 379 | # |
| 380 | # |
| 381 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 382 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 383 | # |
| 384 | # * `group:{emailid}`: An email address that represents a Google group. |
| 385 | # For example, `admins@example.com`. |
| 386 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 387 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 388 | # identifier) representing a user that has been recently deleted. For |
| 389 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 390 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 391 | # retains the role in the binding. |
| 392 | # |
| 393 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 394 | # unique identifier) representing a service account that has been recently |
| 395 | # deleted. For example, |
| 396 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 397 | # If the service account is undeleted, this value reverts to |
| 398 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 399 | # role in the binding. |
| 400 | # |
| 401 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 402 | # identifier) representing a Google group that has been recently |
| 403 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 404 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 405 | # recovered group retains the role in the binding. |
| 406 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 407 | # |
| 408 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 409 | # users of that domain. For example, `google.com` or `example.com`. |
| 410 | # |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 411 | "A String", |
| 412 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 413 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 414 | # NOTE: An unsatisfied condition will not allow user access via current |
| 415 | # binding. Different bindings, including their conditions, are examined |
| 416 | # independently. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 417 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 418 | # are documented at https://github.com/google/cel-spec. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 419 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 420 | # Example (Comparison): |
| 421 | # |
| 422 | # title: "Summary size limit" |
| 423 | # description: "Determines if a summary is less than 100 chars" |
| 424 | # expression: "document.summary.size() < 100" |
| 425 | # |
| 426 | # Example (Equality): |
| 427 | # |
| 428 | # title: "Requestor is owner" |
| 429 | # description: "Determines if requestor is the document owner" |
| 430 | # expression: "document.owner == request.auth.claims.email" |
| 431 | # |
| 432 | # Example (Logic): |
| 433 | # |
| 434 | # title: "Public documents" |
| 435 | # description: "Determine whether the document should be publicly visible" |
| 436 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 437 | # |
| 438 | # Example (Data Manipulation): |
| 439 | # |
| 440 | # title: "Notification string" |
| 441 | # description: "Create a notification string with a timestamp." |
| 442 | # expression: "'New message received at ' + string(document.create_time)" |
| 443 | # |
| 444 | # The exact variables and functions that may be referenced within an expression |
| 445 | # are determined by the service that evaluates it. See the service |
| 446 | # documentation for additional information. |
| 447 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 448 | # describes the expression, e.g. when hovered over it in a UI. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 449 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 450 | # syntax. |
| 451 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 452 | # reporting, e.g. a file name and a position in the file. |
| 453 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 454 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 455 | # expression. |
| 456 | }, |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 457 | }, |
| 458 | ], |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 459 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 460 | # prevent simultaneous updates of a policy from overwriting each other. |
| 461 | # It is strongly suggested that systems make use of the `etag` in the |
| 462 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 463 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 464 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 465 | # ensure that their change will be applied to the same version of the policy. |
| 466 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 467 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 468 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 469 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 470 | # the conditions in the version `3` policy are lost. |
| 471 | "version": 42, # Specifies the format of the policy. |
| 472 | # |
| 473 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 474 | # are rejected. |
| 475 | # |
| 476 | # Any operation that affects conditional role bindings must specify version |
| 477 | # `3`. This requirement applies to the following operations: |
| 478 | # |
| 479 | # * Getting a policy that includes a conditional role binding |
| 480 | # * Adding a conditional role binding to a policy |
| 481 | # * Changing a conditional role binding in a policy |
| 482 | # * Removing any role binding, with or without a condition, from a policy |
| 483 | # that includes conditions |
| 484 | # |
| 485 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 486 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 487 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 488 | # the conditions in the version `3` policy are lost. |
| 489 | # |
| 490 | # If a policy does not include any conditions, operations on that policy may |
| 491 | # specify any valid version or leave the field unset. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 492 | }</pre> |
| 493 | </div> |
| 494 | |
| 495 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 496 | <code class="details" id="list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 497 | <pre>Lists matching topics. |
| 498 | |
| 499 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 500 | project: string, Required. The name of the project in which to list topics. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 501 | Format is `projects/{project-id}`. (required) |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 502 | pageSize: integer, Maximum number of topics to return. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 503 | pageToken: string, The value returned by the last `ListTopicsResponse`; indicates that this is |
| 504 | a continuation of a prior `ListTopics` call, and that the system should |
| 505 | return the next page of data. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 506 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 507 | Allowed values |
| 508 | 1 - v1 error format |
| 509 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 510 | |
| 511 | Returns: |
| 512 | An object of the form: |
| 513 | |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 514 | { # Response for the `ListTopics` method. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 515 | "nextPageToken": "A String", # If not empty, indicates that there may be more topics that match the |
| 516 | # request; this value should be passed in a new `ListTopicsRequest`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 517 | "topics": [ # The resulting topics. |
| 518 | { # A topic resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 519 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 520 | # managing labels</a>. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 521 | "a_key": "A String", |
| 522 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 523 | "name": "A String", # Required. The name of the topic. It must have the format |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 524 | # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 525 | # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 526 | # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 527 | # signs (`%`). It must be between 3 and 255 characters in length, and it |
| 528 | # must not start with `"goog"`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 529 | "messageStoragePolicy": { # Policy constraining the set of Google Cloud Platform regions where messages |
| 530 | # published to the topic may be stored. If not present, then no constraints |
| 531 | # are in effect. |
| 532 | "allowedPersistenceRegions": [ # A list of IDs of GCP regions where messages that are published to the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 533 | # may be persisted in storage. Messages published by publishers running in |
| 534 | # non-allowed GCP regions (or running outside of GCP altogether) will be |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 535 | # routed for storage in one of the allowed regions. An empty list means that |
| 536 | # no regions are allowed, and is not a valid configuration. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 537 | "A String", |
| 538 | ], |
| 539 | }, |
| 540 | "kmsKeyName": "A String", # The resource name of the Cloud KMS CryptoKey to be used to protect access |
| 541 | # to messages published on this topic. |
| 542 | # |
| 543 | # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 544 | }, |
| 545 | ], |
| 546 | }</pre> |
| 547 | </div> |
| 548 | |
| 549 | <div class="method"> |
| 550 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 551 | <pre>Retrieves the next page of results. |
| 552 | |
| 553 | Args: |
| 554 | previous_request: The request for the previous page. (required) |
| 555 | previous_response: The response from the request for the previous page. (required) |
| 556 | |
| 557 | Returns: |
| 558 | A request object that you can call 'execute()' on to request the next |
| 559 | page. Returns None if there are no more items in the collection. |
| 560 | </pre> |
| 561 | </div> |
| 562 | |
| 563 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 564 | <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 565 | <pre>Updates an existing topic. Note that certain properties of a |
| 566 | topic are not modifiable. |
| 567 | |
| 568 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 569 | name: string, Required. The name of the topic. It must have the format |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 570 | `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 571 | and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 572 | underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 573 | signs (`%`). It must be between 3 and 255 characters in length, and it |
| 574 | must not start with `"goog"`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 575 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 576 | The object takes the form of: |
| 577 | |
| 578 | { # Request for the UpdateTopic method. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 579 | "topic": { # A topic resource. # Required. The updated topic object. |
| 580 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 581 | # managing labels</a>. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 582 | "a_key": "A String", |
| 583 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 584 | "name": "A String", # Required. The name of the topic. It must have the format |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 585 | # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 586 | # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 587 | # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 588 | # signs (`%`). It must be between 3 and 255 characters in length, and it |
| 589 | # must not start with `"goog"`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 590 | "messageStoragePolicy": { # Policy constraining the set of Google Cloud Platform regions where messages |
| 591 | # published to the topic may be stored. If not present, then no constraints |
| 592 | # are in effect. |
| 593 | "allowedPersistenceRegions": [ # A list of IDs of GCP regions where messages that are published to the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 594 | # may be persisted in storage. Messages published by publishers running in |
| 595 | # non-allowed GCP regions (or running outside of GCP altogether) will be |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 596 | # routed for storage in one of the allowed regions. An empty list means that |
| 597 | # no regions are allowed, and is not a valid configuration. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 598 | "A String", |
| 599 | ], |
| 600 | }, |
| 601 | "kmsKeyName": "A String", # The resource name of the Cloud KMS CryptoKey to be used to protect access |
| 602 | # to messages published on this topic. |
| 603 | # |
| 604 | # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
| 605 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 606 | "updateMask": "A String", # Required. Indicates which fields in the provided topic to update. Must be specified |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 607 | # and non-empty. Note that if `update_mask` contains |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 608 | # "message_storage_policy" but the `message_storage_policy` is not set in |
| 609 | # the `topic` provided above, then the updated value is determined by the |
| 610 | # policy configured at the project or organization level. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 611 | } |
| 612 | |
| 613 | x__xgafv: string, V1 error format. |
| 614 | Allowed values |
| 615 | 1 - v1 error format |
| 616 | 2 - v2 error format |
| 617 | |
| 618 | Returns: |
| 619 | An object of the form: |
| 620 | |
| 621 | { # A topic resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 622 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 623 | # managing labels</a>. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 624 | "a_key": "A String", |
| 625 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 626 | "name": "A String", # Required. The name of the topic. It must have the format |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 627 | # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, |
| 628 | # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), |
| 629 | # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent |
| 630 | # signs (`%`). It must be between 3 and 255 characters in length, and it |
| 631 | # must not start with `"goog"`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 632 | "messageStoragePolicy": { # Policy constraining the set of Google Cloud Platform regions where messages |
| 633 | # published to the topic may be stored. If not present, then no constraints |
| 634 | # are in effect. |
| 635 | "allowedPersistenceRegions": [ # A list of IDs of GCP regions where messages that are published to the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 636 | # may be persisted in storage. Messages published by publishers running in |
| 637 | # non-allowed GCP regions (or running outside of GCP altogether) will be |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 638 | # routed for storage in one of the allowed regions. An empty list means that |
| 639 | # no regions are allowed, and is not a valid configuration. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 640 | "A String", |
| 641 | ], |
| 642 | }, |
| 643 | "kmsKeyName": "A String", # The resource name of the Cloud KMS CryptoKey to be used to protect access |
| 644 | # to messages published on this topic. |
| 645 | # |
| 646 | # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
| 647 | }</pre> |
| 648 | </div> |
| 649 | |
| 650 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 651 | <code class="details" id="publish">publish(topic, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 652 | <pre>Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 653 | does not exist. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 654 | |
| 655 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 656 | topic: string, Required. The messages in the request will be published on this topic. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 657 | Format is `projects/{project}/topics/{topic}`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 658 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 659 | The object takes the form of: |
| 660 | |
| 661 | { # Request for the Publish method. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 662 | "messages": [ # Required. The messages to publish. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 663 | { # A message that is published by publishers and consumed by subscribers. The |
| 664 | # message must contain either a non-empty data field or at least one attribute. |
| 665 | # Note that client libraries represent this object differently |
| 666 | # depending on the language. See the corresponding |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 667 | # <a href="https://cloud.google.com/pubsub/docs/reference/libraries">client |
| 668 | # library documentation</a> for more information. See |
| 669 | # <a href="https://cloud.google.com/pubsub/quotas">Quotas and limits</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 670 | # for more information about message limits. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 671 | "attributes": { # Attributes for this message. If this field is empty, the message must |
| 672 | # contain non-empty data. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 673 | "a_key": "A String", |
| 674 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 675 | "data": "A String", # The message data field. If this field is empty, the message must contain |
| 676 | # at least one attribute. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 677 | "publishTime": "A String", # The time at which the message was published, populated by the server when |
| 678 | # it receives the `Publish` call. It must not be populated by the |
| 679 | # publisher in a `Publish` call. |
| 680 | "messageId": "A String", # ID of this message, assigned by the server when the message is published. |
| 681 | # Guaranteed to be unique within the topic. This value may be read by a |
| 682 | # subscriber that receives a `PubsubMessage` via a `Pull` call or a push |
| 683 | # delivery. It must not be populated by the publisher in a `Publish` call. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 684 | }, |
| 685 | ], |
| 686 | } |
| 687 | |
| 688 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 689 | Allowed values |
| 690 | 1 - v1 error format |
| 691 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 692 | |
| 693 | Returns: |
| 694 | An object of the form: |
| 695 | |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 696 | { # Response for the `Publish` method. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 697 | "messageIds": [ # The server-assigned ID of each published message, in the same order as |
| 698 | # the messages in the request. IDs are guaranteed to be unique within |
| 699 | # the topic. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 700 | "A String", |
| 701 | ], |
| 702 | }</pre> |
| 703 | </div> |
| 704 | |
| 705 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 706 | <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 707 | <pre>Sets the access control policy on the specified resource. Replaces any |
| 708 | existing policy. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 709 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 710 | Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED |
| 711 | |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 712 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 713 | resource: string, REQUIRED: The resource for which the policy is being specified. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 714 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 715 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 716 | The object takes the form of: |
| 717 | |
| 718 | { # Request message for `SetIamPolicy` method. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 719 | "policy": { # An Identity and Access Management (IAM) policy, which specifies access # REQUIRED: The complete policy to be applied to the `resource`. The size of |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 720 | # the policy is limited to a few 10s of KB. An empty policy is a |
| 721 | # valid policy but certain Cloud Platform services (such as Projects) |
| 722 | # might reject them. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 723 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 724 | # |
| 725 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 726 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 727 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 728 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 729 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 730 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 731 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 732 | # Optionally, a `binding` can specify a `condition`, which is a logical |
| 733 | # expression that allows access to a resource only if the expression evaluates |
| 734 | # to `true`. A condition can add constraints based on attributes of the |
| 735 | # request, the resource, or both. |
| 736 | # |
| 737 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 738 | # |
| 739 | # { |
| 740 | # "bindings": [ |
| 741 | # { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 742 | # "role": "roles/resourcemanager.organizationAdmin", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 743 | # "members": [ |
| 744 | # "user:mike@example.com", |
| 745 | # "group:admins@example.com", |
| 746 | # "domain:google.com", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 747 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 748 | # ] |
| 749 | # }, |
| 750 | # { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 751 | # "role": "roles/resourcemanager.organizationViewer", |
| 752 | # "members": ["user:eve@example.com"], |
| 753 | # "condition": { |
| 754 | # "title": "expirable access", |
| 755 | # "description": "Does not grant access after Sep 2020", |
| 756 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
| 757 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 758 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 759 | # ], |
| 760 | # "etag": "BwWWja0YfJA=", |
| 761 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 762 | # } |
| 763 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 764 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 765 | # |
| 766 | # bindings: |
| 767 | # - members: |
| 768 | # - user:mike@example.com |
| 769 | # - group:admins@example.com |
| 770 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 771 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 772 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 773 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 774 | # - user:eve@example.com |
| 775 | # role: roles/resourcemanager.organizationViewer |
| 776 | # condition: |
| 777 | # title: expirable access |
| 778 | # description: Does not grant access after Sep 2020 |
| 779 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
| 780 | # - etag: BwWWja0YfJA= |
| 781 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 782 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 783 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 784 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
| 785 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
| 786 | # `condition` that determines how and when the `bindings` are applied. Each |
| 787 | # of the `bindings` must contain at least one member. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 788 | { # Associates `members` with a `role`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 789 | "role": "A String", # Role that is assigned to `members`. |
| 790 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 791 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
| 792 | # `members` can have the following values: |
| 793 | # |
| 794 | # * `allUsers`: A special identifier that represents anyone who is |
| 795 | # on the internet; with or without a Google account. |
| 796 | # |
| 797 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 798 | # who is authenticated with a Google account or a service account. |
| 799 | # |
| 800 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 801 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 802 | # |
| 803 | # |
| 804 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 805 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 806 | # |
| 807 | # * `group:{emailid}`: An email address that represents a Google group. |
| 808 | # For example, `admins@example.com`. |
| 809 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 810 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 811 | # identifier) representing a user that has been recently deleted. For |
| 812 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 813 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 814 | # retains the role in the binding. |
| 815 | # |
| 816 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 817 | # unique identifier) representing a service account that has been recently |
| 818 | # deleted. For example, |
| 819 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 820 | # If the service account is undeleted, this value reverts to |
| 821 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 822 | # role in the binding. |
| 823 | # |
| 824 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 825 | # identifier) representing a Google group that has been recently |
| 826 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 827 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 828 | # recovered group retains the role in the binding. |
| 829 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 830 | # |
| 831 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 832 | # users of that domain. For example, `google.com` or `example.com`. |
| 833 | # |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 834 | "A String", |
| 835 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 836 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 837 | # NOTE: An unsatisfied condition will not allow user access via current |
| 838 | # binding. Different bindings, including their conditions, are examined |
| 839 | # independently. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 840 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 841 | # are documented at https://github.com/google/cel-spec. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 842 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 843 | # Example (Comparison): |
| 844 | # |
| 845 | # title: "Summary size limit" |
| 846 | # description: "Determines if a summary is less than 100 chars" |
| 847 | # expression: "document.summary.size() < 100" |
| 848 | # |
| 849 | # Example (Equality): |
| 850 | # |
| 851 | # title: "Requestor is owner" |
| 852 | # description: "Determines if requestor is the document owner" |
| 853 | # expression: "document.owner == request.auth.claims.email" |
| 854 | # |
| 855 | # Example (Logic): |
| 856 | # |
| 857 | # title: "Public documents" |
| 858 | # description: "Determine whether the document should be publicly visible" |
| 859 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 860 | # |
| 861 | # Example (Data Manipulation): |
| 862 | # |
| 863 | # title: "Notification string" |
| 864 | # description: "Create a notification string with a timestamp." |
| 865 | # expression: "'New message received at ' + string(document.create_time)" |
| 866 | # |
| 867 | # The exact variables and functions that may be referenced within an expression |
| 868 | # are determined by the service that evaluates it. See the service |
| 869 | # documentation for additional information. |
| 870 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 871 | # describes the expression, e.g. when hovered over it in a UI. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 872 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 873 | # syntax. |
| 874 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 875 | # reporting, e.g. a file name and a position in the file. |
| 876 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 877 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 878 | # expression. |
| 879 | }, |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 880 | }, |
| 881 | ], |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 882 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 883 | # prevent simultaneous updates of a policy from overwriting each other. |
| 884 | # It is strongly suggested that systems make use of the `etag` in the |
| 885 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 886 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 887 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 888 | # ensure that their change will be applied to the same version of the policy. |
| 889 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 890 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 891 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 892 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 893 | # the conditions in the version `3` policy are lost. |
| 894 | "version": 42, # Specifies the format of the policy. |
| 895 | # |
| 896 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 897 | # are rejected. |
| 898 | # |
| 899 | # Any operation that affects conditional role bindings must specify version |
| 900 | # `3`. This requirement applies to the following operations: |
| 901 | # |
| 902 | # * Getting a policy that includes a conditional role binding |
| 903 | # * Adding a conditional role binding to a policy |
| 904 | # * Changing a conditional role binding in a policy |
| 905 | # * Removing any role binding, with or without a condition, from a policy |
| 906 | # that includes conditions |
| 907 | # |
| 908 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 909 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 910 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 911 | # the conditions in the version `3` policy are lost. |
| 912 | # |
| 913 | # If a policy does not include any conditions, operations on that policy may |
| 914 | # specify any valid version or leave the field unset. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 915 | }, |
| 916 | } |
| 917 | |
| 918 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 919 | Allowed values |
| 920 | 1 - v1 error format |
| 921 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 922 | |
| 923 | Returns: |
| 924 | An object of the form: |
| 925 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 926 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 927 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 928 | # |
| 929 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 930 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 931 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 932 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 933 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 934 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 935 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 936 | # Optionally, a `binding` can specify a `condition`, which is a logical |
| 937 | # expression that allows access to a resource only if the expression evaluates |
| 938 | # to `true`. A condition can add constraints based on attributes of the |
| 939 | # request, the resource, or both. |
| 940 | # |
| 941 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 942 | # |
| 943 | # { |
| 944 | # "bindings": [ |
| 945 | # { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 946 | # "role": "roles/resourcemanager.organizationAdmin", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 947 | # "members": [ |
| 948 | # "user:mike@example.com", |
| 949 | # "group:admins@example.com", |
| 950 | # "domain:google.com", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 951 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 952 | # ] |
| 953 | # }, |
| 954 | # { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 955 | # "role": "roles/resourcemanager.organizationViewer", |
| 956 | # "members": ["user:eve@example.com"], |
| 957 | # "condition": { |
| 958 | # "title": "expirable access", |
| 959 | # "description": "Does not grant access after Sep 2020", |
| 960 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
| 961 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 962 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 963 | # ], |
| 964 | # "etag": "BwWWja0YfJA=", |
| 965 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 966 | # } |
| 967 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 968 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 969 | # |
| 970 | # bindings: |
| 971 | # - members: |
| 972 | # - user:mike@example.com |
| 973 | # - group:admins@example.com |
| 974 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 975 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 976 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 977 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 978 | # - user:eve@example.com |
| 979 | # role: roles/resourcemanager.organizationViewer |
| 980 | # condition: |
| 981 | # title: expirable access |
| 982 | # description: Does not grant access after Sep 2020 |
| 983 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
| 984 | # - etag: BwWWja0YfJA= |
| 985 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 986 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 987 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 988 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
| 989 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
| 990 | # `condition` that determines how and when the `bindings` are applied. Each |
| 991 | # of the `bindings` must contain at least one member. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 992 | { # Associates `members` with a `role`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 993 | "role": "A String", # Role that is assigned to `members`. |
| 994 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 995 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
| 996 | # `members` can have the following values: |
| 997 | # |
| 998 | # * `allUsers`: A special identifier that represents anyone who is |
| 999 | # on the internet; with or without a Google account. |
| 1000 | # |
| 1001 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 1002 | # who is authenticated with a Google account or a service account. |
| 1003 | # |
| 1004 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1005 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1006 | # |
| 1007 | # |
| 1008 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 1009 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 1010 | # |
| 1011 | # * `group:{emailid}`: An email address that represents a Google group. |
| 1012 | # For example, `admins@example.com`. |
| 1013 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1014 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1015 | # identifier) representing a user that has been recently deleted. For |
| 1016 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 1017 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 1018 | # retains the role in the binding. |
| 1019 | # |
| 1020 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 1021 | # unique identifier) representing a service account that has been recently |
| 1022 | # deleted. For example, |
| 1023 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 1024 | # If the service account is undeleted, this value reverts to |
| 1025 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 1026 | # role in the binding. |
| 1027 | # |
| 1028 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1029 | # identifier) representing a Google group that has been recently |
| 1030 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 1031 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 1032 | # recovered group retains the role in the binding. |
| 1033 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1034 | # |
| 1035 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1036 | # users of that domain. For example, `google.com` or `example.com`. |
| 1037 | # |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1038 | "A String", |
| 1039 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1040 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1041 | # NOTE: An unsatisfied condition will not allow user access via current |
| 1042 | # binding. Different bindings, including their conditions, are examined |
| 1043 | # independently. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1044 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 1045 | # are documented at https://github.com/google/cel-spec. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1046 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1047 | # Example (Comparison): |
| 1048 | # |
| 1049 | # title: "Summary size limit" |
| 1050 | # description: "Determines if a summary is less than 100 chars" |
| 1051 | # expression: "document.summary.size() < 100" |
| 1052 | # |
| 1053 | # Example (Equality): |
| 1054 | # |
| 1055 | # title: "Requestor is owner" |
| 1056 | # description: "Determines if requestor is the document owner" |
| 1057 | # expression: "document.owner == request.auth.claims.email" |
| 1058 | # |
| 1059 | # Example (Logic): |
| 1060 | # |
| 1061 | # title: "Public documents" |
| 1062 | # description: "Determine whether the document should be publicly visible" |
| 1063 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 1064 | # |
| 1065 | # Example (Data Manipulation): |
| 1066 | # |
| 1067 | # title: "Notification string" |
| 1068 | # description: "Create a notification string with a timestamp." |
| 1069 | # expression: "'New message received at ' + string(document.create_time)" |
| 1070 | # |
| 1071 | # The exact variables and functions that may be referenced within an expression |
| 1072 | # are determined by the service that evaluates it. See the service |
| 1073 | # documentation for additional information. |
| 1074 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1075 | # describes the expression, e.g. when hovered over it in a UI. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1076 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 1077 | # syntax. |
| 1078 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 1079 | # reporting, e.g. a file name and a position in the file. |
| 1080 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1081 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 1082 | # expression. |
| 1083 | }, |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1084 | }, |
| 1085 | ], |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1086 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 1087 | # prevent simultaneous updates of a policy from overwriting each other. |
| 1088 | # It is strongly suggested that systems make use of the `etag` in the |
| 1089 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 1090 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 1091 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 1092 | # ensure that their change will be applied to the same version of the policy. |
| 1093 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1094 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1095 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1096 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1097 | # the conditions in the version `3` policy are lost. |
| 1098 | "version": 42, # Specifies the format of the policy. |
| 1099 | # |
| 1100 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 1101 | # are rejected. |
| 1102 | # |
| 1103 | # Any operation that affects conditional role bindings must specify version |
| 1104 | # `3`. This requirement applies to the following operations: |
| 1105 | # |
| 1106 | # * Getting a policy that includes a conditional role binding |
| 1107 | # * Adding a conditional role binding to a policy |
| 1108 | # * Changing a conditional role binding in a policy |
| 1109 | # * Removing any role binding, with or without a condition, from a policy |
| 1110 | # that includes conditions |
| 1111 | # |
| 1112 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1113 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1114 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1115 | # the conditions in the version `3` policy are lost. |
| 1116 | # |
| 1117 | # If a policy does not include any conditions, operations on that policy may |
| 1118 | # specify any valid version or leave the field unset. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1119 | }</pre> |
| 1120 | </div> |
| 1121 | |
| 1122 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1123 | <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1124 | <pre>Returns permissions that a caller has on the specified resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1125 | If the resource does not exist, this will return an empty set of |
| 1126 | permissions, not a NOT_FOUND error. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1127 | |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1128 | Note: This operation is designed to be used for building permission-aware |
| 1129 | UIs and command-line tools, not for authorization checking. This operation |
| 1130 | may "fail open" without warning. |
| 1131 | |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1132 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1133 | resource: string, REQUIRED: The resource for which the policy detail is being requested. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 1134 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 1135 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1136 | The object takes the form of: |
| 1137 | |
| 1138 | { # Request message for `TestIamPermissions` method. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1139 | "permissions": [ # The set of permissions to check for the `resource`. Permissions with |
| 1140 | # wildcards (such as '*' or 'storage.*') are not allowed. For more |
| 1141 | # information see |
| 1142 | # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1143 | "A String", |
| 1144 | ], |
| 1145 | } |
| 1146 | |
| 1147 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1148 | Allowed values |
| 1149 | 1 - v1 error format |
| 1150 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1151 | |
| 1152 | Returns: |
| 1153 | An object of the form: |
| 1154 | |
| 1155 | { # Response message for `TestIamPermissions` method. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1156 | "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is |
| 1157 | # allowed. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1158 | "A String", |
| 1159 | ], |
| 1160 | }</pre> |
| 1161 | </div> |
| 1162 | |
| 1163 | </body></html> |