---
type: api
title: Update role
description: Update a role.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/operation/operation-update-blueprinter-role
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/operation/operation-update-blueprinter-role
products:
  - Elastic Cloud Enterprise
---

# Update role

## Paths

- `PUT` `/platform/infrastructure/blueprinter/roles/{blueprinter_role_id}`

#### Path parameters

- `blueprinter_role_id` (string) — required
  User-specified Blueprinter role ID.

## Description

Update a role.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Query string parameters

- `version` (integer) — optional
  When specified, checks for conflicts against the version stored in the persistent store (returned in 'x-cloud-resource-version' of the GET request)

## Request body

The role update data.

`application/json`

- `id` (string) — required
  The unique id of this role
- `auto_blessed` (boolean) — required
  Whether runners are automatically allowed to be assigned the containers of this role.
- `containers` (object[]) — required
  The containers that are part of this role
  - `name` (string) — required
    Name of the association
  - `container_set_name` (string) — required
    The container set name (id)
  - `kind` (string) — required
    The kind of container set, should be one of 'docker', 'elasticsearch', 'kibana', or 'apm'
  - `options` (object) — required
    Options for a ContainersEntry belonging to a role
    - `enabled` (boolean) — required
      Whether this allocation is active and should be created.
    - `auths` (object[]) — required
      ZooKeeper Auths associated with this allocation
      - `scheme` (string) — required
        Scheme identifier, usually "digest"
      - `auth` (string) — required
        Plain-text auth. For the "digest" scheme
    - `acls` (object[]) — required
      ZooKeeper ACLs associated with this allocation
      - `id` (string) — required
        Identity within the provided scheme.
      - `perms` (integer · format: int32) — required
        Permissions
      - `scheme` (string) — required
        Auth scheme, in Elastic Cloud this is usually "digest"
    - `runners_secret` (string) — optional
      Secret shared between the runners that have containers in this container set allocated.
    - `container_set_secret` (string) — optional
      Secret shared between the containers that are part of this container set.
    - `enabled_by_named_feature_flag` (string) — optional
      A named feature flag to check whether this container is enabled or not
    - `overrides` (object) — optional
      Overrides for the container allocation.
      - `container_config` (object) — optional
        Container config. Roughly corresponds to Docker container config
        - `env` (string[]) — required
          List of environment variables on the form KEY=value
        - `host_config` (object) — optional
           Docker host config
          - `extra_hosts` (string[]) — required
            Ports that are exposed by the container.
          - `network_mode` (string) — optional
             Sets the networking mode for the container.
          - `cpu_period` (integer · format: int32) — optional
            The length of a CPU period in microsecond
          - `restart_policy` (object) — optional
            A policy that is applied when a container unexpectedly exits
            - `name` (string) — required
              Identifier for the policy.
            - `maximum_retry_count` (integer · format: int32) — optional
              Maximum number of times to re-try before giving up
          - `port_bindings` (map string to object) — required
            Map of ports that should be exposed on the host.
          - `binds` (string[]) — required
            Volume bindings for the container.
          - `privileged` (boolean) — required
            List of environment variables on the form KEY=value

## Responses

#### `200`

The role was successfully updated.

`application/json`

- `id` (string)
  The unique id of this role
- `role` (object)
  Persisted role along with metadata
  - `value` (object)
    Describes whether certain runners are blessed to run a Role.
    - `id` (string)
      The unique id of this role
    - `auto_blessed` (boolean)
      Whether runners are automatically allowed to be assigned the containers of this role.
    - `containers` (object[])
      The containers that are part of this role
      Same fields as `containers`
  - `meta` (object)
    Metadata of an entity
    - `created_time` (string · format: date-time)
      Creation time
    - `modified_time` (string · format: date-time)
      Modification time
    - `version` (string)
      Version
- `blessings` (object)
  Persisted Blessings along with metadata
  - `value` (object)
    Describes whether certain runners are blessed to run a Role.
    - `runner_ids_to_blessing` (map string to object)
      A mapping of Runner Ids to whether or not they are blessed to run the associated role
      Map values (object)
      - `value` (boolean)
        Whether something is blessed or not
  - `meta` (object)
    Metadata of an entity
    - `created_time` (string · format: date-time)
      Creation time
    - `modified_time` (string · format: date-time)
      Modification time
    - `version` (string)
      Version
- `pending` (object)
  Persisted pending states for a role along with metadata
  - `value` (object)
    Describes whether certain runners are waiting to be blessed.
    - `runner_ids_to_pending_state` (map string to object)
      A mapping of Runner Ids to whether or not they are waiting to be blessed to run the associated role
      Map values (object)
      - `value` (boolean)
        Whether a runner is pending blessings or not
  - `meta` (object)
    Metadata of an entity
    - `created_time` (string · format: date-time)
      Creation time
    - `modified_time` (string · format: date-time)
      Modification time
    - `version` (string)
      Version
#### `400`

The role is currently running container sets. (code: `roles.in_use`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `404`

The role can't be found. (code: `roles.not_found`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `409`

Your request failed because the specified version does not match the persisted version. (code: `roles.version_conflict`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X PUT "${API_URL}/platform/infrastructure/blueprinter/roles/${BLUEPRINTER_ROLE_ID}" \
  -u "${USERNAME}:${PASSWORD}" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "constructor",
    "auto_blessed": false,
    "containers": [
      {
        "name": "string",
        "container_set_name": "string",
        "kind": "string",
        "options": {
          "enabled": false,
          "auths": [
            {
              "scheme": "digest",
              "auth": "string"
            }
          ],
          "acls": [
            {
              "id": "string",
              "perms": 0,
              "scheme": "string"
            }
          ]
        }
      }
    ]
  }'
```

