Versions Compared

Key

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

The following is an attempt to clarify the data dictionary API that will be used within API to augment the existing validation provided by rules engine + context aggregegated content.  This clarifies a subset of the total functionality potentially supported by the data dictionary.  The original definition (also potential not complete) is defined in Integration with Data Dictionary.

This is work in progress

Image Removed

YAML

Known issues

  1.   the instance should actually look more like

{

  "instance": [

    {

      "flavor": "vanilla",

    }

  ]

}

...

Inputs

While instance can in theory take a number of forms, in POMBA Casablanca, we shall just support a single name value pair, in the format listed below.

Image Added

Outputs

Image Added

YAML

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

Known issues

  1. Error codes and messages need updating(missing schema, undefined schema, instance validation errors, etc)


Code Block
collapsetrue
swagger: "2.0"
info:
  description: "This is the Data Dictionary API"
  version: "0.0.1"
  title: "Data Dictionary 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:
  /commonModelElements/{commonElementIdcommonModelElementId}/validateInstance:
    post:
      summary: "validate against data dictionary"
      description: "Data Dictionary validate instance request"
      operationId: ""
      produces:
      - "application/json"
      parameters:
      - name: "X-ONAP-RequestID"
        in: "header"
        description: "Transaction identifier to enable end to end tracing"
        type: "string"
      - name: "X-FromAppId"
        in: "header"
        description: "Client identifier - MSO, VID, etc"
        type: "string"
      - name: "commonElementIdcommonModelElementId"
        in: "path"
        required: true
        description: "The component or resource type whose attribute we wish to validate"
        type: "string"
      - in: "body"
        name: "body"
        description: "Pet object that needs to be added to the store"
        required: true
        schema:
          $ref: "#/definitions/Instance"
      responses:
        204:
          description: "successful operation"
        400:
          description: "Missing  manadatory field in the request or HTTP header."
          schema:
            type: "array"
            items:
              type: "string"
              example: "instance validation errors"
        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 GETPOST 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:
  Instance:
    type: "object"
    properties:
      instance:
        type: "array"
        items:
          type: "stringobject"
          example: '
            flavour:  "vanilla'"
components:
  schemas:
  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"

...