Update role Run in API Explorer

PUT /v1/roles/{role_name}

Update a role.

Path parameters

  • role_name string Required

    The role name.

application/json

Body Required

  • add array[object]

    Members to assign to the role.

    RoleMembership is the role membership.

    Hide add attribute Show add attribute object
    • principal string

      The name of the principal assigned to the role.

  • create boolean

    Create the role if it doesn't already exist. If the role is created in this way, the “add” list will be respected, but the “remove” list will be ignored.

  • remove array[object]

    Members to remove from the role.

    RoleMembership is the role membership.

    Hide remove attribute Show remove attribute object
    • principal string

      The name of the principal assigned to the role.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • added array[object]

      Members assigned to the role.

      RoleMembership is the role membership.

      Hide added attribute Show added attribute object
      • principal string

        The name of the principal assigned to the role.

    • removed array[object]

      Members removed from the role.

      RoleMembership is the role membership.

      Hide removed attribute Show removed attribute object
      • principal string

        The name of the principal assigned to the role.

    • role_name string

      The role name.

  • 401 application/json

    Unauthenticated.

    Hide response attributes Show response attributes object
    • code string(int32)

      RPC status code, as described here.

      Values are OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, UNAUTHENTICATED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, or DATA_LOSS.

    • details array[object]

      A list of messages that carries the error details.

      Details of the error.

      Details of the error.

      One of:
    • message string

      Detailed error message. No compatibility guarantees are given for the text contained in this message.

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • code string(int32)

      RPC status code, as described here.

      Values are OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, UNAUTHENTICATED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, or DATA_LOSS.

    • details array[object]

      A list of messages that carries the error details.

      Details of the error.

      Details of the error.

      One of:
    • message string

      Detailed error message. No compatibility guarantees are given for the text contained in this message.

  • 500 application/json

    Internal Server Error. Reach out to support.

    Hide response attributes Show response attributes object
    • code string(int32)

      RPC status code, as described here.

      Values are OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, UNAUTHENTICATED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, or DATA_LOSS.

    • details array[object]

      A list of messages that carries the error details.

      Details of the error.

      Details of the error.

      One of:
    • message string

      Detailed error message. No compatibility guarantees are given for the text contained in this message.

  • default application/json

    An unexpected error response.

    Hide response attributes Show response attributes object
    • code string(int32)

      RPC status code, as described here.

      Values are OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, UNAUTHENTICATED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, or DATA_LOSS.

    • details array[object]

      A list of messages that carries the error details.

      Details of the error.

      Details of the error.

      One of:
    • message string

      Detailed error message. No compatibility guarantees are given for the text contained in this message.

PUT /v1/roles/{role_name}
curl \
 --request PUT 'https://{dataplane_api_subdomain}.cloud.redpanda.com/v1/roles/{role_name}' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"add":[{"principal":"string"}],"create":true,"remove":[{"principal":"string"}]}'
Request examples
{
  "add": [
    {
      "principal": "string"
    }
  ],
  "create": true,
  "remove": [
    {
      "principal": "string"
    }
  ]
}
Response examples (200)
{
  "added": [
    {
      "principal": "string"
    }
  ],
  "removed": [
    {
      "principal": "string"
    }
  ],
  "role_name": "string"
}
Response examples (401)
{
  "code": "OK",
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.BadRequest",
      "field_violations": [
        {
          "description": "string",
          "field": "string",
          "localized_message": {
            "locale": "string",
            "message": "string"
          },
          "reason": "string"
        }
      ]
    }
  ],
  "message": "string"
}
Response examples (404)
{
  "code": "OK",
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.BadRequest",
      "field_violations": [
        {
          "description": "string",
          "field": "string",
          "localized_message": {
            "locale": "string",
            "message": "string"
          },
          "reason": "string"
        }
      ]
    }
  ],
  "message": "string"
}
Response examples (500)
{
  "code": "OK",
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.BadRequest",
      "field_violations": [
        {
          "description": "string",
          "field": "string",
          "localized_message": {
            "locale": "string",
            "message": "string"
          },
          "reason": "string"
        }
      ]
    }
  ],
  "message": "string"
}
Response examples (default)
{
  "code": "OK",
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.BadRequest",
      "field_violations": [
        {
          "description": "string",
          "field": "string",
          "localized_message": {
            "locale": "string",
            "message": "string"
          },
          "reason": "string"
        }
      ]
    }
  ],
  "message": "string"
}