{"type":"api","title":"Update Role","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/21eb1d117a633ad17a20da730c09f519133958a8/c92e7384-b2f4-3d3b-8e8e-03a9325b07bb","info":{"title":"Crosswork RBAC API - Version 1","description":"Crosswork Role-based Access Control APIs","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"},"version":"1.0.0"},"security":[{"bearerAuth":[]}],"x-parser-conf":{"overview":{"markdownPath":"reference/INFRA/RBAC/rbac-v1-overview.md"}},"openapi":"3.0.1","servers":[{"url":"https://{cw_ip}:30603/crosswork/aaa/v1"}],"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Use a bearer token to authenticate requests. Include the token in the Authorization header with the prefix 'Bearer '.","name":"Authorization","in":"header"}}},"spec":{"tags":["rbac"],"summary":"Update Role","operationId":"UpdateRole","parameters":[{"name":"id","in":"path","description":"Unique ID of the role being updated","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Updated specification of the role. See GET /role request for an example payload.","content":{"application/json":{"schema":{"title":"Role represents a collection of security options, such as access rights to APIs, which are deployed on the system.","type":"object","properties":{"id":{"type":"string","description":"The unique programmatic identifier for the RBAC role."},"org_id":{"type":"string","description":"The unique identifier of the organization to which this role belongs. This allows for multi-tenancy."},"rate":{"type":"number","description":"The maximum number of requests allowed within the 'per' time window for this role.","format":"float"},"per":{"type":"number","description":"The time window (in seconds) over which the 'rate' limit is applied.","format":"float"},"quota_max":{"type":"string","description":"The maximum number of requests allowed within the 'quota_renewal_rate' period. A value of -1 typically indicates unlimited quota.","format":"int64"},"quota_renewal_rate":{"type":"string","description":"The duration (in seconds) after which the 'quota_max' resets.","format":"int64"},"access_rights":{"type":"object","additionalProperties":{"type":"object","properties":{"api_name":{"type":"string","description":"A human-readable name or title for the API (e.g., 'Alarms APIs', 'Users and Roles Management APIs')."},"api_id":{"type":"string","description":"The unique programmatic identifier for the API to which these access rights apply."},"versions":{"type":"array","description":"A list of API versions for which these permissions are valid.","items":{"type":"string"}},"allowed_urls":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"A URL pattern to which the access rule applies."},"methods":{"type":"array","description":"A list of HTTP methods (e.g., 'GET', 'POST', 'PUT', 'DELETE', 'PATCH') that are permitted for the specified URL.","items":{"type":"string"}}},"$$ref":"#/components/schemas/rbacAccessSpec"}}},"$$ref":"#/components/schemas/rbacAccessDefinition"}},"hmac_enabled":{"type":"boolean","description":"A boolean flag indicating whether HMAC (Hash-based Message Authentication Code) is enabled for users with this role, enforcing message integrity and authentication.","format":"boolean"},"active":{"type":"boolean","description":"A boolean flag indicating if the role is currently active and can be assigned to users. 'true' means active, 'false' means inactive.","format":"boolean"},"is_inactive":{"type":"boolean","description":"An alternative boolean flag indicating if the role is currently inactive. This might be redundant with 'active' and should be reviewed for consistency. 'true' means inactive, 'false' means active.","format":"boolean"},"tags":{"type":"array","description":"A list of arbitrary string tags used for categorization, searching, or grouping of roles.","items":{"type":"string"}},"key_expires_in":{"type":"string","description":"The duration (in seconds) after which API keys issued to users with this role will expire. A value of -1 typically indicates no expiration.","format":"int64"},"partitions":{"type":"object","properties":{"quota":{"type":"boolean","description":"Indicates whether quota policies are partitioned or scoped for this role.","format":"boolean"},"rate_limit":{"type":"boolean","description":"Indicates whether rate limiting policies are partitioned or scoped for this role.","format":"boolean"},"acl":{"type":"boolean","description":"Indicates whether Access Control List (ACL) policies are partitioned or scoped for this role.","format":"boolean"}},"description":"Defines how policies related to quotas, rate limits, or ACLs are partitioned or scoped for this role, potentially based on a specific policy ID.","$$ref":"#/components/schemas/rbacPolicyPartitions"},"last_updated":{"type":"string","description":"The timestamp (in ISO 8601 format) indicating when this role definition was last modified."}},"example":{"id":"adminRole","org_id":"1","rate":1000,"per":60,"quota_max":-1,"quota_renewal_rate":60,"access_rights":{"Alarms":{"api_name":"Alarms APIs","api_id":"Alarms","versions":["Default"],"allowed_urls":[{"url":"/.*","methods":["GET","POST","PUT","PATCH","DELETE"]}],"allowance_scope":""},"aaa_cwaaa":{"api_name":"Users and Roles Management APIs","api_id":"aaa_cwaaa","versions":["Default"],"allowed_urls":[{"url":"/.*","methods":["GET","POST","PUT","PATCH","DELETE"]}],"allowance_scope":""}},"hmac_enabled":false,"active":true,"is_inactive":false,"tags":["admin","updated"],"key_expires_in":"3600","partitions":{"enabled":true,"policy_id":"somePolicyId"},"last_updated":"2025-07-01T12:25:21.000Z"},"$$ref":"#/components/schemas/rbacRole"}}},"required":true},"responses":{"204":{"description":"No Content. The request was successful and there is no additional content in the response body.","content":{"application/json":{"schema":{"type":"object","properties":{"rbacEmpty":{"type":"object","properties":{}}},"$$ref":"#/components/schemas/rbacEmpty"}}}},"403":{"description":"Forbidden. The server recognizes the authentication credentials, but the client is not authorized to perform this request.","content":{}}},"x-codegen-request-body-name":"body","__originalOperationId":"UpdateRole","security":[{"bearerAuth":[]}],"method":"put","path":"/role/{id}"}}