Rest API to get ActivitySpec
Request
Request body is a JSON object (Content-Type: application/json) includes the following fields.
Field Name |
---|
id |
versionId |
Sample
Request Headers:
Connection: keep-alive
Accept: application/json
Content-Type: application/json
USER_ID: cs0008
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 10.147.97.237:8080
...
Table of Contents |
---|
Overview
Query by IDs(id & versionId), returns single activity spec with complete details
Refer API Pattern: https://projects.tmforum.org/wiki/display/API/Query+Resources+Patterns
Request
Request URI
The following attribute data will be transfer using path Parameters.
Request URI should include two parameters:
Name | Mandatory | validations |
---|---|---|
serverRoot | Y | Server base URL : hostname+port+base path |
id | Y | The id of the Activity Spec |
versionId | Y | The Activity Spec version in SDC. Two dot (“.”) separated digit blocks. value "latest" will bring the latest version Note: lower case |
Request URI - https://{serverRoot}/activityspec-api/v1.0/activity-spec/id/6744fa59c539492aaee7ca49c12bbdcf{id}/versions/4f2e8585c4d44fb2afa79f5afeb3c4bb
Response
TBD
Response headers:
HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 21 Feb 2018 08:40:43 GMT
Transfer-Encoding: chunked
Server: Jetty(9.3.6.v20151106)
{
: "name":"ActivitySpecnameGqftvKSKZm1",
: "description":"ActivitySpecdescriptionJMyvvpcKcDQXOpPJdiJO1",
: "categoryList":
: [
: : "testdataget",
: : "testdataget_1"
: ],
: "inputParameters":
: [
: : {
: : : "name":"host_testdataget",
: : : "type":"string_testdataget"
: : }
: ],
: "outputParameters":
: [
: : {
: : : "name":"status_testdataget",
: : : "type":"string_testdataget",
: : : "value":"started_testdataget"
: : }
: ],
: "status":"Draft"
}
HTTP Response Codes
...
Method - PUT
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:
N/A
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).
Name | Mandatory | Description |
---|---|---|
name | Y | Name of the Activity Spec passed as part of Request Body |
categoryList | Y | |
status | Y | Activity Spec version = Certified |
inputParameters | Y | Input Parameters to the request boday(Parameter Name as Key and Parameter value as value) |
outputParamters | N/A |
Response Code
Response Code | Service Exception | Reason /Description |
---|---|---|
200 | OK | |
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: |
403 | POL5003 | ECOMP component is not authorized Actually for this policy following error description is implemented: |
404 | SVC4063 | Error: Requested '%1' resource was not found. |
404 | SVC4505 | activity spec was not found |
405 | POL4050 | Method Not Allowed : Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) |
500 | POL5000 | The GET request failed either due to internal SDC problem. The component should continue the attempts to get the needed information. |
Sunny day Scenario
- User successfully sends Get Activity Spec request with all mandatory parameters and system successfully returned the list of Activity Spec
Rainy day Scenario
- User sends Get Activity Spec request without mandatory parameter (id, versionId) and the system should return an error
- User sends Get Activity Spec request with mandatory parameter (id, versionId) which doesn't exist in the system and system should return an error