Versions Compared

Key

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

The following is a work in progress. TO DO

Swagger YAML

Created using https://swagger.io/swagger-editor/

Image RemovedImage Added

Code Block
collapsetrue
swagger: "2.0"
info:
  description: "This is the POMBA Context Builder API. It must be supported by all Context Builders"
  version: "0.0.1"
  title: "POMBA Context Builder"
  termsOfService: "http://onap.org"
  contact:
    email: "sharon.chisholm@amdocs.com"
host: "onap.org"
basePath: "/v1"
tags:
- name: "service"
  description: "Service Instances"
  externalDocs:
    description: "Find out more"
    url: "http://onap.org"
schemes:
- "http"
paths:
  /service/context:
    get:
      tags:
      - "pet"
      summary: "Get service instance"
      description: "Retrieve information about a particular service instance using information avaialble to this specific context builder."
      operationId: "findServiceByInstance"
      produces:
      - "application/json"
      parameters:
      - name: "ServiceInstanceId"
        in: "query"
        description: "Service Instance Id of service you are interested in"
        requiredtype: true"string"
      -  typename: "stringmodelVersionId"
      responses:         200in:  "query"
        description: "successfulModel operation"UUID as published in service model metadata"
    schema:    type: "string"
      - typename: "arraymodelInvariantId"
        in: "query"
  items:      description:  "SDC generated invariant id as published in $ref: "#/definitions/Serviceservice model metadata"
        400:type: "string"
      responses:
        description200:
 "Invalid status value"       securitydescription: "successful operation"
    - petstore_auth:     schema:
   - "write:pets"        type: - "read:petsarray"
   securityDefinitions:    petstore_auth:     typeitems:
"oauth2"      authorizationUrl        $ref: "http:#//petstore.swagger.io/oauth/dialog"definitions/Service"
        400:
      flow    description: "implicit"
    scopes:Missing  manadatory field in the request or HTTP header."
        404:
          description: "Error: Requested '%1' resource was not found."
        405:
          description: "Method  Not Allowed  :  Invalid HTTP method type used ( PUT,DELETE,POST will be rejected)"
        500:
          description: "The GET request failed either due to internal Context Builder problem."
      security:
      - petstore_auth:
        - "write:pets"
        - "read:pets"
  
securityDefinitions:
  petstore_auth:
    type: "oauth2"
    authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
    flow: "implicit"
    scopes:
      write:pets: "modify pets in your account"
      read:pets: "read your pets"
  api_key:
    type: "apiKey"
    name: "api_key"
    in: "header"
definitions:
  Service:
    type: "object"
    properties:
      uuid:
        type: "string"
        description: "Univseral indentifier"
      invariantUUID:
        type: "string"
      name:
        type: "string"
        description: "Service Name"        
      dataQuality:
          $ref: "#/components/schemas/dataQuality" 
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"   
      vfList:
        type: "array"
        items:
          $ref: "#/definitions/VNF"        

    xml:
      name: "Service"
  VNF:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      type:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"   
      vfModuleList:
        type: "array"
        items:
          $ref: "#/definitions/VFModule"
      vnfcList:
        type: "array"
        items:
          $ref: "#/definitions/VNFC"
    xml:
      name: "VF"
  VFModule:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"        
      minInstances:
        type: "integer"
        format: "int32"
      maxInstances:
        type: "integer"
        format: "int32"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"   
      vmList:
        type: "array"
        items:
          $ref: "#/definitions/VM"
      networkList:
        type: "array"
        items:
          $ref: "#/definitions/Network"
    xml:
      name: "VFModule"
  VNFC:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"     
    xml:
      name: "VNFC"
  VM:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      nfNamingCode:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"     
      PServerList:
        type: "array"
        items:
          $ref: "#/definitions/PServer"
      IInterfaceList:
        type: "array"
        items:
          $ref: "#/definitions/IInterface"
    xml:
      name: "VM"
  Network:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"     
    xml:
      name: "Network"      
  IInterface:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"     
      PortList:
        type: "array"
        items:
          $ref: "#/definitions/Port"
    xml:
      name: "IInterface"   
  PServer:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"     
    xml:
      name: "PServer"            
  Port:
    type: "object"
    properties:
      uuid:
        type: "string"
      invariantUUID:
        type: "string"
      name:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"     
    xml:
      name: "Port"      
