1<html><body> 2<style> 3 4body, 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 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, 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="iam_v1.html">Identity and Access Management (IAM) API</a> . <a href="iam_v1.projects.html">projects</a> . <a href="iam_v1.projects.roles.html">roles</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p> 82<p class="firstline">Creates a new custom Role.</p> 83<p class="toc_element"> 84 <code><a href="#delete">delete(name, etag=None, x__xgafv=None)</a></code></p> 85<p class="firstline">Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a principal to the custom role in an IAM Policy. * Existing bindings to the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. You have 7 days to undelete the custom role. After 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is permanently removed.</p> 86<p class="toc_element"> 87 <code><a href="#get">get(name, x__xgafv=None)</a></code></p> 88<p class="firstline">Gets the definition of a Role.</p> 89<p class="toc_element"> 90 <code><a href="#list">list(parent, pageSize=None, pageToken=None, showDeleted=None, view=None, x__xgafv=None)</a></code></p> 91<p class="firstline">Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project.</p> 92<p class="toc_element"> 93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 94<p class="firstline">Retrieves the next page of results.</p> 95<p class="toc_element"> 96 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p> 97<p class="firstline">Updates the definition of a custom Role.</p> 98<p class="toc_element"> 99 <code><a href="#undelete">undelete(name, body=None, x__xgafv=None)</a></code></p> 100<p class="firstline">Undeletes a custom Role.</p> 101<h3>Method Details</h3> 102<div class="method"> 103 <code class="details" id="close">close()</code> 104 <pre>Close httplib2 connections.</pre> 105</div> 106 107<div class="method"> 108 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code> 109 <pre>Creates a new custom Role. 110 111Args: 112 parent: string, The `parent` parameter's value depends on the target resource for the request, namely [`projects`](/iam/reference/rest/v1/projects.roles) or [`organizations`](/iam/reference/rest/v1/organizations.roles). Each resource type's `parent` value format is described below: * [`projects.roles.create()`](/iam/reference/rest/v1/projects.roles/create): `projects/{PROJECT_ID}`. This method creates project-level [custom roles](/iam/docs/understanding-custom-roles). Example request URL: `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` * [`organizations.roles.create()`](/iam/reference/rest/v1/organizations.roles/create): `organizations/{ORGANIZATION_ID}`. This method creates organization-level [custom roles](/iam/docs/understanding-custom-roles). Example request URL: `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID. (required) 113 body: object, The request body. 114 The object takes the form of: 115 116{ # The request to create a new role. 117 "role": { # A role in the Identity and Access Management API. # The Role resource to create. 118 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 119 "description": "A String", # Optional. A human-readable description for the role. 120 "etag": "A String", # Used to perform a consistent read-modify-write. 121 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 122 "A String", 123 ], 124 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 125 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 126 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 127 }, 128 "roleId": "A String", # The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (`_`), and periods (`.`). It must contain a minimum of 3 characters and a maximum of 64 characters. 129} 130 131 x__xgafv: string, V1 error format. 132 Allowed values 133 1 - v1 error format 134 2 - v2 error format 135 136Returns: 137 An object of the form: 138 139 { # A role in the Identity and Access Management API. 140 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 141 "description": "A String", # Optional. A human-readable description for the role. 142 "etag": "A String", # Used to perform a consistent read-modify-write. 143 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 144 "A String", 145 ], 146 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 147 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 148 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 149}</pre> 150</div> 151 152<div class="method"> 153 <code class="details" id="delete">delete(name, etag=None, x__xgafv=None)</code> 154 <pre>Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a principal to the custom role in an IAM Policy. * Existing bindings to the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. You have 7 days to undelete the custom role. After 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is permanently removed. 155 156Args: 157 name: string, The `name` parameter's value depends on the target resource for the request, namely [`projects`](/iam/reference/rest/v1/projects.roles) or [`organizations`](/iam/reference/rest/v1/organizations.roles). Each resource type's `name` value format is described below: * [`projects.roles.delete()`](/iam/reference/rest/v1/projects.roles/delete): `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method deletes only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the project level. Example request URL: `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` * [`organizations.roles.delete()`](/iam/reference/rest/v1/organizations.roles/delete): `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method deletes only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the organization level. Example request URL: `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID. (required) 158 etag: string, Used to perform a consistent read-modify-write. 159 x__xgafv: string, V1 error format. 160 Allowed values 161 1 - v1 error format 162 2 - v2 error format 163 164Returns: 165 An object of the form: 166 167 { # A role in the Identity and Access Management API. 168 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 169 "description": "A String", # Optional. A human-readable description for the role. 170 "etag": "A String", # Used to perform a consistent read-modify-write. 171 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 172 "A String", 173 ], 174 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 175 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 176 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 177}</pre> 178</div> 179 180<div class="method"> 181 <code class="details" id="get">get(name, x__xgafv=None)</code> 182 <pre>Gets the definition of a Role. 183 184Args: 185 name: string, The `name` parameter's value depends on the target resource for the request, namely [`roles`](/iam/reference/rest/v1/roles), [`projects`](/iam/reference/rest/v1/projects.roles), or [`organizations`](/iam/reference/rest/v1/organizations.roles). Each resource type's `name` value format is described below: * [`roles.get()`](/iam/reference/rest/v1/roles/get): `roles/{ROLE_NAME}`. This method returns results from all [predefined roles](/iam/docs/understanding-roles#predefined_roles) in Cloud IAM. Example request URL: `https://iam.googleapis.com/v1/roles/{ROLE_NAME}` * [`projects.roles.get()`](/iam/reference/rest/v1/projects.roles/get): `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the project level. Example request URL: `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` * [`organizations.roles.get()`](/iam/reference/rest/v1/organizations.roles/get): `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the organization level. Example request URL: `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID. (required) 186 x__xgafv: string, V1 error format. 187 Allowed values 188 1 - v1 error format 189 2 - v2 error format 190 191Returns: 192 An object of the form: 193 194 { # A role in the Identity and Access Management API. 195 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 196 "description": "A String", # Optional. A human-readable description for the role. 197 "etag": "A String", # Used to perform a consistent read-modify-write. 198 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 199 "A String", 200 ], 201 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 202 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 203 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 204}</pre> 205</div> 206 207<div class="method"> 208 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, showDeleted=None, view=None, x__xgafv=None)</code> 209 <pre>Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project. 210 211Args: 212 parent: string, The `parent` parameter's value depends on the target resource for the request, namely [`roles`](/iam/reference/rest/v1/roles), [`projects`](/iam/reference/rest/v1/projects.roles), or [`organizations`](/iam/reference/rest/v1/organizations.roles). Each resource type's `parent` value format is described below: * [`roles.list()`](/iam/reference/rest/v1/roles/list): An empty string. This method doesn't require a resource; it simply returns all [predefined roles](/iam/docs/understanding-roles#predefined_roles) in Cloud IAM. Example request URL: `https://iam.googleapis.com/v1/roles` * [`projects.roles.list()`](/iam/reference/rest/v1/projects.roles/list): `projects/{PROJECT_ID}`. This method lists all project-level [custom roles](/iam/docs/understanding-custom-roles). Example request URL: `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` * [`organizations.roles.list()`](/iam/reference/rest/v1/organizations.roles/list): `organizations/{ORGANIZATION_ID}`. This method lists all organization-level [custom roles](/iam/docs/understanding-custom-roles). Example request URL: `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID. (required) 213 pageSize: integer, Optional limit on the number of roles to include in the response. The default is 300, and the maximum is 1,000. 214 pageToken: string, Optional pagination token returned in an earlier ListRolesResponse. 215 showDeleted: boolean, Include Roles that have been deleted. 216 view: string, Optional view for the returned Role objects. When `FULL` is specified, the `includedPermissions` field is returned, which includes a list of all permissions in the role. The default value is `BASIC`, which does not return the `includedPermissions` field. 217 Allowed values 218 BASIC - Omits the `included_permissions` field. This is the default value. 219 FULL - Returns all fields. 220 x__xgafv: string, V1 error format. 221 Allowed values 222 1 - v1 error format 223 2 - v2 error format 224 225Returns: 226 An object of the form: 227 228 { # The response containing the roles defined under a resource. 229 "nextPageToken": "A String", # To retrieve the next page of results, set `ListRolesRequest.page_token` to this value. 230 "roles": [ # The Roles defined on this resource. 231 { # A role in the Identity and Access Management API. 232 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 233 "description": "A String", # Optional. A human-readable description for the role. 234 "etag": "A String", # Used to perform a consistent read-modify-write. 235 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 236 "A String", 237 ], 238 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 239 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 240 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 241 }, 242 ], 243}</pre> 244</div> 245 246<div class="method"> 247 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 248 <pre>Retrieves the next page of results. 249 250Args: 251 previous_request: The request for the previous page. (required) 252 previous_response: The response from the request for the previous page. (required) 253 254Returns: 255 A request object that you can call 'execute()' on to request the next 256 page. Returns None if there are no more items in the collection. 257 </pre> 258</div> 259 260<div class="method"> 261 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code> 262 <pre>Updates the definition of a custom Role. 263 264Args: 265 name: string, The `name` parameter's value depends on the target resource for the request, namely [`projects`](/iam/reference/rest/v1/projects.roles) or [`organizations`](/iam/reference/rest/v1/organizations.roles). Each resource type's `name` value format is described below: * [`projects.roles.patch()`](/iam/reference/rest/v1/projects.roles/patch): `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method updates only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the project level. Example request URL: `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` * [`organizations.roles.patch()`](/iam/reference/rest/v1/organizations.roles/patch): `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method updates only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the organization level. Example request URL: `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID. (required) 266 body: object, The request body. 267 The object takes the form of: 268 269{ # A role in the Identity and Access Management API. 270 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 271 "description": "A String", # Optional. A human-readable description for the role. 272 "etag": "A String", # Used to perform a consistent read-modify-write. 273 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 274 "A String", 275 ], 276 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 277 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 278 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 279} 280 281 updateMask: string, A mask describing which fields in the Role have changed. 282 x__xgafv: string, V1 error format. 283 Allowed values 284 1 - v1 error format 285 2 - v2 error format 286 287Returns: 288 An object of the form: 289 290 { # A role in the Identity and Access Management API. 291 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 292 "description": "A String", # Optional. A human-readable description for the role. 293 "etag": "A String", # Used to perform a consistent read-modify-write. 294 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 295 "A String", 296 ], 297 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 298 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 299 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 300}</pre> 301</div> 302 303<div class="method"> 304 <code class="details" id="undelete">undelete(name, body=None, x__xgafv=None)</code> 305 <pre>Undeletes a custom Role. 306 307Args: 308 name: string, The `name` parameter's value depends on the target resource for the request, namely [`projects`](/iam/reference/rest/v1/projects.roles) or [`organizations`](/iam/reference/rest/v1/organizations.roles). Each resource type's `name` value format is described below: * [`projects.roles.undelete()`](/iam/reference/rest/v1/projects.roles/undelete): `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method undeletes only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the project level. Example request URL: `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` * [`organizations.roles.undelete()`](/iam/reference/rest/v1/organizations.roles/undelete): `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method undeletes only [custom roles](/iam/docs/understanding-custom-roles) that have been created at the organization level. Example request URL: `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID. (required) 309 body: object, The request body. 310 The object takes the form of: 311 312{ # The request to undelete an existing role. 313 "etag": "A String", # Used to perform a consistent read-modify-write. 314} 315 316 x__xgafv: string, V1 error format. 317 Allowed values 318 1 - v1 error format 319 2 - v2 error format 320 321Returns: 322 An object of the form: 323 324 { # A role in the Identity and Access Management API. 325 "deleted": True or False, # The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole. 326 "description": "A String", # Optional. A human-readable description for the role. 327 "etag": "A String", # Used to perform a consistent read-modify-write. 328 "includedPermissions": [ # The names of the permissions this role grants when bound in an IAM policy. 329 "A String", 330 ], 331 "name": "A String", # The name of the role. When Role is used in CreateRole, the role name must not be set. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for predefined roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. 332 "stage": "A String", # The current launch stage of the role. If the `ALPHA` launch stage has been selected for a role, the `stage` field will not be included in the returned definition for the role. 333 "title": "A String", # Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. 334}</pre> 335</div> 336 337</body></html>