openapi: 3.0.0
info:
  version: "v1"
  title: SODA Infrastructure Management API
  description: SODA Infrastructure Management API for resource monitoring, alerting and management across multiple, heterogeneous storage backend. Currently supporting storage monitoring and alerting.
  contact:
    name: SODA Support
    url: 'https://sodafoundation.io/slack'
    email: support@sodafoundation.io
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
  - name: Storages
paths:
  /v1/storages:
    get:
      tags:
        - Storages
      description: List all registered storage back ends
      operationId: GetStorageBackends
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description:  Comma separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: vendor
          in: query
          description: vendor(manufacturer) of the storage.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: model
          in: query
          description: model of the storage
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: name
          in: query
          description: The storage name.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: serial_number
          in: query
          description: The storage serial number.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: status
          in: query
          description: The storage status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - normal
              - offline
              - abnormal
      responses:
        '200':
          description: Storage backend list available.
          content:
            application/json:
              schema:
                type: object
                required:
                      - storages
                additionalProperties: true
                properties:
                  storages:
                    type: array
                    title: The storages schema
                    items:
                      $ref: '#/components/schemas/StorageBackendResponse'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
    post:
      tags:
        - Storages
      description: Register a storage device for management.
      operationId: addStorageBackends
      requestBody:
        description: Inventory item to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StorageBackendRegistry'
      responses:
        '200':
          description: 'Accepted, items added to the infrastructure management'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageBackendResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '409':
          description: An item already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{storage_id}':
    get:
      tags:
        - Storages
      description: Get details of a storage device
      operationId: GetStorageBackendbyID
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend .
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: Storage backend list available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageBackendResponse'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
    delete:
      tags:
        - Storages
      description: Unregister an already registered storage backend
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend .
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '202':
          description: Accepted
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/storages/sync:
    post:
      tags:
        - Storages
      description: Collect all resources from all registered  backend and synchronize with DB.
      operationId: syncStorageBackends
      responses:
        '202':
          description: 'Accepted, '
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '409':
          description: An item already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{storage_id}/sync':
    post:
      tags:
        - Storages
      description: Collect all resources from specified storage backend and synchronize with DB
      operationId: syncStorage
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend .
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '202':
          description: 'Accepted, '
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '409':
          description: An item already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{storage_id}/access-info':
    get:
      tags:
        - Storages
      description: Get access info of a registered storage backend
      operationId: GettorageAccessInfobyID
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: Storage Access-info  available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageAccessInfoResponse'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
    put:
      tags:
        - Storages
      description: Update a registered storage system access information in Infrastructure management DB.
      operationId: updateStorageAccessInfobyID
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StorageBackendRegistryUpdate'
      responses:
        '200':
          description: Storage backend  available with updated access information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageAccessInfoResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/storage-pools:
    get:
      tags:
        - Storage Pools
      description: List all storage pools.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The pool name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a storage pool.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_storage_pool_id
          in: query
          description: Actual ID of the storage pool in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: status
          in: query
          description: The pool status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - normal
              - offline
              - abnormal
      responses:
        '200':
          description: List storage pools query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - storage_pools
                additionalProperties: true
                properties:
                  storage_pools:
                    type: array
                    title: the storage pools schema
                    items:
                      $ref: '#/components/schemas/StoragePoolSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storage-pools/{id}':
    get:
      tags:
        - Storage Pools
      description: Get storage pool detail by pool ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a storage pool.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoragePoolSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/controllers:
    get:
      tags:
        - Controllers
      description: List all controllers.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The controller name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a controller.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_controller_id
          in: query
          description: Actual ID of the controller in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: status
          in: query
          description: The controller status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - normal
              - offline
              - unknown
      responses:
        '200':
          description: List controllers query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - controllers
                additionalProperties: true
                properties:
                  controllers:
                    type: array
                    title: the controllers schema
                    items:
                      $ref: '#/components/schemas/ControllerSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/controllers/{id}':
    get:
      tags:
        - Controllers
      description: Get controller detail by controller ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a controller.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ControllerSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/ports:
    get:
      tags:
        - Ports
      description: List all ports.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The port name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a port.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_port_id
          in: query
          description: Actual ID of the port in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: connection_status
          in: query
          description: The port connection_status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - connected
              - disconnected
              - unknown
        - name: health_status
          in: query
          description: The port health_status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - normal
              - abnormal
              - unknown
      responses:
        '200':
          description: List port query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - ports
                additionalProperties: true
                properties:
                  ports:
                    type: array
                    title: the port schema
                    items:
                      $ref: '#/components/schemas/PortSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/ports/{id}':
    get:
      tags:
        - Ports
      description: Get port detail by port ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a port.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/disks':
    get:
      tags:
        - Disks
      description: List all disks.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The disk name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a disk.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_disk_id
          in: query
          description: Actual ID of the port in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_disk_group_id
          in: query
          description: Database ID created for a disk group.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: status
          in: query
          description: The disk status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - normal
              - offline
              - abnormal
      responses:
        '200':
          description: List port query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - ports
                additionalProperties: true
                properties:
                  ports:
                    type: array
                    title: the disk schema
                    items:
                      $ref: '#/components/schemas/DiskSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/disks/{id}':
      get:
        tags:
          - Disks
        description: Get disk detail by disk ID.
        parameters:
          - name: id
            in: path
            description: Database ID created for a disk.
            required: true
            style: simple
            explode: false
            schema:
              type: string
        responses:
          '200':
            description: OK
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/DiskSpec'
          '401':
            description: NotAuthorized
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/ErrorSpec'
          '403':
            description: Forbidden
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/ErrorSpec'
          '404':
            description: The resource does not exist
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/ErrorSpec'
          '500':
            description: An unexpected error occurred.
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/ErrorSpec'
  /v1/volumes:
    get:
      tags:
        - Volumes
      description: List all storage volumes.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The volume name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_storage_pool_id
          in: query
          description: Actual ID of the storage pool in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_volume_id
          in: query
          description: Actual ID created for the volume in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: status
          in: query
          description: The volume status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - noraml
              - offline
              - abnormal
      responses:
        '200':
          description: List volumes operation was successful
          content:
            application/json:
              schema:
                type: object
                required:
                  - volumes
                additionalProperties: true
                properties:
                  volumes:
                    type: array
                    items:
                      $ref: '#/components/schemas/VolumeRespSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/volumes/{id}':
    get:
      tags:
        - Volumes
      description: Get storage volume detail by volume ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a volume.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VolumeRespSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/filesystems:
    get:
      tags:
        - Filesystems
      description: List all filesystems.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The filesystem name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a filesystem.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_filesystem_id
          in: query
          description: Actual ID of the filesystem in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_pool_id
          in: query
          description: Pool ID of the filesystem in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: security_mode
          in: query
          description: The filesystem security modes
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - mixed
              - native
              - ntfs
              - unix
        - name: status
          in: query
          description: The filesystem status
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - normal
              - faulty
      responses:
        '200':
          description: List filesystem query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - filesystems
                additionalProperties: true
                properties:
                  filesystems:
                    type: array
                    title: the filesystem schema
                    items:
                      $ref: '#/components/schemas/FilesystemSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/filesystems/{id}':
    get:
      tags:
        - Filesystems
      description: Get filesystem detail by filesystem ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a filesystem.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesystemSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/qtrees:
    get:
      tags:
        - Qtrees
      description: List all qtrees.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The qtree name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a qtree.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_qtree_id
          in: query
          description: Actual ID of the qtree in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_filesystem_id
          in: query
          description: Filesystem ID of the qtree in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: security_mode
          in: query
          description: The qtree security modes
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - mixed
              - native
              - ntfs
              - unix
      responses:
        '200':
          description: List qtree query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - qtrees
                additionalProperties: true
                properties:
                  qtrees:
                    type: array
                    title: the qtree schema
                    items:
                      $ref: '#/components/schemas/QtreeSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/qtrees/{id}':
    get:
      tags:
        - Qtrees
      description: Get qtree detail by qtree ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a qtree.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QtreeSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/quotas:
    get:
      tags:
        - Quotas
      description: List all quotas.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The quota name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a quota.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_quota_id
          in: query
          description: Actual ID of the quota in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_filesystem_id
          in: query
          description: Filesystem ID of the quota in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_qtree_id
          in: query
          description: Qtree ID of the quota in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: type
          in: query
          description: The quota types
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - filesystem
              - tree
              - user
              - group
      responses:
        '200':
          description: List quota query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - quotas
                additionalProperties: true
                properties:
                  quotas:
                    type: array
                    title: the quota schema
                    items:
                      $ref: '#/components/schemas/QuotaSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/quotas/{id}':
    get:
      tags:
        - Quotas
      description: Get quota detail by quota ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a quota.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuotaSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  /v1/shares:
    get:
      tags:
        - Shares
      description: List all shares.
      parameters:
        - name: limit
          in: query
          description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: offset
          in: query
          description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
          required: false
          style: form
          explode: true
          schema:
            minimum: 0
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            Comma-separated list of sort keys and optional sort directions in
            the form of key:val
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 'sort=name:desc,id:asc'
        - name: name
          in: query
          description: The share name
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: id
          in: query
          description: Database ID created for a share.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_share_id
          in: query
          description: Actual ID of the share in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_filesystem_id
          in: query
          description: Filesystem ID of the share in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: native_qtree_id
          in: query
          description: Qtree ID of the share in the storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: storage_id
          in: query
          description: Database ID created for a storage backend.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: protocol
          in: query
          description: The share protocol
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - cifs
              - nfs
              - ftp
              - hdfs
      responses:
        '200':
          description: List share query was success
          content:
            application/json:
              schema:
                type: object
                required:
                  - shares
                additionalProperties: true
                properties:
                  shares:
                    type: array
                    title: the share schema
                    items:
                      $ref: '#/components/schemas/ShareSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/shares/{id}':
    get:
      tags:
        - Shares
      description: Get share detail by share ID.
      parameters:
        - name: id
          in: path
          description: Database ID created for a share.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{storage_id}/alert-source':
    get:
      tags:
        - AlertSource
      description: >-
        Get details snmp alert source information configured on behalf of
        backend devices
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertSourceRespSpec'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
    put:
      tags:
        - AlertSource
      description: >-
        Modify snmp alert source information configured on behalf of backend
        devices
      operationId: putAlertSourceInfo
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AlertSourceUpdateSpec'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertSourceRespSpec'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
    delete:
      tags:
        - AlertSource
      description: >-
        Removes snmp alert source information configured on behalf of backend
        devices
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{storage_id}/alerts/{sequence_number}':
    delete:
      tags:
        - Alerts
      description: Clear the alert for the input alert sequence number
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: sequence_number
          in: path
          description: Sequence number which uniquely maps to the trap sent by a backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '404':
          description: The resource does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{storage_id}/alerts/sync':
    post:
      tags:
        - Alerts
      description: Sync alerts from storage device
      operationId: syncStorageAlerts
      parameters:
        - name: storage_id
          in: path
          description: Database ID created for a storage backend .
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/StorageBackendAlertSync'
      responses:
        '200':
          description: 'Accepted, '
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '401':
          description: NotAuthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '409':
          description: An item already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
  '/v1/storages/{id}/capabilities':
    get:
      tags:
        - Performance Monitoring
      description: |
        Provides supported capabilities of Infrastructure management by storage configured in delfin deployment.
      parameters:
        - name: id
          in: path
          description: Database ID created for a storage backend.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: Returns specifications of storage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageCapabilitiesResponse'
        '404':
          description: The storage does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '500':
          description: Invalid capabilities.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
        '505':
          description: Capability feature not supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSpec'
