Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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


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

Yaml


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


[
  {
    "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


  • No labels