Clone a Role

This API is used to clone a role.

Before you begin

  • Ensure that the session ID is valid and has not expired.
  • Make sure you have valid role name to be cloned.

Request Structure

Endpoint: /role-clone
Type: POST
Sample URL: https://<IP/HostName/TenantName>:<GWPORT>/avxapi/role-clone?gwsource=external

To understand the elements of the sample URL, click here.

Headers:
Content-Type: application/json
Table 1. Input Parameters
Name Description
sessionId (or) Token

Header

(Mandatory) Use either Session Id or Token received after login.

Type: String

Example: "sessionId": "ce7f1a14-2bf9-4e4a-89a8-bc780a255813"

gwsource

Query

(Mandatory) Source from which the request is triggered. The values can be:
  • web
  • external

Type: String

Payload

String

(Mandatory) Input data for request body in application/json format. For payload details, see Payload section.

Payload

Name Description
existingName

payload

(Mandatory) Name of the role to be cloned.

Type: String

Example: "role_1"

newName

payload

(Mandatory) Name of the cloned new role.

Type: String

Example: "clonerole_1"

description

payload

(Optional) Description of the cloned role.

Type: String

Example: "Clone test role"

Response Structure

  • Status Code: 200 OK
  • Message: Clone role successful.
  • Headers:
    • Content-Type: application/json
Table 2. Response Parameters
Name Description
response Contains the response attributes for role cloned successfully.
message Success message or failure description in case of error.
appStatusCode Application specific status code for the response. Will be non-null for failure response.
tags More info in case of failure response.

Status Codes

HTTP Code appStatusCode Response Message
200 OK null Clone role successful.
404 Not Found ACCT_RO_001 Role Name to be cloned not found
400 Bad request VALIDATION_ERROR_0004 Mandatory Field 'existingName' is missing or empty, Mandatory Field 'newName' is missing or empty
400 Bad request VALIDATION_ERROR_0004 Mandatory Field 'existingName' is missing or empty, 'existingName' should have at least '2' characters
400 Bad request VALIDATION_ERROR_0004 'newName' should have at least '2' characters, Mandatory Field 'newName' is missing or empty
400 Bad request VALIDATION_ERROR_0004 'newName' cannot exceed '64' characters
400 Bad request ACCT_RO_026 Invalid Description
409 Conflict ACCT_RO_002 ClonedRole Name already exists for the given RoleName

Sample Request/Response

Use Case

Clone a role role_1 to create a new cloned role named clonerole_1.

Sample Request
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/role-clone?gwsource=external
Request Payload
{
 "payload": {
   "existingName": "role_1",
   "newName": "clonerole_1",
   "description": "clone test role."
   }
 } 
Sample Response
 {
 "response": "Clone role successful",
 "message": "Clone role successful",
 "appStatusCode": null,
 "tags": null,
 "headers": null
 } 

What's Next

Reference

Understanding the sample URL:
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.