Use NetOps Portal Web Services

In this article:
Access the
NetOps Portal
Web Services
You can access the API components that
DX NetOps Performance Management
includes as RESTful web services from a web browser. The endpoints require authentication. Only local admin users can access the API components (make
NetOps Portal
RESTful web services calls). The resulting API launch page includes a list of the available web services, endpoint addresses, and Web Application Description Language (WADL) and Web Service Definition Language (WSDL) URLs.
You can access the full list of
NetOps Portal
RESTful web services at the following URL:
http://
PC_host
:8181/pc/center
From the launch page, you can access the WADL of each web service for testing. If you use a testing utility to run web service calls, you receive feedback that is useful for debugging purposes. Using a testing utility can be a timesaver. You can supply username and password parameters as service endpoints for automatic authentication of all service calls. Testing utilities require a WSDL file that describes the service being tested. WSDL files are XML files that conform to the WSDL. In the REST format, use the simpler WADL. To access the SOAP web services, use the link to the WSDL.
Access the
NetOps Portal
REST Web Services Documentation
Most of the web services provide their own documentation, including lists and descriptions of the available parameters and operations. You can access this documentation in HTML format from the launch page:
http://
PC_host
:8181/pc/center/rest
The Endpoints and the XML Schema
The endpoints act on a common set of data. You can represent the data in different data formats (for example, MIME types). The format depends on the endpoint that consumes or produces the data. An XML schema describes the data and other supported data formats, such as JSON.
The articles in this section of the documentation describe the basic terms and parameters of the XML schema to create scripts for the
NetOps Portal
RESTful web services. You can group the data by namespace. A schema describes the types and elements of each namespace.
Types
define the structure of the data, while
elements
are instances of a type. For example, REST endpoints produce or consume elements, and the structure of each element is described by its type.
Interact with the
NetOps Portal
REST Web Services Using Examples
The following examples illustrate some standard procedures for interacting with the
NetOps Portal
RESTful web services using a REST client. This article includes information about how to create user account roles and user accounts using a REST client.
Verify the Prerequisites
Connect a REST Client to the
NetOps Portal
REST Web Services
Follow these steps:
  1. Launch the REST client.
  2. Enter a URL for the
    NetOps Portal
    RESTful web services API in the
    URL
    field, and then select
    GET
    for the
    HTTP Method
    . Use the following format:
    http://
    PC_host
    :8181/pc/center/webservice/
    Web_Service_Name
    For example, to invoke the
    tenants
    web service, supply the following URL:
    http://
    PC_host
    :8181/pc/center/webservice/tenants/
  3. Select
    Basic Authentication
    from the
    Authentication
    menu.
    The
    Basic Authorization
    dialog opens.
  4. Do the following:
    1. Enter a valid username and password for a user account that has global administrator access, and then click
      OK
      .
    2. Select
      Custom Header
      from the
      Headers
      menu.
    The
    Request Header
    dialog opens.
  5. Enter
    Content-Type
    as the value for the
    Name
    parameter.
  6. Enter
    application/xml
    in the
    Value
    field, and then click
    OK
    .
    The
    Headers
    section now shows the following updated values:
    Authorization:
    Basic YWRtaW46YWR...
    Content-Type:
    application/xml
Basic
NetOps Portal
REST Web Service Examples
Example: Simple PUT operation that updates the description parameter of a tenant
The following is an example of a simple PUT operation that updates the description parameter of a tenant:
http://
PC_host
:8181/pc/center/webservice/tenants/tenantName/tenantName/tenantDescription/NewDescription
For more information about this web service, see Tenants Web Service.
Substitute the desired values for the italicized terms. The following parameters are required:
  • tenantName
    The name of the tenant that you want to edit.
  • tenantDescription
    The new description to identify this tenant.
Example: Simple GET operation that returns a list of tenant IDs and names
The following is an example of a simple GET operation that returns a list of tenant IDs and names using the
tenants
web service:
http://
PC_host
:8181/pc/center/webservice/tenants/idNames
For more information about this web service, see Tenants Web Service.
The following XML is returned:
<?xml version="1.0" encoding="UTF-8"?> <idNames> <idName value="tenantAccountId" /> <idName value="tenantItemId" /> <idName value="tenantName" /> </idNames>
HTTP requests always return a response and a status code, even when successful. The response text is either the expected result or an error message to indicate a problem. The status code is 200 for a successful response, or a numeric error indicator. The following HTTP response code ranges are used:
  • 200 - Command status is 'OK'.
  • 400 - A user error has occurred. Errors in this range indicate a problem with the input text (400) or the user credentials (403) and can usually be easily corrected.
  • 500 - A system error occurred. Errors in this range typically indicate a system fault. These errors can require assistance from Broadcom Technical Support to resolve them.
For more information about HTTP status codes, see the IETF website.