components:
  schemas:
   dataQuality:
    type: "object"
    properties:
      status:
        type: "string"
        enum: [ok, error]
      errorText:
        type: "string"
    required:
      - status
    xml:
      name: "dataQuality"
   attribute:
    type: "object"
    properties:
      name:
        $ref: "#/components/schemas/fieldName"
      value:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
    required:
      - name
      - dataQuality
    xml:
      name: "dataQuality"  
   fieldName:
    type: string
    enum:
       - adminState
        - ipAddress
        - hostName
        - imageId
        - lockedBoolean
        - macAddress
        - networkType
        - networkTechnology
        - physicalNetworkName
        - sharedNetworkBoolean
        - networkRole
        - routerExternalBoolean
  ApiResponse:
    type: "object"
    properties:
      code:
        type: "integer"
        format: "int32"
      type:
        type: "string"
      message:
        type: "string"
externalDocs:
  description: "Find out more about Swagger"
  url: "http://swagger.io"

Inputs

Header

Image Added

Query Parameters

Note that each instantiation of this API within a particular context builder may define each of these parameters as either mandatory, optional or not supported.

Image Added

Example JSON Response

Note the top level objects is a service

Code Block
[
  {
    "uuid": "string",
    "invariantUUID": "string",
    "name": "string",
    "dataQuality": {
      "status": "ok",
      "errorText": "string"
    },
    "attributeList": [
      {
        "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
        "value": "string",
        "dataQuality": {
          "status": "ok",
          "errorText": "string"
        }
      }
    ],
    "vfList": [
      {
        "uuid": "string",
        "invariantUUID": "string",
        "name": "string",
        "type": "string",
        "dataQuality": {
          "status": "ok",
          "errorText": "string"
        },
        "attributeList": [
          {
            "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
            "value": "string",
            "dataQuality": {
              "status": "ok",
              "errorText": "string"
            }
          }
        ],
        "vfModuleList": [
          {
            "uuid": "string",
            "invariantUUID": "string",
            "name": "string",
            "minInstances": 0,
            "maxInstances": 0,
            "dataQuality": {
              "status": "ok",
              "errorText": "string"
            },
            "attributeList": [
              {
                "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
                "value": "string",
                "dataQuality": {
                  "status": "ok",
                  "errorText": "string"
                }
              }
            ],
            "vmList": [
              {
                "uuid": "string",
                "invariantUUID": "string",
                "name": "string",
                "nfNamingCode": "string",
                "dataQuality": {
                  "status": "ok",
                  "errorText": "string"
                },
                "attributeList": [
                  {
                    "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
                    write"value":pets: "modifystring",
 pets in your account"       read:pets: "read your pets"   api_key:   "dataQuality": {
type: "apiKey"     name: "api_key"     in: "header" definitions:   Service:     type"status": "objectok",
      properties:       uuid:         type"errorText": "string"
     "
  description: "Univseral indentifier"       invariantUUID:         type:}
"string"       name:         type: "string" }
       description: "Service Name"       ],
       attributeList:         type"PServerList": "array"[
        items:          {
$ref: "#/components/schemas/attribute"          vfList:         type"uuid": "arraystring",
        items:            $ref"invariantUUID": "#/definitions/VF"    string",
          dataQuality:           $ref"name": "#/components/schemas/dataQuality"string",
     xml:        name: "Service"   VF:   "dataQuality": {
type: "object"     properties:       uuid:         type"status": "stringok",
      invariantUUID:         type: "string"       name"errorText": "string"
       type: "string"       nfNamingCode:     },
   type: "string"       type:         type: "stringattributeList": [
     attributeList:          type: "array"      {
  items:           $ref: "#/components/schemas/attribute"          vfModuleList"name": "adminState - ipAddress - hostName - lockedBoolean - type: "array"
        items:
 macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
        $ref: "#/definitions/VFModule"       vnfcList:         type"value": "arraystring"
,
       items:           $ref: "#/definitions/VNFC"       "dataQuality": {
         $ref: "#/components/schemas/dataQuality"     xml:       name: "VF"   VFModule"status": "ok",
   type:  "object"     properties:       uuid:         type"errorText": "string"
   
  invariantUUID:         type: "string"       name:         type: "string"}
               nfNamingCode:       }
 type: "string"       minInstances:         type: "integer" ]
       format: "int32"       maxInstances:   }
     type: "integer"         format: "int32" ],
      attributeList:         type: "arrayIInterfaceList": [
       items:           $ref: "#/components/schemas/attribute"{
          dataQuality:           $ref"uuid": "#/components/schemas/dataQuality"string",
    xml:       name: "VFModule"   VNFC:     type"invariantUUID": "objectstring",
    properties:       uuid:         type"name": "string",
      invariantUUID:             type: "string"dataQuality": {
             name:         type"status": "stringok",
      nfNamingCode:         type: "string"       attributeList"errorText": "string"
       type: "array"         items:   },
       $ref: "#/components/schemas/attribute"            dataQuality"attributeList": [
         $ref: "#/components/schemas/dataQuality"           xml:  {
    name: "VNFC" components:   schemas:    dataQuality:     type: "object"     properties:
      status:
        type: "string"
 "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
      enum: [ok, error]       errorText:         type"value": "string",
    required:       - status     xml:       name: "dataQuality": {
  attribute:
    type: "object"     properties:       name:         $ref"status": "#/components/schemas/fieldName"ok",
      type:         type: "string"       value:         type"errorText": "string"
      dataQuality:           $ref: "#/components/schemas/dataQuality"     required:   }
   - name       - dataQuality     xml:     }
 name: "dataQuality"      fieldName:     type: string     enum: ],
      - adminState         - ipAddress   "PortList": [
    - hostName         - lockedBoolean       {
 - macAddress         - networkType         - physicalNetworkName  "uuid": "string",
     - sharedNetworkBoolean         - routerExternalBoolean   ApiResponse:     type"invariantUUID": "objectstring",
     properties:          code:         type"name": "integerstring"
,
       format: "int32"       type:         type: "stringdataQuality": {
     message:         type: "string" externalDocs:   description: "Find out more about Swagger"   url"status": "http://swagger.io"

Example JSON

Note the top level objects is a service

Code Block
[ok",
        {     "uuid": "string",     "invariantUUID": "string",       "nameerrorText": "string",
      "attributeList": [       {         "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - physicalNetworkName - sharedNetworkBoolean - routerExternalBoolean", },
                        "typeattributeList": "string", [
               "value": "string",         "dataQuality": {
             "status": "ok",               "errorTextname": "string"adminState - ipAddress - hostName - lockedBoolean - macAddress }- networkType - networkTechnology - physicalNetworkName - }sharedNetworkBoolean - networkRole -  ]routerExternalBoolean",
    "vfList": [       {         "uuid": "string",         "invariantUUIDvalue": "string",
        "name": "string",         "nfNamingCode": "string",         "typedataQuality": "string",
  {
     "attributeList": [           {             "namestatus": "adminStateok",
  - ipAddress - hostName - lockedBoolean - macAddress - networkType - physicalNetworkName - sharedNetworkBoolean - routerExternalBoolean",             "typeerrorText": "string",
                            }
   "value": "string",             "dataQuality": {        }
      "status": "ok",               "errorText": "string" ]
           }           }
        ],         "vfModuleList": [  ]
        {          }
  "uuid": "string",             "invariantUUID": "string",]
             "name": "string", }
            "nfNamingCode": "string"],
            "minInstancesnetworkList": 0, [
              {
  "maxInstances": 0,             "attributeListuuid": [ "string",
                  {"invariantUUID": "string",
                "name": "adminStatestring",
 - ipAddress - hostName - lockedBoolean - macAddress - networkType - physicalNetworkName - sharedNetworkBoolean - routerExternalBoolean","dataQuality": {
                  "typestatus": "stringok",
                  "valueerrorText": "string",
                "dataQuality": {},
                "attributeList": [
  "status": "ok",               {
   "errorText": "string"                 }
              }
    "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
       ],             "dataQualityvalue": {"string",
              "status": "ok",     "dataQuality": {
        "errorText": "string"             }
    "status": "ok",
     }         ],         "vnfcListerrorText": ["string"
          {          }
  "uuid": "string",               "invariantUUID": "string", }
            "name": "string",   ]
         "nfNamingCode": "string",    }
        "attributeList": [   ]
          }
{        ],
        "namevnfcList": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - physicalNetworkName - sharedNetworkBoolean - routerExternalBoolean",
   [
          {
            "uuid": "string",
            "typeinvariantUUID": "string",
   
            "valuename": "string",

               "dataQuality": {
                  "status": "ok",
                  "errorText": "string"
            },
   }         "attributeList": [
    }          {
   ],             "dataQualityname": { "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
                "statusvalue": "okstring",
                "errorTextdataQuality": "string"{
            }      "status": "ok",
   }         ],         "dataQualityerrorText": {"string"
          "status": "ok",     }
     "errorText": "string"        }
}       }     ],
    "dataQuality": {     }
 "status": "ok",      ]
"errorText": "string"     }
    ]
  }
]


Error

Image Added