components:
  schemas:
    BaseModel:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          example: 084bf71e-a102-11e7-88a8-e31fe6d52248
        created_at:
          type: string
          format: date-time
          readOnly: true
          example: '2017-07-10T14:36:58.014Z'
        updated_at:
          type: string
          format: date-time
          readOnly: true
          example: '2017-07-10T14:36:58.014Z'
    RestAccessInfoRegistry:
      required:
        - host
        - port
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8008"
        username:
          type: string
          example: admin
        password:
          type: string
    SSHAccessInfoRegistry:
      required:
        - host
        - port
        - username
        - password
        - pub_key
        - pub_key_type
      type: object
      properties:
        host:
          type: string
          example: '10.0.0.1'
        port:
          type: string
          example: '22'
        username:
          type: string
          example: admin
        password:
          type: string
        pub_key:
          type: string
          example: '73:d8:34:18:70:2a:ae:d8:1c:a5:44:40:ef:50:d0:63'
        pub_key_type:
          type: string
          enum: ['ed25519', 'ecdsa', 'rsa']
    CLIAccessInfoRegistry:
      required:
        - host
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8888"
        username:
          type: string
          example: admin
        password:
          type: string
    SMISAccessInfoRegistry:
      required:
        - host
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "5989"
        username:
          type: string
          example: admin
        password:
          type: string
        namespace:
          type: string
    RestAccessInfoUpdate:
      required:
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8008"
        username:
          type: string
          example: admin
        password:
          type: string
    SSHAccessInfoUpdate:
      required:
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: '10.0.0.1'
        port:
          type: string
          example: '22'
        username:
          type: string
          example: admin
        password:
          type: string
        pub_key:
          type: string
          example: '73:d8:34:18:70:2a:ae:d8:1c:a5:44:40:ef:50:d0:63'
        pub_key_type:
          type: string
          enum: ['ed25519', 'ecdsa', 'rsa']
    CLIAccessInfoUpdate:
      required:
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8888"
        username:
          type: string
          example: admin
        password:
          type: string
    SMISAccessInfoUpdate:
      required:
        - username
        - password
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "5989"
        username:
          type: string
          example: admin
        password:
          type: string
        namespace:
          type: string
    RestAccessInfoResponse:
      required:
        - host
        - port
        - username
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8008"
        username:
          type: string
          example: admin
        password:
          type: string
    SSHAccessInfoResponse:
      required:
        - host
        - port
        - username
      type: object
      properties:
        host:
          type: string
          example: '10.0.0.1'
        port:
          type: string
          example: '22'
        username:
          type: string
          example: admin
        password:
          type: string
        pub_key:
          type: string
          example: '73:d8:34:18:70:2a:ae:d8:1c:a5:44:40:ef:50:d0:63'
        pub_key_type:
          type: string
          enum: ['ed25519', 'ecdsa', 'rsa']
    CLIAccessInfoResponse:
      required:
        - host
        - port
        - username
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8008"
        username:
          type: string
          example: admin
        password:
          type: string
    SMISAccessInfoResponse:
      required:
        - host
        - port
        - username
        - namespace
      type: object
      properties:
        host:
          type: string
          example: 10.0.0.1
        port:
          type: string
          example: "8008"
        username:
          type: string
          example: admin
        password:
          type: string
        namespace:
          type: string
    StorageBackendRegistry:
      required:
        - model
        - vendor
      anyOf:
        - $ref: '#/components/schemas/RestAccessInfoRegistry'
        - $ref: '#/components/schemas/SSHAccessInfoRegistry'
        - $ref: '#/components/schemas/CLIAccessInfoRegistry'
        - $ref: '#/components/schemas/SMISAccessInfoRegistry'
      type: object
      properties:
        name:
          type: string
          example: EMC-VMAX-123456
        description:
          type: string
          example: VMAX storage lab1
        vendor:
          type: string
          example: dellemc
        model:
          type: string
          example: vmax
        rest:
          $ref: '#/components/schemas/RestAccessInfoRegistry'
        ssh:
          $ref: '#/components/schemas/SSHAccessInfoRegistry'
        cli:
          $ref: '#/components/schemas/CLIAccessInfoRegistry'
        smis:
          $ref: '#/components/schemas/SMISAccessInfoRegistry'
        extra_attributes:
          type: object
          additionalProperties:
            type: string
          example:
            array_id: 00002554321
    StorageBackendRegistryUpdate:
      anyOf:
        - $ref: '#/components/schemas/RestAccessInfoUpdate'
        - $ref: '#/components/schemas/SSHAccessInfoUpdate'
        - $ref: '#/components/schemas/CLIAccessInfoUpdate'
        - $ref: '#/components/schemas/SMISAccessInfoUpdate'
      type: object
      properties:
        rest:
          $ref: '#/components/schemas/RestAccessInfoUpdate'
        ssh:
          $ref: '#/components/schemas/SSHAccessInfoUpdate'
        cli:
          $ref: '#/components/schemas/CLIAccessInfoUpdate'
        smis:
          $ref: '#/components/schemas/SMISAccessInfoUpdate'
        extra_attributes:
          type: object
          additionalProperties:
            type: string
          example:
            controller1: string
            ip1: string
            shhKeyPath: string
    StorageBackendResponse:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          example: EMC-VMAX-123456
        description:
          type: string
          example: VMAX storage lab1
        vendor:
          type: string
          example: Dell EMC
        model:
          type: string
          example: VMAX250F
        status:
          type: string
          example: normal
        firmware:
          type: string
          example: 5978.278
        serial_number:
          type: string
          example: '0002004355'
        location:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        sync_status:
              type: string
              enum:
                - SYNCED
                - SYNCING
        total_capacity:
          type: integer
          format: int64
        used_capacity:
          type: integer
          format: int64
        free_capacity:
          type: integer
          format: int64
    StorageAccessInfoResponse:
      type: object
      properties:
        id:
          type: string
        rest:
          $ref: '#/components/schemas/RestAccessInfoResponse'
        ssh:
          $ref: '#/components/schemas/SSHAccessInfoResponse'
        cli:
          $ref: '#/components/schemas/CLIAccessInfoResponse'
        smis:
          $ref: '#/components/schemas/SMISAccessInfoResponse'
        vendor:
          type: string
          example: dellemc
        model:
          type: string
          example: vmax
        extra_attributes:
          type: object
          additionalProperties:
            type: string
          example:
            array_id: string


    StoragePoolSpec:
      description: >-
        A storage pool is disocovered and updated by task manager Each pool can be
        regarded as a physical storage pool or a virtual storage pool. It is a
        logical and atomic pool and can be abstracted from any storage platform.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_storage_pool_id:
              type: string
              readOnly: true
              example: SRP_1
            storage_type:
              type: string
              enum:
                - block
                - file
                - unified
            description:
              type: string
            status:
              type: string
              enum:
                - normal
                - offline
                - abnormal
            total_capacity:
              type: integer
              format: int64
            used_capacity:
              type: integer
              format: int64
            free_capacity:
              type: integer
              format: int64
    ControllerSpec:
      description: >-
        A controller is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_controller_id:
              type: string
              readOnly: true
              example: Controller_A
            soft_version:
              type: string
            location:
              type: string
            status:
              type: string
              enum:
                - normal
                - offline
                - unknown
            cpu_info:
              type: string
            memory_size:
              type: integer
              format: int64
    PortSpec:
      description: >-
        A port is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_port_id:
              type: string
              readOnly: true
              example: Port_A
            native_parent_id:
              type: string
              readOnly: true
              example: Controller_A
            speed:
              type: integer
            max_speed:
              type: integer
            location:
              type: string
            connection_status:
              type: string
              enum:
                - connected
                - disconnected
                - unknown
            health_status:
              type: string
              enum:
                - normal
                - abnormal
                - unknown
            type:
              type: string
              enum:
                - fc
                - iscsi
                - ficon
                - fcoe
                - eth
                - sas
                - ib
                - other
            logical_type:
              type: string
              enum:
                - frontend
                - backend
                - service
                - management
                - internal
                - maintenance
                - interconnect
                - other
            wwn:
              type: string
            mac_address:
              type: string
            ipv4:
              type: string
            ipv4_mask:
              type: string
            ipv6:
              type: string
            ipv6_mask:
              type: string
    DiskSpec:
      description: >-
        A disk is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_disk_id:
              type: string
              readOnly: true
              example: Disk_A
            serial_number:
              type: string
              readOnly: true
              example: SN00112233
            manufacturer:
              type: string
            model:
              type: string
            firmware:
              type: string
            speed:
              type: integer
            capacity:
              type: integer
            location:
              type: string
            status:
              type: string
              enum:
                - normal
                - offline
                - abnormal
            physical_type:
              type: string
              enum:
                - sata
                - sas
                - ssd
                - nl-sas
                - unknown
            logical_type:
              type: string
              enum:
                - free
                - member
                - hotspare
                - cache
            health_score:
              type: integer
            native_disk_group_id:
              type: string
    FilesystemSpec:
      description: >-
        A filesystem is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_filesystem_id:
              type: string
              readOnly: true
              example: Filesystem_A
            native_pool_id:
              type: string
              readOnly: true
              example: Pool_A
            total_capacity:
              type: integer
            used_capacity:
              type: integer
            free_capacity:
              type: integer
            status:
              type: string
              enum:
                - normal
                - faulty
            worm:
              type: string
              enum:
                - non_worm
                - audit_log
                - compliance
                - enterprise
            type:
              type: string
              enum:
                - thick
                - thin
            deduplicated:
              type: boolean
            compressed:
              type: boolean
            security_mode:
              type: string
              enum:
                - mixed
                - native
                - ntfs
                - unix
    QtreeSpec:
      description: >-
        A qtree is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_qtree_id:
              type: string
              readOnly: true
              example: Qtree_A
            native_filesystem_id:
              type: string
              readOnly: true
              example: Filesystem_A
            path:
              type: string
            security_mode:
              type: string
              enum:
                - mixed
                - native
                - ntfs
                - unix
    QuotaSpec:
      description: >-
        A quota is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
            - type
          type: object
          properties:
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_quota_id:
              type: string
              readOnly: true
              example: Quota_A
            name:
              type: string
            type:
              type: string
              enum:
                - filesystem
                - tree
                - user
                - group
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_filesystem_id:
              type: string
              readOnly: true
              example: Filesystem_A
            native_qtree_id:
              type: string
              readOnly: true
              example: Qtree_A
            capacity_hard_limit:
              type: integer
              format: int64
              example: 100
            capacity_soft_limit:
              type: integer
              format: int64
              example: 80
            file_hard_limit:
              type: integer
              format: int64
              example: 10
            file_soft_limit:
              type: integer
              format: int64
              example: 8
            used_capacity:
              type: integer
              format: int64
              example: 100
            file_count:
              type: integer
              format: int64
              example: 10
            user_group_name:
              type: string
    ShareSpec:
      description: >-
        A share is discovered and updated by task manager.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - required:
            - id
            - name
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            native_share_id:
              type: string
              readOnly: true
              example: Share_A
            native_filesystem_id:
              type: string
              readOnly: true
              example: Filesystem_A
            native_qtree_id:
              type: string
            protocol:
              type: string
              enum:
                - cifs
                - nfs
                - ftp
                - hdfs
            path:
              type: string

    VolumeRespSpec:
      description:
        Volume is an device created by storage service, it can be attached to
        physical machine or virtual machine instance.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - type: object
          properties:
            name:
              type: string
            description:
              type: string
            status:
              type: string
              enum:
                - available
                - error
            storage_id:
              type: string
              readOnly: true
              example: 084bf71e-a102-11e7-88a8-e31fe6d52248
            total_capacity:
              type: integer
              format: int64
              example: 2
            used_capacity:
              type: integer
              format: int64
              example: 2
            free_capacity:
              type: integer
              format: int64
              example: 2
            compressed:
              type: boolean
              example: false
            deduplicated:
              type: boolean
              example: false
            type :
              type: string
              enum:
                - thick
                - thin
            native_volume_id:
              type: string
            wwn:
              type: string
            native_storage_pool_id:
              type: string
    AlertSourceUpdateSpec:
      required:
        - host
        - version
      type: object
      properties:
        version:
          type: string
          description: SNMP version. Should be mandatorily set by user
          example: SNMPV2C
          enum:
            - SNMPV2C
            - SNMPV3
        community_string:
          type: string
          description: Community string. This should be filled if version is V2C
        username:
          type: string
          description: SNMP V3 usm username. This should be filled if version is V3
        engine_id:
          type: string
          description: >-
            Engind ID of the device which will be sending the traps. This should
            be filled if version is V3
        security_level:
          type: string
          description: Security level for the user. This should be filled if version is V3
          example: noAuthnoPriv
          enum:
            - noAuthnoPriv
            - authNoPriv
            - authPriv
        auth_protocol:
          type: string
          description: >-
            Authentication protocol to be selected. This should be filled if
            authNoPriv or authPriv is set as security_level
          example: MD5
          enum:
            - MD5
            - SHA
        auth_key:
          type: string
          description: >-
            Authentication key. This should be filled if authNoPriv or authPriv
            is set
        privacy_protocol:
          type: string
          description: >-
            Privacy or encryption protocol to be selected. This should be filled
            if authPriv is set as security_level
          example: DES
          enum:
            - 3DES
            - DES
            - AES
        privacy_key:
          type: string
          description: >-
            Privacy or encryption password. This should be filled if authPriv is
            set as security_level
        host:
          type: string
          example: 10.0.0.1
        context_name:
          type: string
          description: Context name of the alert source
          example: "New Context"
        retry_num:
          type: integer
          description: >-
            Maximum number of retries while connecting to alert source
            By default, set to 1
          example: 2
        expiration:
          type: integer
          description: >-
            Expiration time (in sec) for one alert source connect request
            By default, set to 2
          example: 60
        port:
          type: integer
          description: >-
            Port for connecting to alert source
            By default, set to 161
          example: 20162
      description: SNMP alert source configuration attributes.
    AlertSourceRespSpec:
      description: Response for snmp alert source configuration.
      allOf:
        - $ref: '#/components/schemas/BaseModel'
        - type: object
          properties:
            version:
              type: string
              description: SNMP version. Should be mandatorily set by user
              example: SNMPV2C
              enum:
                - SNMPV2C
                - SNMPV3
            community_string:
              type: string
              description: Community string. This should be filled ig version is V2C
            username:
              type: string
              description: SNMP V3 usm username. This should be filled ig version is V3
            engine_id:
              type: string
              description: Engind ID of the device which will be sending the traps
            security_level:
              type: string
              description: Security level for the user
              example: noAuthnoPriv
              enum:
                - noAuthnoPriv
                - authNoPriv
                - authPriv
            auth_protocol:
              type: string
              description: >-
                Authentication protocol to be selected. This should be filled if
                authNoPriv or authPriv is set as security_level
              example: MD5
              enum:
                - MD5
                - SHA
            auth_key:
              type: string
              description: >-
                Authentication key. This should be filled if authNoPriv or
                authPriv is set
            privacy_protocol:
              type: string
              description: >-
                Privacy or encryption protocol to be selected. This should be
                filled if authPriv is set as security_level
              example: DES
              enum:
                - 3DES
                - DES
                - AES
            privacy_key:
              type: string
              description: >-
                Privacy or encryption password. This should be filled if
                authPriv is set as security_level
            host:
              type: string
              example: 10.0.0.1
            context_name:
              type: string
              description: Context name of the alert source
              example: "New Context"
            retry_num:
              type: integer
              description: >-
                Maximum number of retries while connecting to alert source
                By default, set to 1
              example: 2
            expiration:
              type: integer
              description: >-
                Expiration time (in sec) for one alert source connect request
                By default, set to 2
              example: 60
            port:
              type: integer
              description: >-
                Port for connecting to alert source
                By default, set to 161
              example: 20162
    StorageBackendAlertSync:
      type: object
      properties:
        begin_time:
          type: integer
          format: int64
            Start time(in milliseconds) for alert sync. It is optional.
            If not provided, alerts are fetched without filtering start time
          example: 13577777777777766
        end_time:
          type: integer
          format: int64
          description: >-
            End time(in milliseconds) for alert sync. It is optional.
            If not provided, alerts are fetched without filtering end time
          example: 13577777777777777
    ErrorSpec:
      required:
        - error_code
        - error_msg
        - error_args
      type: object
      properties:
        error_code:
          type: string
        error_msg:
          type: string
        error_args:
          type: array
          items:
            type: string
      description: >-
        Detailed HTTP error response, which consists of a HTTP status code, and
        a custom error message unique for each failure case.

    StorageCapabilitiesResponse:
      type: object
      required:
        - metadata
        - spec
      properties:
        metadata:
          type: object
          properties:
            model:
              type: string
              description: Name of the supported storage (driver)
              example: VMAX250F
            vendor:
              type: string
              description: Name of the vendor
              example: Dell EMC
        spec:
          type: object
          required:
            - is_historic
          properties:
            is_historic:
              type: boolean
              example: true
              description: Set true during storage driver registration if driver support fetching historic metrics. This enable internal performance framework to either call driver interface to pull real time metrics or historic time series metrics.
            resource_metrics:
              $ref: '#/components/schemas/ResourceMetrics'
    ResourceMetrics:
      type: object
      description: Map of resources and supported metrics of respective resources for storage (driver)
      additionalProperties:
        type: array
        items:
          type: object
          description: list of metrics with supported Units and its description
          properties:
            unit:
              type: string
              description: supported metric unit
            description:
              type: string
              description: storage specific desctiption for respective metric
      example:
        storagePool:
          - throughput:
              unit: MB/s
              description: Represents how much data is successfully transferred in MB/s
          - readThroughput:
              unit: MB/s
              description: Represents how much data read is successfully transferred in MB/s
          - readRequests:
              unit: IOPS
              description: Read requests per second
  responses:
    HTTPStatus400:
      description: BadRequest
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSpec'
    HTTPStatus401:
      description: NotAuthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSpec'
    HTTPStatus403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSpec'
    HTTPStatus404:
      description: The resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSpec'
    HTTPStatus409:
      description: An item already exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSpec'
    HTTPStatus500:
      description: An unexpected error occured.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSpec'
  parameters:
    storage_id:
      name: storage_id
      in: path
      description: Database ID created for a storage backend.
      required: true
      style: simple
      explode: false
      schema:
        type: string
    native_storage_pool_id:
      name: native_storage_pool_id
      in: path
      description: Actual ID of the storage pool in backend.
      required: true
      style: simple
      explode: false
      schema:
        type: string
    native_volume_id:
      name: native_volume_id
      in: path
      description: Actual ID of the volume in backend.
      required: true
      style: simple
      explode: false
      schema:
        type: string
    limit:
      name: limit
      in: query
      description: Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
      required: false
      style: form
      explode: true
      schema:
        minimum: 1
        type: integer
        format: int32
    offset:
      name: offset
      in: query
      description: Used in conjunction with limit to return a slice of items. offset is where to start in the list.
      required: false
      style: form
      explode: true
      schema:
        minimum: 0
        type: integer
        format: int32
          - desc
    sequence_number:
      name: sequence_number
      in: path
      description: Sequence number which uniquely maps to the trap sent by a backend.
      required: true
      style: simple
      explode: false
      schema:
        type: string
  requestBodies:
    AlertSourceUpdateSpec:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AlertSourceUpdateSpec'
    StorageBackendAlertSync:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StorageBackendAlertSync'