NSP 17.6 API Programmer Guide
NSP 17.6 API Programmer Guide
NSP 17.6 API Programmer Guide
3HE-11987-AAAC-TQZZA
Issue 1
June 2017
NFM-P | NSD and NRC
Legal notice
Nokia is a registered trademark of Nokia Corporation. Other products and company names mentioned herein may be trademarks or
tradenames of their respective owners.
The information presented is subject to change without notice. No responsibility is assumed for inaccuracies contained herein.
© 2017 Nokia.
Disclaimers
Nokia products are intended for commercial uses. Without the appropriate network design engineering, they must not be sold, licensed or
otherwise distributed for use in any hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities,
aircraft navigation or communication systems, air traffic control, direct life-support machines, or weapons systems, in which the failure of
products could lead directly to death, personal injury, or severe physical or environmental damage. The customer hereby agrees that the
use, sale, license or other distribution of the products for any such application without the prior written consent of Nokia, shall be at the
customer's sole risk. The customer hereby agrees to defend and hold Nokia harmless from any claims for loss, cost, damage, expense or
liability that may arise out of or in connection with the use, sale, license or other distribution of the products in such applications.
This document may contain information regarding the use and installation of non-Nokia products. Please note that this information is
provided as a courtesy to assist you. While Nokia tries to ensure that this information accurately reflects information provided by the
supplier, please refer to the materials provided with any non-Nokia product and contact the supplier for confirmation. Nokia assumes no
responsibility or liability for incorrect or incomplete information provided about non-Nokia products.
However, this does not constitute a representation or warranty. The warranties provided for Nokia products, if any, are set forth in
contractual documentation entered into by Nokia and its customers.
This document was originally written in English. If there is any conflict or inconsistency between the English version and any other version of
a document, the English version shall prevail.
Release 17.6
June 2017
2 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC
Contents
1 Getting started................................................................................................................................................7
1.1 Overview .............................................................................................................................................7
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 3
NFM-P | NSD and NRC
Document support
Customer documentation and product support URLs:
• Customer Documentation Welcome Page
• Technical support
How to comment
• Documentation feedback
Release 17.6
June 2017
4 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC
Overview
Purpose
This volume provides an overview of OSS application development and Open Interfaces
Professional Services.
Contents
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 5
NFM-P | NSD and NRC
Release 17.6
June 2017
6 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Getting started
1 Getting started
1.1 Overview
1.1.1 About this guide
The NSP API Programmer Guide provides information to assist OSS developers with the creation of
business applications that interact with NSP modules and applications to perform various network
management functions.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 7
Overview NFM-P | NSD and NRC
Release 17.6
June 2017
8 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC
Overview
Purpose
This volume describes the NSP modules.
Contents
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 9
NFM-P | NSD and NRC
Release 17.6
June 2017
10 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC NSP API overview
2.1 Overview
2.1.1 Purpose
The Network Service Platform, or NSP, comprises different modules. This chapter introduces the
NSP modules that expose their functionality through REST API services in the following functional
categories:
• NSP REST gateway
• NSD and NRC
− Service fulfillment
− Optimization
− Notification
• Network and service assurance
• Network Functions Management
See the NSP Deployment Overview for more information about the NSP and its modules.
2.1.2 Contents
2.1 Overview 11
NSP API modules 12
2.2 Overview 12
Common API features 15
2.3 General information 15
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 11
Overview NFM-P | NSD and NRC
2.2 Overview
2.2.1 NSP REST gateway
The NSP REST Gateway API provides the entry point for API clients to locate and authenticate
REST client requests to gain access to the various NSP modules that have registered API services.
The REST gateway online documentation is located at https://<server>/rest-gateway/api-docs
where <server> is the hostname of the NSP server that hosts the nspOS server.
See Chapter 3, “NSP REST API Gateway” for more information.
Release 17.6
June 2017
12 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Overview
See the NSP online help for more information about these applications.
See Chapter 5, “Network and service assurance” for more information.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 13
Overview NFM-P | NSD and NRC
Release 17.6
June 2017
14 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC General information
2.3.2 Versioning
Up to three versions of the NSP REST APIs are maintained for each major release. The latest API
version may introduce additional request attributes if there is a fully backward-compatible default
value, and users must be prepared to either accept additional response attributes, or ignore any
that are unknown. The latest API versions may also introduce additional functions, but the behavior
of existing functions do not change.
See Chapter 7, “Backwards compatibility” for more information about the differences between API
versions.
2.3.3 Filtering
When using any of the NSP REST APIs, filtering can be used to limit the number of objects returned
by a GET request. Filters are defined in the query parameter of the URI within GET requests, and
only objects with attributes that match the defined expression or expressions are returned. The URI
syntax supports expressions for many object attributes and allows for logical combinations of more
than one filter criteria. A filter is comprised of a series of attributes, identified by name, that are
assigned values for which to filter.
Multiple filters can be separated by the '&' character (for AND). Values can be preceded by the '!'
character for NOT. Multiple values are separated by commas. Parenthesis are required around
values when using NOT.
The formal filtering notation is:
| "sortBy=" [-]attributeName
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 15
General information NFM-P | NSD and NRC
attributeName = string
value = string|number
The following notable information applies to filtering:
• both attributeName= and attributeName=() specify that the value of attributeName is an empty
string
• attributeName=!() specifies that the value of attributeName is not an empty string
• attributeName=(value1) and attributeName=value1 are equivalent
• Only the first sortBy expression in a filter will take effect. Additional sortBy expressions are
ignored.
• object attributes that have a null value or a boolean value cannot be filtered out of a list and
always appear in the results
• Object attributes that are strings must not contain commas (,) as these are used as separators in
an OR statement. String values are case sensitive.
• A filtered search ignores any unrecognized object attributes that are specified. A filtered search
that contains a recognized numeric attribute, but an incomplete condition, returns an error. A
filtered search that contains a recognized string attribute, but an incomplete condition, returns no
results.
2.3.4 Pagination
The NSP REST APIs support pagination by a JSON object that includes the values “startRow”,
“endRow”, “totalRows”, and “status”. The APIs described in this document do not use pagination, as
the NSP server always returns a complete response.
2XX codes
2XX codes indicate that the request was processed.
• 200: Everything is OK (content is in the body)
• 204: Everything is OK, but there is no content in the body (this is the standard response for an
update or a deletion)
4XX codes
• 400: Bad request: something is wrong in the request
• 401: Not authenticated (wrong password or wrong Token)
• 403: Not authorized (request for something to which you do not have rights)
• 404: Not found (request for something that does not exist)
Release 17.6
June 2017
16 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC General information
5XX codes
• 500: Internal server error (error is explained in the body)
Postman collections
NFM-P REST API examples and NSD and NRC REST API examples are each available in
Postman collections that are provided alongside their respective suites of documentation. Postman
can be downloaded from https://www.getpostman.com/apps. The collections of REST API examples
must be imported into Postman in order to be browsed. The collections have been organized so
that folders contain individual workflows. The examples within the folders are presented in the order
that they should be executed.
Example requests make use of Postman environments so that they can be executed against a
running instance. The following variables can be configured:
• urlHost - the hostname of the NFM-P or NSD and NRC server
• token - the token returned by the authorization API
In order for the example requests to be successfully executed, their UUIDs may need to be
modified so as to reflect applicable values for the system that is being used. In most cases, the
workflows have been organized so that UUIDs from earlier requests can be used in subsequent
requests. Comments within each example also describe any prerequisites that may be necessary.
For further details on using Postman, see the documentation at https://www.getpostman.com/docs.
HTML collection
NSP REST API examples are available in an HTML collection that is provided alongside the full
suite of NFM-P and NSD and NRC documentation. This collection has been organized so that
sections contain individual workflows. The examples within the sections are presented in the order
that they should be executed. In order for the example requests to be successfully executed, their
UUIDs may need to be modified so as to reflect applicable values for the system that is being used.
In most cases, the workflows have been organized so that UUIDs from earlier requests can be used
in subsequent requests. Comments within each example also describe any prerequisites that may
be necessary.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 17
General information NFM-P | NSD and NRC
Release 17.6
June 2017
18 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC
Overview
Purpose
This volume describes NSP API functions by providing sample use cases and workflows on the
NSP API modules. It also includes information on API backwards compatibility.
Contents
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 19
NFM-P | NSD and NRC
Release 17.6
June 2017
20 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC NSP REST API Gateway
3.1 Introduction
3.1.1 NSP REST Gateway API
The NSP Rest Gateway API provides the initial entry point to access registered NSP API services of
NSP Modules. These APIs allows OSS Clients to perform the following functions:
• List the URL location of registered NSP API services which includes their Base URL and
documentation URL that are available to OSS clients.
• Provide Access to these services using an Authorization bearer token along with the ability to
refresh the token
• Terminate active sessions
Note: The API service “VNFManager” may be returned when the location function is
executed. This API service will be changing in future releases of NSP. Contact your Nokia
representative if you want to integrate this API service.
3.1.2 Prerequisites
The following are the prerequisites to using the NSP REST Gateway API.
• The NSP module whose API services you want to access using the REST Gateway must be
installed and licensed. See the NSP NFM-P Installation and Upgrade Guide for more
information.
• A valid user account with a username and password needs to be created on the NSP server with
access rights to the NSP module. See the NSP NFM-P System Administrator Guide for more
information.
https://<server>/rest-gateway/rest/api/v1/location/services
where <server> is the hostname or IP address of the NSP server that hosts the API module
See NSP API postman collection for a sample request for retrieving location services.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 21
Redundancy overview NFM-P | NSD and NRC
Initial Authentication
Prior to sending any REST requests, the OSS application must first authenticate the user. This is
done by sending a POST request, using Basic authentication (base64 encoded credentials in the
form of username:password), to the /rest-gateway/authentication/rest/api/v1/token endpoint to
obtain a Bearer token which will be used for future communications:
https://<server>/rest-gateway/rest/api/v1/auth/token
where the "grant_type" must be specified as “client_credentials”
and where <server> is the hostname or IP address of the NSP server that hosts the API module.
Authentication Refresh
The Bearer token has an expiration time. To avoid expiration, a port request with the “refresh_
token” generates a new bearer token that is valid for another “expire_in” seconds, using Basic
authentication (base64 encoded credentials in the form of username:password)
. The previous tokens are invalidated upon refresh token generation.
https://<server>/rest-gateway/rest/api/v1/auth/token
the "grant_type" can be specified as “refresh_token”
and where <server> is the hostname or IP address of the NSP server that hosts the API module.
Revocation
A bearer token can be terminated by sending a POST request to the rest-gateway endpoint with the
token or client User_name details.
https://<server>/rest-gateway/rest/api/v1/auth/revocation
where <server> is the hostname or IP address of the NSP server that hosts the API module.
See NSP API postman collection for sample requests for performing authorisation functions.
Release 17.6
June 2017
22 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Sample workflow
See NSP API postman collection for sample requests for performing redundancy functions.
See the NSP Deployment Overview for more information on redundancy.
Note: Redirecting of API service interfaces such as alarms or service supervision OAM
requests are not included as part of the current release. An API client may request these
services per Rest API URIs obtained from the location service response. See 3.1.3 “Retrieve
location services” (p. 21) and 3.1.4 “Authentication Functions” (p. 21) for more information.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 23
Sample workflow NFM-P | NSD and NRC
Release 17.6
June 2017
24 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC NSD and NRC
4.1 Introduction
4.1.1 NSD and NRC applications
The NSD and NRC modules provide service creation and network optimization functions using
browser-based applications. Each of these applications can be accessed by any authorized user. To
view a dashboard of all the available applications, go to:
https://<server>:8543
where server is the hostname or IP address of your installed NSD and NRC server.
4.2.2 Authorization
For information about authorizing and authenticating NSD and NRC clients, see Chapter 3, “NSP
REST API Gateway”.
HTTP headers
All API request uses HTTP headers for authentication. Each API call must be authenticated, so the
Authorization header must be sent with each request (with the exception of the GET token request):
Content-type
• The server response is formatted in JSON. Content-Type is a required header field for HTTP
POST, PUT, and PATCH as mentioned below to either create or modify an entity:
PUT /whatever HTTP/1.1
Content-Type: application/json
Authorization: $AUTHORIZATION_STRING
Authorization (required)
• Each API call must be authenticated, so the Authorization header must be sent with each
request (with the exception of the GET token request):
GET /whatever HTTP/1.1
Authorization: $AUTHORIZATION_STRING
$AUTHORIZATION_STRING is the token returned by the GET token request.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 25
NSD and NRC API NFM-P | NSD and NRC
{
"data": {
"ietf-restconf:notification": {
"eventTime": "2016-10-19T16:33:24.338Z",
"nsp-service:service-state-change": {
"admin-state": {
"old-value": "UP",
"new-value": "DOWN"
},
"uuid": "7095-86bc248d-f75a-438c-8de4-d1221fe8711a"
}
}
}
}
Notification for operational state change (endpoint):
{
"data": {
"ietf-restconf:notification": {
"eventTime": "2016-10-19T16:33:24.425Z",
"nsp-service:endpoint-state-change": {
"operational-state": {
"old-value": "UP",
Release 17.6
June 2017
26 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC NSD and NRC API
"new-value": "DOWN"
},
"uuid": "7107-4445bd7a-c741-4fdb-a9c5-3141b85facb4"
}
}
}
}
Notification for operational state change (service):
{
"data": {
"ietf-restconf:notification": {
"eventTime": "2016-10-19T16:33:24.448Z",
"nsp-service:service-state-change": {
"operational-state": {
"old-value": "UP",
"new-value": "DOWN"
},
"uuid": "7095-86bc248d-f75a-438c-8de4-d1221fe8711a"
}
}
}
}
Notifications for Object Life Cycle change (service):
data:{
"ietf-restconf:notification":{
"eventTime":"2017-03-21T08:56:20.549Z",
"nsp-service:object-life-cycle-change":{
"uuid":"3304-fa5c4151-f7f2-447a-8cb7-d9b347b83ada",
"life-cycle-state":{
"new-value":"WaitingForDeployment",
"old-value":"Deployed"
}
}
}
}
data:{
"ietf-restconf:notification":{
"eventTime":"2017-03-21T08:56:20.549Z",
"nsp-service:object-life-cycle-change":{
"uuid":"2632-b7d518a8-1556-4f01-961e-5a0d0a529722",
"life-cycle-reason":{
"new-value":"Waiting for underlying layer to
deploy",
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 27
NSD and NRC API NFM-P | NSD and NRC
Note: A security token is required in order to subscribe to the notification stream. See
4.2.2 “Authorization ” (p. 25) for more information about obtaining a token.
cURL, a generally-available tool for retrieving URLs, can be used to connect to the notification
stream. The following command is used to subscribe (cURL uses HTTP GET method by default):
curl -k https://<server>:8543/ean/api/v3/notifications/subscriber
-H ‘Authorization:<token>’
where
server is the IP address of your NSD and NRC server
token is a previously-obtained authorization token
Release 17.6
June 2017
28 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC NSD and NRC API
service if required followed by verifying service deployment and retrieving the OCH service
created. Also included is a modification of the ODU Optical services parameters, such as latency
and objective COST.
Service templates
Templates is another method by which an API client application can provision NSP-managed
services. They simplify the configuration of the supported NSP IP and Optical Services that can be
reused for service activation use-cases. See the NSP NSD and NRC Installation and User Guide
for more information.
Note: If a service is provisioned using a template the parameters can be overridden by GUI
and abstract API requests.
Policies
Optimization of the network can be achieved by using policies. This is done by enabling policy-
driven behavior by managing the rules that allow the NSD and NRC API to customise network
policies for routing algorithms selection and execution. The API also provides an interface to service
definitions that exposes services in an abstract, customizable way while supporting the mediation of
these definitions to the low-level network elements and resources.
The NSD and NRC API policy services allows API Clients to query, define and update the policies
for tunnel selection, traffic steering, and RD/RT range modification for L3VPN.
See the following API postman collection for sample requests to perform the following Template and
Policy provisioning examples:
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 29
NSD and NRC API NFM-P | NSD and NRC
Rd/RT Policies
• Query and Modify Route Distinguisher/Route Target range (min and max values) for L3VPN.
Note: Values should not be supplied for custom attributes that are natively-configured by the
NSP, such as the displayedName attribute. Providing values for custom attributes can cause
some API requests to fail.
Note: Custom attributes are only supported on 5620 SAM Releases 14.0 and later, including
NFM-P Release 17.3.
Release 17.6
June 2017
30 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC NSD and NRC API
See the API postman collection for sample requests that includes custom attribute.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 31
NSD and NRC API NFM-P | NSD and NRC
See the NSD and NRC API postman collection for sample requests for using Steering parameters:
Steering AS Parameters
• creates, retrieves and deletes AS Steering parameters
Openflow
• Retrieve all openflow switches then retrieve a specific openflow switch by router ID. Create a
cookie for the flow, create a flow that will redirect to a next hop, retrieve the ports and flow tables
associated with the flows, finally delete the flow.
Release 17.6
June 2017
32 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Network and service assurance
5.1 Overview
5.1.1 Purpose
This chapter contains information that a developer can use to help with the development of
applications for the following OSS domains:
• Network and service assurance
− Fault Management
− Service Supervision OAM
5.1.2 Contents
5.1 Overview 33
Network and service assurance 34
5.2 Network and service assurance 34
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 33
Network and service assurance NFM-P | NSD and NRC
Release 17.6
June 2017
34 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Network and service assurance
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 35
Network and service assurance NFM-P | NSD and NRC
• CFM loopback
• CFM two-way delay
• CFM two-way SLM
The oneTimeTest API is based on the NFM-P quick-run test functionality. See the NSP NFM-P User
Guide for information about how to configure and run ETH-OAM tests contextually. Issue the
following request to initiate the test:
POST http://<server>:8543/ServiceSupervision/rest/api/v1/oam/ethernetCfm/
services/{serviceFdn}/oneTimeTest
where server is the hostname or IP address of the NSP server that hosts the API module.
The response of the oneTimeTest request contains the test suite FDN. You can retrieve the
generated test of that test suite by issuing the following request:
GET http://<server>:8543/ServiceSupervision/rest/api/v1/oam/ethernetCfm/
testSuites/{testSuiteFdn}/testResults
where server is the hostname or IP address of the NSP server that hosts the API module.
Release 17.6
June 2017
36 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Network and service assurance
See NSP API postman collection for sample requests for performing Service Supervision OAM
functions.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 37
Network and service assurance NFM-P | NSD and NRC
Release 17.6
June 2017
38 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Network Functions Manager
6.1 Overview
6.1.1 NFM-P platform API
The Network Functions Manager - Packet, or NFM-P, provides a set of REST northbound interfaces
that allows OSS applications to retrieve, create, update, or delete information on the managed
objects in an NFM-P-managed network.
6.1.2 Prerequisites
The following are the prerequisites for using the NFM-P platform API.
• All API clients must first authenticate their client using the NSP REST Gateway; see Chapter 3,
“NSP REST API Gateway”. Once a token is returned, it is used in subsequent NFM-P API
service requests.
• You must have an understanding of the NFM-P Managed Object information model, specifically
of the format of the objects, their hierarchy and how they are identified by their fully distinguished
name (FDN). See the NSP NFM-P XML API Developer Guide and XML API Reference for more
information.
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 39
Overview NFM-P | NSD and NRC
Release 17.6
June 2017
40 3HE-11987-AAAC-TQZZA Issue 1
NFM-P | NSD and NRC Backwards compatibility
7 Backwards compatibility
7.1 Overview
7.1.1 General information
The methods of the NSP REST APIs evolve with each new release. This may result in some
methods becoming deprecated or obsolete. See the table below for more information about the API
changes introduced in this release of the NSP.
API Changes
NSD and NRC See the NSP NSD and NRC API Differences
Guide
NFM-P Redirecting from previous releases of the API
is supported
Fault Management All previous API methods are deprecated, with
the exception of cross-launch
Service Supervision OAM The api/v1/oam/testSuite/testEntities and
api/v1/oam/testResultsFile methods are
obsolete
Release 17.6
June 2017
Issue 1 3HE-11987-AAAC-TQZZA 41
Overview NFM-P | NSD and NRC
Release 17.6
June 2017
42 3HE-11987-AAAC-TQZZA Issue 1