Versions Compared

Key

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


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

Image Removed

TO DO: Update names of attributes. Decide if resourceType will be hard coded in the Swagger for this release.

Yaml

Code Block
collapsetrue
swagger: "2.0"
info:
  description: "This is the Network Discovery API."
  version: "0.0.1"
  title: "Network Discovery API"
  termsOfService: "http://onap.org"
  contact:
    email: "sharon.chisholm@amdocs.com"
host: "onap.org"
basePath: "/v1"
tags:
- name: "resource"
  description: "resource Instances"
  externalDocs:
    description: "Find out more"
    url: "http://onap.org"
schemes:
- "http"
paths:
  /prefix/network/resource:
    get:
      summary: "Get Network Information"
      description: "Retrieve information from primary data sources"
      operationId: "findbyResourceIdAndType"
      produces:
      - "application/json"
      parameters:
      - name: "resourceType"
        in: "query"
        description: "Type of resource to be discovered"
        type: "string"
      - name: resourceId
        in: "query"
        description: "Identifier of resource to be discovered"
        type: array 
        items:
            type: string
      responses:
        200:
          description: "successful operation"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/Resource"
        400:
          description: "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:
  Resource:
    type: "object"
    properties:
      id:
        type: "string"
        description: "Univseral indentifier"
      name:
        type: "string"
        description: "Service Name"       
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
      attributeList:
        type: "array"
        items:
          $ref: "#/components/schemas/attribute"  
    xml:
      name: "Resource"
components:
  schemas:
   dataQuality:
    type: "object"
    properties:
      status:
        type: "string"
        enum: [ok, error]
      errorText:
        type: "string"
    required:
      - status
    xml:
      name: "dataQuality"
   identifier:
    type: "object"
    properties:
      name:
        $ref: "#/components/schemas/fieldName"
      value:
        type: "string"
    required:
      - name
      - value
   attribute:
    type: "object"
    properties:
      name:
        $ref: "#/components/schemas/fieldName"
      value:
        type: "string"
      dataQuality:
          $ref: "#/components/schemas/dataQuality"
    required:
      - name
      - dataQuality
   fieldName:
    type: string
    enum:
       - adminState
        - ipAddress
        - hostName
        - 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"

JSON Example

Code Block
[
  {
    "id": "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"
        }
      }
    ]
  }
]

Error Reporting

...

Info

The Network Discovery microservice was first introduced in Casablanca but had no southbound integration. The Dublin release introduces the integration of Network Discovery with the Openstack API.

See Network Discovery Microservice (Dublin release)