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 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 service $ref: "#/definitions/Servicemodel 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"
      flow: "implicit" 400:
   scopes:       writedescription:pets: "modify petsMissing  manadatory field in your account" the request or HTTP header."
        404:
         read:pets: "read your pets"
  api_key:
    type: "apiKey"
    name: "api_key"
    in: "header"
definitions:
  Service:
    type: "object"
    properties:
      uuid:  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",
                    "value": "string",
                    "dataQuality": {
                      "status": "ok",
                      "errorText": "string"
                    }
                  }
                ],
                "PServerList": [
                  {
                    "uuid": "string",
                    "invariantUUID": "string",
                    type"name": "string"
     ,
  description: "Univseral indentifier"       invariantUUID:         type: "stringdataQuality": {
     name:         type: "string"         description"status": "Service Nameok",
              attributeList:         type"errorText": "arraystring"
        items:            $ref: "#/components/schemas/attribute"},
          vfList:         type: "arrayattributeList": [
        items:            $ref: "#/definitions/VF" {
             dataQuality:           $ref"name": "#/components/schemas/dataQuality" 
    xml:
      name: "Service"
  VF:
    type: "object"adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
        properties:       uuid:         type"value": "string",
      invariantUUID:          type: "string"       name:"dataQuality": {
         type: "string"       nfNamingCode:         type"status": "string"
    ok",
 type:         type: "string"       attributeList:         type"errorText": "arraystring"
        items:              $ref: "#/components/schemas/attribute"  }
        vfModuleList:         type: "array"    }
    items:           $ref: "#/definitions/VFModule"    ]
  vnfcList:         type: "array"      }
  items:           $ref: "#/definitions/VNFC"  ],
    dataQuality:           $ref: "#/components/schemas/dataQuality"
    xml:IInterfaceList": [
        name: "VF"   VFModule:     type: "object"{
    properties:       uuid:         type"uuid": "string",
        invariantUUID:            type"invariantUUID": "string",
           name:         type"name": "string"  ,
            nfNamingCode:         type: "stringdataQuality": {
     minInstances:         type: "integer"         format"status": "int32ok",
      maxInstances:         type: "integer"         format"errorText": "int32string"
      attributeList:         type: "array"    },
    items:           $ref: "#/components/schemas/attribute"    "attributeList": [
    dataQuality:           $ref: "#/components/schemas/dataQuality"     xml: {
     name: "VFModule"   VNFC:     type: "object"     properties:    "name": "adminState - uuid:ipAddress - hostName - lockedBoolean - macAddress - networkType type: "string"
      invariantUUID:
- networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
       type: "string"       name:         type"value": "string",
      nfNamingCode:          type: "string"       attributeList"dataQuality": {
       type: "array"         items:           $ref: "#/components/schemas/attribute"     
   status": "ok",
  dataQuality:           $ref: "#/components/schemas/dataQuality"     xml:       name"errorText": "VNFCstring"
components:   schemas:    dataQuality:     type: "object"     properties:      }
status:         type: "string"         enum: [ok, error] }
     errorText:         type: "string"     required:],
      - status     xml:       name: "dataQualityPortList": [
   attribute:     type: "object"     properties:       name: {
       type: "string"       type:         type"uuid": "string",
       value:         type: "string"       dataQuality:"invariantUUID": "string",
          $ref: "#/components/schemas/dataQuality"     required:       - "name
  ": "string",
   - dataQuality     xml:       name: "dataQuality"         ApiResponse"dataQuality": {
   type: "object"      properties:       code:         type"status": "integerok",
        format:  "int32"       type:         type"errorText": "string"
                message:        },
type: "string" externalDocs:   description: "Find out more about Swagger"   url: "http://swagger.io"

Example JSON

Note the top level objects is a service

Code Block
[      {     "uuidattributeList": "string", [
      "invariantUUID": "string",     "name": "string",     "attributeList": [       {
                            "name": "string",adminState - ipAddress - hostName - lockedBoolean - macAddress "type": "string",
        "value": "string",
  - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
     "dataQuality": {           "status": "ok",           "errorTextvalue": "string",
           }       }     ],     "vfListdataQuality": [ {
           {         "uuid": "string",         "invariantUUIDstatus": "stringok",
        "name": "string",            "nfNamingCode": "string",         "typeerrorText": "string",
        "attributeList": [           {         }
   "name": "string",             "type": "string",         }
   "value": "string",             "dataQuality": {      ]
        "status": "ok",             }
 "errorText": "string"             }     ]
     }         ],    }
    "vfModuleList": [           {]
            "uuid": "string", }
           "invariantUUID": "string" ],
            "namenetworkList": "string", [
              {
  "nfNamingCode": "string",             "minInstancesuuid": 0,"string",
                "maxInstancesinvariantUUID": 0,"string",
                "attributeListname": [ "string",
                "dataQuality": {
                  "namestatus": "stringok",
                  "typeerrorText": "string",

               "value": "string" },
                "dataQualityattributeList": {[
                  {
"status": "ok",                   "errorTextname": "string"
                }adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean",
                }    "value": "string",
       ],             "dataQuality": {
                      "status": "ok",
                      "errorText": "string"
  
         }           }
        ],         "vnfcList": [}
          {      ]
      "uuid": "string",       }
     "invariantUUID": "string",      ]
      "name": "string",   }
         "nfNamingCode": "string",
 ],
          "attributeListvnfcList": [

             {
 
              "nameuuid": "string",

               "typeinvariantUUID": "string",
   
            "valuename": "string",
 ,
              "dataQuality": {
  
               "status": "ok",
   
              "errorText": "string"
            },
   }         "attributeList": [
     }         {
   ],             "dataQuality": {name": "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