Tenants Web Service

npc offers a set of APIs that let you automate provisioning and configuration tasks. The most frequently repeated or time-consuming tasks are exposed to you with web services. Some of these APIs consist of web services that conform to the Representational State Transfer (REST) model.
You can automate provisioning and configuration tasks using the
tenants
web service. The most frequently repeated or time-consuming tasks are exposed to you with web services. Some of these APIs consist of web services that conform to the Representational State Transfer (REST) model.
This use case illustrates a procedure that an administrator can deploy to create multiple tenant definitions using the
tenants
web service. Because each tenant has its own user accounts to provide access to
NetOps Portal
, we also describe user account creation within tenants. In this use case, we describe the steps to take when using a REST client, a generic web services user interface application. The examples in this use case contain URIs that are constructed using the default server port, 8181.
Create Tenants Programmatically
The local admin users can create tenants using the
tenants
web service. The basic tenant definition contains a few parameters to identify the MSP customer and let other operators access managed items and configuration for the customer. An administrator account is a required component of the tenant definition so that the customer can perform some tenant setup.
You can associate monitored devices and product settings with the tenant definition in separate steps. Each tenant must contain at least one IP domain. You and the tenant administrator can then configure other product settings that are required to manage the enterprise infrastructure and applications for that customer.
Create Tenants Using Web Services
Use any REST client to create and configure a tenant using the tenants web service.
Follow these steps:
  1. Set up a REST client with a connection to the
    NetOps Portal
    server.
  2. Enter a URL for the web services API in the REST client. Use the following format:
    http://
    PC_host
    :8181/pc/center/webservice/tenants/
  3. Select
    POST
    for
    "HTTP" Method
    .
  4. Provide a valid Username and Password for a user account that has global administrator access to
    NetOps Portal
    .
  5. Select
    'application/xml'
    as the
    'Body Content-type'
    in the Body settings.
  6. Add the following XML within the "Body" text section:
    <tenant> <tenantName>Name of tenant</tenantName> <tenantDesc>Description of the tenant</tenantDesc> <accountIdentifier>unique string for this tenant</accountIdentifier> <status>{activated or disabled}</status> <removable>{true or false}</removable> <theme>{CA-Blue or CA-Gray}</theme> <defaultCulture>culture</defaultCulture> </tenant>
  7. Replace any values with the values that you want to use for the new tenant.
    For example, supply the following parameters:
    <tenant> <tenantName>John Doe</tenantName> <tenantDesc>John Doe Corporation tenant</tenantDesc> <accountIdentifier>JD1234</accountIdentifier> <status>Enabled</status> <removable>false</removable> <theme>CA-Blue</theme> <defaultCulture>en-US</defaultCulture> </tenant>
    For more information about tenant parameters, see Tenants Service Example Syntax.
  8. Run the method.
  9. Repeat the preceding steps until you have created as many tenants as you require.
Create Users Using Web Services
Use any REST client to create and configure a user account using the users web service.
Every user account is automatically associated with a tenant. If you are deploying multi-tenancy, the new user is assigned to the tenant of the authenticated user account that was used to make the REST service call. If you are not deploying multi-tenancy, this association is transparent to you; new user accounts are associated with the Default Tenant.
Follow these steps:
  1. Set up a REST client with a connection to the
    NetOps Portal
    server.
  2. Enter a URL for the
    NetOps Portal
    RESTful web services API in the REST client. Use the following format:
    http://
    PC_host
    :8181/pc/center/webservice/users/role/
    {roleIdName}
    /
    roleIdValue
    /
    • {roleIdName}
      Use values that are specified in
      http://
      PC_host
      :8181/pc/center/webservice/roles/idName
      s.
      Examples:
      '
      roleName
      ' and '
      roleId
      '.
    • roleIdValue
      This value depends on the
      roleIdName
      that you selected. For example, if
      'roleName'
      is used, substitute a valid role name for
      roleIdValue
      .
      This role must be available within the tenant.
  3. Select
    POST
    for
    "HTTP" Method
    .
  4. Provide a valid Username and Password for a user account that has host or tenant administrator access to
    NetOps Portal
    .
  5. Select
    'application/xml'
    as the
    'Body Content-type'
    in the Body settings.
  6. Add the following parameters within the "Body" text section:
    <user> <name>{UserName}</name> <description>{UserDescription}</description> <enabled>{UserEnabled}</enabled> <removable>{UserRemovable}</removable> <timezone>{UserTimeZone}</timezone> <culture>{UserCulture}</culture> <administeredGroups> <group ID="{GroupID}"/> <group ID="{GroupID}"/> </administeredGroups> </user>
  7. Replace any values with the values that you want to use for the new user account.
    For example, supply the following parameters:
    <user> <name>Jane Doe</name> <description>User associated with the John Doe Corporation tenant.</description> <enabled>true</enabled> <removable>true</removable> <timezone>CST6CDT</timezone> <culture>en-US</culture> <administeredGroups> <group ID="105"/> <group ID="367"/> </administeredGroups> </user>
    For more information about user parameters, see Users Web Service.
    The
    administeredGroups
    parameter is optional. To create a user without administered groups, exclude the tag.
  8. Run the method.
  9. Repeat the preceding steps until you have created as many users as you require.
Basic User Account Parameters
The current values for the following user account settings are available from a GET operation:
http://
PC_host
:8181/pc /center/webservice/users/
cultureId
.
This URL returns information about users associated with the same tenant as the account that is used to execute this command.
For
cultureId
, supply the language code for the language in which you would like to view the output, such as 'en-US'.
  • userID
    Is an internally assigned value for the user account.
  • name
    Is a login name for the user account. The name is limited to 50 characters.
  • description
    (Optional) Describes the user account to help you identify it.
  • enabled
    Determines whether the user account is enabled for use (activated).
  • removable
    States whether the item can be deleted (removed from the database).
    Values
    : true or false.
You cannot delete the two predefined user accounts (
admin
and
user
).
  • timezone (tz)
    Corresponds to the time zone in which the user will view report data.
    Default
    : UTC (Coordinated Universal Time).
  • userLevel
    Identifies the product privilege assigned to this user account.
  • role
    Specifies the role assigned to the user account.
  • tenantId
    Is an internal (database) identifier for the tenant with which the user account is associated.
  • culture
    Specifies 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)
The GET method does not return password information. When you create a new user account, the password is automatically set to be the same as the user name.
A separate PUT method lets you update the password of a specified user account. The password is sent in cleartext to avoid publicizing the encryption key for the web service to use. As a result, the method for changing the password must only be used on the server where
DX NetOps Performance Management
is installed to protect the password privacy.
User Account Product Privilege Settings
Use
NetOps Portal
to determine the
DX NetOps Performance Management
privilege of a specified user account. The
product privilege
is a type of permission set associated with a user account. The product privilege grants user access to features in selected data sources and does not apply to
NetOps Portal
functionality.
A user account has one of the following product privilege assignments:
  • NONE
    Indicates that this user has no access to a specified data source.
  • ADMINISTRATOR
    Indicates that this user has the administrator product privilege for the indicated data source and can perform administrative tasks.
  • POWER_USER
    Indicates that this user has the power user product privilege for the indicated data source and can perform some administrative tasks associated with user accounts and dashboards.
  • USER
    Indicates that this user has the user product privilege for the indicated data source and has no access to administrative features.