Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Rest API to search ActivitySpec

Request

Request body is a JSON object (Content-Type: application/json) includes the following fields.

Field Name
status

Sample

Request Headers:

Connection: keep-alive

Accept: application/json

Content-Type: application/json

USER_ID: cs0008

User-Agent: Jakarta Commons-HttpClient/3.1

Host: 197.172.97.237:8080

GET http://197.172.97.237:8080

Table of Contents

Overview

Rest APIs will retrieve the activity Specs

Returns list of activity spec with the specified status(eg: Certified)

Each activity spec in the list should be populated with id, name, categoryList, status 

Refer API Pattern: https://projects.tmforum.org/wiki/display/API/Query+Resources+Patterns

Below two capabilities are OOS

  • The list of activity spec should be grouped by Category List and sort by Activity Spec Name because there is no platform support for the same
  • search by name with contains (case insensitive ) because new platform capability needed to support

Request

Request URI:

Name

Mandatory

validations 

serverRootYServer base URL :  hostname+port+base path

Request URI - https://{serverRoot}/activityspec-api/v1.0/activity-spec?statusFilter=Certified

Response

A detailed list of the activities should be returned.

...

Sample

Response headers: 

HTTP/1.1 200 OK

Content-Type: application/json

Date: Wed, 21 Feb 2018 08:32:19 GMT

Transfer-Encoding: chunked

Server: Jetty(9.3.6.v20151106)

{

:   "listCount":9,

:   "results":

:   [

:   :   {

:   :   :   "id":"e2df9a7ea08a4c529653d4e73b8e3aba",

:   :   :   "name":"ActivitySpecnamesnXCVJWwMM1",

:   :   :   "categoryList":

:   :   :   [

:   :   :   :   "appserversearch"

:   :   :   ],

:   :   :   "status":"Certified"

:   :   },

:   :   {

:   :   :   "id":"1ed84afaba234466b26875997d65df73",

:   :   :   "name":"ActivitySpecnamejMWSKFRUkk1",

:   :   :   "categoryList":

:   :   :   [

:   :   :   :   "appserversearch"

:   :   :   ],

:   :   :   "status":"Certified"

:   :   }

HTTP Response Codes

...

Method - GET

Request Header

Header Name

Mandatory?

Description

X-ECOMP-InstanceID

Y

For auditing purpose each component calling the  SDC API should identify itself by sending its identity (  e.g. Instar name...) in  "X-ECOMP-InstanceID" header.

If this header with non-null value is not supplied the HTTP Request will be rejected with '400 Bad Syntax’ response code.

Ex. onap-test

Accept

N

Determines the format of the body of the response. Valid values are :  “application/json”

Authorization

Y

The username and password are formed into one string as “username: password”. 

This string is then Base64 encoded to produce the encoded credential which is communicated in the header after the string “Authorization: Basic “.  

If the Authorization header is missing, then an HTTP “401 Unauthorized” with ‘WWW-Authenticate’ header specifying the type of required client authentication and realm token will be returned.

“401” response should trigger the repeated  HTTP request sending with  “Authorization” header containing the client ’s credentials.

 If  “Authorization”  header is received, but  the client‘s authentication fails  (  due to  either  unknown “username”  or invalid “password” )  the  “403 Forbidden”  response  code  will be  returned

Request Body:

empty 

Response

Response Headers

Header Name

Mandatory

Description

Content-Type

Y

Determines the format of the response body.

Valid value is :  “application/json”

Content-Length

Y

Length of  the response body

Response Body:

Response body is sent as JSON object (Content-Type: application/json).

NameMandatory Description
idYGlobal Activity Spec Identifier: id generated by SDC per each Activity Spec. This activitySpecId stays constant along all the Activity Spec's versions 
nameYName of the Activity Spec passed as part of Request Body
categoryListY
status


HTTP Response Code 

Response code

Service/Policy

Exception

Reason /Description

200

N/A

ECOMP component is authenticated and list of Catalog Assets Metadata is returned.

400 

POL5001

Missing  “X-ECOMP-InstanceID”  HTTP header

401 

POL5002

ECOMP component should authenticate itself and to re-send again HTTP request with its credentials for Basic Authentication

Actually for this policy following error description is implemented:

Error: Authentication is required to use the API.

403

POL5003

ECOMP component is not authorized

Actually for this policy following error description is implemented:

Error: Not authorized to use the API

405

POL4050

Method  NotAllowed  :  Invalid HTTP method type used ( PUT,DELETE,POST will be rejected)

500 

POL5000

The GET request failed either due to internal SDC problem. ECOMP Component should continue the attempts to get the needed information.

Sunny day Scenario

  • User successfully sends Search Activity Spec request with filtering as Certified and systems returns all the Activity Specs in Certified Status
  • User successfully sends Search Activity Spec request with filtering as valid status(Certified, draft, deprecated, deleted) and systems returns the Activity Specs(if available) as per the filter
  • Users send Search Activity Spec request with an invalid status which is not in the system and the system returns the empty list