Roles Web Service
The API provides the roles web service to let you view, create, and modify user account roles.
You can view, create, and modify user account roles using the
roleis a parameter assigned to a user account that controls user access to product features and dashboard pages. Based on user job functions, the role grants administrative access to
DX NetOps Performance Managementconfiguration using
role rights. With roles, users can access data and
DX NetOps Performance Managementfeatures that they require to perform their duties and restrict access to features that they do not require. To assign custom or factory roles to user accounts, use the users RESTful web service.
In this article:
Verify the Prerequisites
- You have connected the REST client that you will use to invoke theNetOps Portalweb services to theNetOps PortalRESTful web services.
- You are a local admin user.
Access the roles Web Service Documentation
As a local admin user, issue the following call to see the parameters for the
As a local admin user, issue the following call to see a list of supported operations:
Basic roles Parameters
The current values for the following user account role settings are available from the GET command:
- accessRightsThe role rights that are allocated to this role. Multiple role rights are available for allocation, and some are data source-specific. To get a list of all available role rights, thecategoryIdparameter is required. ThecategoryIdparameter with value 1 corresponds to bothNetOps Portaland the data aggregator.
- cultureSpecifies a language (locale). Supply a language identifier from the following list:
- en-US (English, United States)
- ja-JP (Japanese)
- zh-CN (Simplified Chinese)
- fr-FR (French, France)
- description(Optional) Describes the role to help you identify it.
- enabledDetermines whether the role is enabled for use (activated). Values are true or false.
- nameIs a name for the role. The name is limited to 50 characters.
- selectionsProvides sets of access rights that you can selectively grant to this role, organized into categories.
- userCountIs the number of users who have this role assigned to their user account.
- userIDIs an internally assigned value for the role.
Roles Web Service Example Syntax
Issue the following call to see the available operations and parameters for the roles web service:
Available GET Methods
- get access rightsRetrieves a list of the role rights that are assigned to a specified role. Use the following syntax:http://PC_host:8181/pc/center/webservice/roles/idName/idValue/rights/cultureId
- get access rights by categoryRetrieves a list of all available role rights for a specified category. The category is eitherNetOps Portalor a data source. A categoryId of 1 applies to bothNetOps Portaland Data Aggregator.http://PC_host:8181/pc/center/webservice/roles/rights/categoryid/cultureId
- get categoryRetrieves an XML document that includes the categoryId:http://PC_host:8181/pc/center/webservice/roles/rights/categories/en-US
- get by tenantRetrieves a list of all roles that are associated with the tenant for the logged-in user. Use the following syntax:http://PC_host:8181/pc/center/webservice/roles/idName/idValue/rights/tenant/tenantIdName/tenantIdValue/cultureId
- get categoryIdRetrieves XML that shows the available category IDs:http://PC_host:8181/pc/center/webservice/roles/rights/categories/cultureIdA value of 1 corresponds toNetOps Portaland Data Aggregator. Role rights in that category only apply to a Data Aggregator data source.
- get id namesRetrieves a list of identifiers that can be used to identify roles in other web service methods. Use the following syntax:http://PC_host:8181/pc/center/webservice/roles/idNames
Available PUT Methods
- copyCopies a role. This method creates a copy of a specified role and associates it with the tenant for the logged-in user. Use the following syntax:http://PC_host:8181/pc/center/webservice/roles/idName/idValue/copy/roleName/description/enabled/cultureId
- updateModifies a specified role. The role name and tenant ID are required elements of the role parameters:http://PC_host:8181/pc center/webservice/roles/idName/idValue/cultureId
Available POST Methods
- createCreates a role. The new role is associated with the tenant for the logged-in user:http://PC_host:8181/pc/center/webservice/roles/
- create for tenantCreates a role and assigns it to the specified tenant.http://PC_host:8181/pc/center/webservice/roles/tenant/tenantIdName/tenantIdValue
Create a User Account Role
Best Practice:Create user account roles before creating user accounts.
Use the roles web service to create user account roles. The
roleis a parameter of the user account that grants the user access to certain administrative features and to perform selected tasks. The following procedure invokes the
rolesweb service using a REST client.
Issue the following call to see the parameters for the roles web service:
Follow these steps:
- As a local admin user, in the REST client interface, enter the following URL in theURLfield, and then selectPOSTfor the method:http://PC_host:8181/pc/center/webservice/roles/
- SelectPOSTfor"HTTP" Method.
- Provide a valid Username and Password for a user account that has global administrator access toNetOps Portal.
- Select'application/xml' as the'Body Content-type'in the Body settings.
- Paste XML in the Body field that resembles the following example:<role> <name>TestRoleName</name> <description>Test Role Description</description> <enabled>true</enabled> <accessRights> <accessRight> <accessRightName>ViewToS</accessRightName> <categoryId>1</categoryId> <enabled>true</enabled> </accessRight> </accessRights> </role>
- accessRightsCorrespond to role rights.
- accessRightNameThe name of the role right. For example, the administerGroups role right allows the user with this role to manage a limited section of the Groups tree.
- categoryIdIdentifies the category of role rights, such asNetOps Portalrole rights or data-source-specific role rights.
- Run the method.
The user account role is created.