The following is a work in progress. It does not show the following
- Error Handling
- Returned attributes
TO DO
- Add additional resources from the POMBA Context Builders and Data Sources 'yellow' model
Swagger YAML
Created using https://swagger.io/swagger-editor/
Code Block | ||
---|---|---|
| ||
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 model metadata" $reftype: "#/definitions/Service" string" responses: 400 200: description: "Invalidsuccessful status valueoperation" security: schema: - petstore_auth: -type: "write:petsarray" - "read:pets" items: securityDefinitions: petstore_auth: type: "oauth2" authorizationUrl$ref: "http:#//petstore.swagger.io/oauth/dialogdefinitions/Service" flow: "implicit" 400: scopes: write:petsdescription: "modify petsMissing manadatory field in yourthe account"request or HTTP header." read:pets: "read your pets" api_key404: type: "apiKey" namedescription: "api_key" in: "header" definitions: Service:Error: Requested '%1' resource was not found." type405: "object" properties: description: "Method uuid: Not Allowed : Invalid HTTP method type: "string"used ( PUT,DELETE,POST will be rejected)" description: "Univseral indentifier" 500: invariantUUID: typedescription: "string"The GET request failed either due to name:internal Context Builder problem." typesecurity: "string" - description: "Service Name"petstore_auth: attributeList:- "write:pets" type:- "arrayread:pets" securityDefinitions: itemspetstore_auth: type: "oauth2" $refauthorizationUrl: "#/components/schemas/attributehttp://petstore.swagger.io/oauth/dialog" flow: "implicit" vfList scopes: write:pets: "modify type: "array" pets in your account" itemsread:pets: "read your pets" api_key: $reftype: "#/definitions/VFapiKey" name: "api_key" in: "header" definitions: dataQualityService: type: "object" $refproperties: "#/components/schemas/dataQuality" xmluuid: name type: "Servicestring" VF: typedescription: "objectUnivseral indentifier" properties: uuidinvariantUUID: type: "string" invariantUUIDname: type: "string" name: typedescription: "stringService Name" nfNamingCode: type: "string"dataQuality: type: type$ref: "string#/components/schemas/dataQuality" attributeList: type: "array" items: $ref: "#/components/schemas/attribute" vfModuleListvfList: type: "array" items: $ref: "#/definitions/VFModuleVNF" vnfcList: typexml: "array" name: "Service" items VNF: type: "object" $ref: "#/definitions/VNFC"properties: dataQualityuuid: $reftype: "#/components/schemas/dataQuality"string" xmlinvariantUUID: name type: "VFstring" VFModule: name: type: "object" propertiestype: "string" uuidtype: type: "string" invariantUUIDdataQuality: type$ref: "string#/components/schemas/dataQuality" nameattributeList: type: "stringarray" items: nfNamingCode: type$ref: "string" #/components/schemas/attribute" minInstances: type: "integer"vfModuleList: formattype: "int32array" maxInstances: items: type: "integer" format$ref: "int32#/definitions/VFModule" attributeListvnfcList: type: "array" items: $ref: "#/componentsdefinitions/schemas/attributeVNFC" xml: dataQuality: name: "VF" VFModule: $reftype: "#/components/schemas/dataQualityobject" xmlproperties: nameuuid: "VFModule" VNFC: type: "objectstring" properties: uuidinvariantUUID: type: "string" invariantUUIDname: type: "string" name: minInstances: type: "string" nfNamingCodetype: "integer" typeformat: "stringint32" attributeListmaxInstances: type: "array" integer" format: "int32" itemsdataQuality: $ref: "#/components/schemas/attributedataQuality" attributeList: dataQuality: type: "array" items: $ref: "#/components/schemas/dataQualityattribute" xml vmList: nametype: "VNFCarray" components: schemas: dataQualityitems: type: "object" properties:$ref: "#/definitions/VM" statusnetworkList: type: "stringarray" enumitems: [ok, error] errorText: $ref: "#/definitions/Network" typexml: "string" required: - status xml: name: "dataQualityVFModule" attributeVNFC: type: "object" properties: nameuuid: type: "string" typeinvariantUUID: type: "string" valuename: type: "string" dataQuality: $ref: "#/components/schemas/dataQuality" required attributeList: - name type: "array" - dataQuality items: xml: name$ref: "dataQuality"#/components/schemas/attribute" ApiResponsexml: typename: "objectVNFC" propertiesVM: type: "object" code: properties: typeuuid: "integer" formattype: "int32string" typeinvariantUUID: type: "string" messagename: type: "string" externalDocs: descriptionnfNamingCode: "Find out more about Swagger" urltype: "http://swagger.io" |
Example JSON
Note the top level objects is a service
Code Block |
---|
[string" { dataQuality: "uuid": "string", "invariantUUID": "string", $ref: "#/components/schemas/dataQuality" "name": "string",attributeList: type: "attributeListarray": [ items: { "name"$ref: "string",#/components/schemas/attribute" PServerList: "type": "string", "value": "string", "dataQuality": {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
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.
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", "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" } } ] } ], "IInterfaceList": [ { "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" } } ], "PortList": [ { "uuid": "string", "invariantUUID": "string", "name": "string", "dataQuality": { "status": "ok", "errorText": "string" }, "attributeList": [ { "name": "adminState - ipAddress - hostName - lockedBoolean - macAddress - networkType - networkTechnology - physicalNetworkName - sharedNetworkBoolean - networkRole - routerExternalBoolean", "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" } ] } ] |