Create Role

Details

API Details
Name

Create Role

Description
MethodPOST
URIv1/tenants/tenantId/roles
CloudCenter Release
  • Introduced in CloudCenter 4.0.
  • Effective 4.5.7:
    • The perms attribute now includes the MANAGE_EXPORT and MANAGE_IMPORT options.
    • The objectType attribute now includes the EXPORT and IMPORT options.
Notes

For additional context on <PORT> usage in the following example(s), see Base URI Format.

ESB Headeraction: create.tenants.tenantId.roles

Example

curl -k -X POST -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v1/tenants/1/roles"

Request Body

{
   "id":"23",
   "resource":"https://<HOST>:<PORT>/v1/tenants/1/roles/23",
   "perms":[

   ],
   "name":"Standard User",
   "description":"",
   "tenantId":"1",
   "objectPerms":[
      {
         "objectType":"APP",
         "perms":[
            "CREATE_APP"
         ]
      },
      {
         "objectType":"POLICY",
         "perms":[
            "CREATE_POLICY"
         ]
      },
      {
         "objectType":"DEPLOYMENT_ENVIRONMENT",
         "perms":[
            "CREATE_DEPLOYMENT_ENVIRONMENT"
         ]
      },
      {
         "objectType":"CLOUD",
         "perms":[

         ]
      },
      {
         "objectType":"CLOUD_ACCOUNT",
         "perms":[

         ]
      },
      {
         "objectType":"PROJECT",
         "perms":[

         ]
      },
      {
         "objectType":"EXPORT",
         "perms":[
            "MANAGE_EXPORT"
         ]
      },
      {
         "objectType":"IMPORT",
         "perms":[
            "MANAGE_IMPORT"
         ]
      }
   ],
   "users":[
      {
         "id":"18",
         "resource":"https://<HOST>:<PORT>/v1/users/18",
         "perms":[

         ],
         "username":"Standard User",
         "password":"===redacted===",
         "enabled":true,
         "type":"STANDARD",
         "firstName":"user01",
         "lastName":"user01",
         "companyName":"QA",
         "tenantId":"1",
         "emailAddr":"user01@cliqr.com",
         "emailVerified":true,
         "phoneNumber":"",
         "externalId":"",
         "accessKeys":null,
         "disableReason":null,
         "accountSource":"AdminCreated",
         "status":null,
         "detail":null,
         "activationData":null,
         "created":1458408162000,
         "lastUpdated":1458408162000,
         "coAdmin":false,
         "activationProfileId":null,
         "hasSubscriptionPlanType":null
      }
   ],
   "groups":[

   ],
   "oobRole":true,
   "created":1457438331000,
   "lastUpdated":1467223499200
}

Response

{
    "id": "23",
    "resource": "https://<HOST>:<PORT>/v1/tenants/1/roles/23",
    "perms": [],
    "name": "Standard User",
    "description": "",
    "tenantId": "1",
    "objectPerms": [{
        "objectType": "APP",
        "perms": [
            "CREATE_APP"
        ]
    }, {
        "objectType": "POLICY",
        "perms": [
            "CREATE_POLICY"
        ]
    }, {
        "objectType": "DEPLOYMENT_ENVIRONMENT",
        "perms": [
            "CREATE_DEPLOYMENT_ENVIRONMENT"
        ]
    }, {
        "objectType": "CLOUD",
        "perms": []
    }, {
        "objectType": "CLOUD_ACCOUNT",
        "perms": []
    }, {
        "objectType": "PROJECT",
        "perms": []
    }],
    "users": [{
        "id": "18",
        "resource": "https://<HOST>:<PORT>/v1/users/18",
        "perms": [],
        "username": "Standard User",
        "password": "===redacted===",
        "enabled": true,
        "type": "STANDARD",
        "firstName": "user01",
        "lastName": "user01",
        "companyName": "QA",
        "tenantId": "1",
        "emailAddr": "user01@cliqr.com",
        "emailVerified": true,
        "phoneNumber": "",
        "externalId": "",
        "accessKeys": null,
        "disableReason": null,
        "accountSource": "AdminCreated",
        "status": null,
        "detail": null,
        "activationData": null,
        "created": 1458408162000,
        "lastUpdated": 1458408162000,
        "coAdmin": false,
        "activationProfileId": null,
        "hasSubscriptionPlanType": null
    }],
    "groups": [],
    "oobRole": true,
    "created": 1457438331000,
    "lastUpdated": 1467223499200
}

Request Attributes

tenantId
  • DescriptionUnique, system-generated identifier for the tenant organization. A tenant admin must belong to this tenant to invoke any APIs for this tenant. See Add Sub-Tenants > Tenant ID and Tenant Name Dependency.

  • Type: String
name
  • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

  • Type: String

description
  • DescriptionA brief description for this CloudCenter Resource.

  • Type: String

users (click for additional details)

If specified, provide the corresponding User ID.

group (click for additional details)
If specified, provide the corresponding Group ID .

objectPerms
  • Description: Identifies the permissions for this resource
  • Type: Array of name-value pairs

    objectType
    • Description: The name for each type of permission that a user or group can create, update, view, or delete a resource. See Permission Control >Tenant Owner Permission Nuances for additional details.
    • Type: Enumeration

    Required

    perms
    • Description: The permission level for each resource. See Permission Control >Tenant Owner Permission Nuances for additional details.
    • Type: Enumeration

Response Attributes

id
  • DescriptionUnique, system-generated identifier for this CloudCenter Resource.

  • Type: String
resource
  • Description: Unique URL to access this resource
  • Type: String
perms (click for additional details)

name
  • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

  • Type: String

Required

description
  • DescriptionA brief description for this CloudCenter Resource.

  • Type: String

tenantId
  • DescriptionUnique, system-generated identifier for the tenant organization. A tenant admin must belong to this tenant to invoke any APIs for this tenant. See Add Sub-Tenants > Tenant ID and Tenant Name Dependency.

  • Type: String

Required

objectPerms
  • Description: Identifies the permissions for this resource
  • Type: Array of name-value pairs

    objectType
    • Description: The name for each type of permission that a user or group can create, update, view, or delete a resource. See Permission Control >Tenant Owner Permission Nuances for additional details.
    • Type: Enumeration

    Required

    perms
    • Description: The permission level for each resource. See Permission Control >Tenant Owner Permission Nuances for additional details.
    • Type: Enumeration

 users (click for additional details)

 groups (click for additional details)

oobRole
  • Description: Indicates whether this role is a predefined system role for this tenant organization
    • true = this role is a predefined system role for this tenant organization
    • false = this role is not a predefined system role for this tenant organization
  • Type: Boolean
created
  • Description: The date that this resource or favorite was created (system generated). This is a read-only attribute and cannot be configured.
  • Type: Long
lastUpdated
  • Description: Date that this resource was last updated. This attribute is the same as the lastUpdatedTime attribute.

  • Type: Long