POST Roles

POST Roles

Creates a new role.

Request
URI
POST
https://{api_host}/api/v2/roles
COPY
Request Body
roles.post.request of type(s) application/json
Optional
{
    "name": "User",
    "description": "Can use Interactive Analytics and Dashboards",
    "capabilities": [
        "VIEW_SHARED_DASHBOARDS",
        "VIEW_INTERACTIVE_ANALYTICS",
        "VIEW_CONTENT_PACKS",
        "VIEW_SHARED_DASHBOARD_URLS",
        "VIEW_CONTENT_PACK_DASHBOARDS",
        "EDIT_USER_DASHBOARDS",
        "EDIT_EXPORT",
        "VIEW_ALERTS",
        "VIEW_USER_DASHBOARDS",
        "EDIT_INTERACTIVE_ANALYTICS",
        "EDIT_SHARED_DASHBOARD_URLS",
        "EDIT_CONTENT_PACKS",
        "VIEW_EXTRACTED_FIELDS",
        "VIEW_EXPORT",
        "EDIT_SHARED_DASHBOARDS",
        "EDIT_EXTRACTED_FIELDS"
    ],
    "dataSets": [
        "00000000-0000-0000-0000-000000000005",
        "00000000-0000-0000-0000-000000000006"
    ]
}
Authentication
This operation uses the following authentication methods.
Responses
201

Successfully created a new role.

Returns roles.post.response of type(s) application/json
{
    "id": "f970dcba-fe3b-4ae2-b867-7164644db34e",
    "name": "User1",
    "description": "Can use Interactive Analytics and Dashboards",
    "capabilities": [
        {
            "id": "VIEW_SHARED_DASHBOARDS"
        },
        {
            "id": "VIEW_INTERACTIVE_ANALYTICS"
        },
        {
            "id": "VIEW_CONTENT_PACKS"
        },
        {
            "id": "VIEW_SHARED_DASHBOARD_URLS"
        },
        {
            "id": "VIEW_CONTENT_PACK_DASHBOARDS"
        },
        {
            "id": "EDIT_USER_DASHBOARDS"
        },
        {
            "id": "EDIT_EXPORT"
        },
        {
            "id": "VIEW_ALERTS"
        },
        {
            "id": "VIEW_USER_DASHBOARDS"
        },
        {
            "id": "EDIT_INTERACTIVE_ANALYTICS"
        },
        {
            "id": "EDIT_SHARED_DASHBOARD_URLS"
        },
        {
            "id": "EDIT_CONTENT_PACKS"
        },
        {
            "id": "VIEW_EXTRACTED_FIELDS"
        },
        {
            "id": "VIEW_EXPORT"
        },
        {
            "id": "EDIT_SHARED_DASHBOARDS"
        },
        {
            "id": "EDIT_EXTRACTED_FIELDS"
        }
    ],
    "dataSets": [
        {
            "id": "356f4d33-4e93-47f0-9dc5-1e97f0398db0",
            "name": "identity constraints",
            "type": "OR",
            "constraints": [
                {
                    "name": "id",
                    "operator": "CONTAINS",
                    "value": "00000000-0000-0000-0000-000000000001"
                }
            ]
        }
    ],
    "required": false,
    "editable": true
}

400

Invalid request body

Returns error of type(s) application/json
{
    "errorMessage": "Some fields have incorrect values",
    "errorCode": "FIELD_ERROR",
    "errorDetails": {
        "name": [
            {
                "errorCode": "com.vmware.loginsight.api.errors.field_required",
                "errorMessage": "Value cannot be empty."
            }
        ]
    }
}
string
errorMessage
Required

A message describing the error.

string
errorCode
Optional

A code representing the type of error.

Possible values are : LIMIT_ERROR, FIELD_ERROR, TEST_ERROR, JSON_FORMAT_ERROR, LICENSE_ERROR, VSPHERE_INTEGRATION_ERROR, VROPS_INTEGRATION_ERROR, UPGRADE_ERROR, SEARCH_ERROR, AGENT_ERROR, RBAC_COMMON_ERROR, RBAC_USERS_ERROR, RBAC_GROUPS_ERROR, RBAC_ADGROUPS_ERROR, RBAC_DATASETS_ERROR, RBAC_VIDM_GROUPS_ERROR, RBAC_VIDB_GROUPS_ERROR, SECURITY_ERROR, DEPLOYMENT_ERROR, SUPPORT_BUNDLE_ERROR, LOAD_BALANCER_ERROR, VIDM_ERROR, VIDB_ERROR, QUERY_ERROR, SSL_CERTIFICATE_ERROR, PROXY_ERROR,
object
errorDetails
Optional

Dynamic error details, where the field name can vary depending on the request field and error code.


401
Operation doesn't return any data structure

409

Role name already exists.

Returns error of type(s) application/json
{
    "errorMessage": "Another role with specified name already exists.",
    "errorCode": "RBAC_GROUPS_ERROR",
    "errorDetails": {
        "errorCode": "com.vmware.loginsight.api.errors.rbac.group_with_specified_name_already_exists"
    }
}
string
errorMessage
Required

A message describing the error.

string
errorCode
Optional

A code representing the type of error.

Possible values are : LIMIT_ERROR, FIELD_ERROR, TEST_ERROR, JSON_FORMAT_ERROR, LICENSE_ERROR, VSPHERE_INTEGRATION_ERROR, VROPS_INTEGRATION_ERROR, UPGRADE_ERROR, SEARCH_ERROR, AGENT_ERROR, RBAC_COMMON_ERROR, RBAC_USERS_ERROR, RBAC_GROUPS_ERROR, RBAC_ADGROUPS_ERROR, RBAC_DATASETS_ERROR, RBAC_VIDM_GROUPS_ERROR, RBAC_VIDB_GROUPS_ERROR, SECURITY_ERROR, DEPLOYMENT_ERROR, SUPPORT_BUNDLE_ERROR, LOAD_BALANCER_ERROR, VIDM_ERROR, VIDB_ERROR, QUERY_ERROR, SSL_CERTIFICATE_ERROR, PROXY_ERROR,
object
errorDetails
Optional

Dynamic error details, where the field name can vary depending on the request field and error code.


440
Operation doesn't return any data structure

500

Internal error while processing the client request

Returns error of type(s) application/json
{
    "errorMessage": "The operation failed due to an internal error."
}
string
errorMessage
Required

A message describing the error.

string
errorCode
Optional

A code representing the type of error.

Possible values are : LIMIT_ERROR, FIELD_ERROR, TEST_ERROR, JSON_FORMAT_ERROR, LICENSE_ERROR, VSPHERE_INTEGRATION_ERROR, VROPS_INTEGRATION_ERROR, UPGRADE_ERROR, SEARCH_ERROR, AGENT_ERROR, RBAC_COMMON_ERROR, RBAC_USERS_ERROR, RBAC_GROUPS_ERROR, RBAC_ADGROUPS_ERROR, RBAC_DATASETS_ERROR, RBAC_VIDM_GROUPS_ERROR, RBAC_VIDB_GROUPS_ERROR, SECURITY_ERROR, DEPLOYMENT_ERROR, SUPPORT_BUNDLE_ERROR, LOAD_BALANCER_ERROR, VIDM_ERROR, VIDB_ERROR, QUERY_ERROR, SSL_CERTIFICATE_ERROR, PROXY_ERROR,
object
errorDetails
Optional

Dynamic error details, where the field name can vary depending on the request field and error code.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/api/v2/roles