swagger: '2.0'
info:
  description: Configuration for Available Disks Usage resource.
  version: 'v2'
  title: mps_disk_usage
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: mps_disk_usage
    description: Available Disks Usage
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   required: true
  authParam:
      in: header
      name: Authorization
      type: string
      required: true
      description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
  cloudParam:
      in: header
      name: isCloud
      type: string
      required: true
      description: set the value to true in case of Cloud services, false for on-prem deployment
paths:
  /massvc/{customerid}/nitro/v2/config/mps_disk_usage:
    get:
      tags:
        - mps_disk_usage
      summary: GET all mps_disk_usage
      operationId: getall_mps_disk_usage
      description: Use this operation to get MPS monitorind health stats
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: query
          name: filter
          type: string
          required: false
          description: "Use this query-parameter to get the filtered set of vm_device resources configured on the system. You can set a filter on any property of the resource.Example:  property-name1:property-value1 "
        - in: query
          name: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the mps_disk_usage resources in chunks.To be used along with pageno query parameter.
        - in: query
          name: pageno
          type: integer
          required: false
          description: Use this query-parameter to get the mps_disk_usage resources in chunks.To be used along with pagesize query parameter.
        - in: query
          name: count
          type: string
          required: false
          description: Use this query-parameter to get the count of mps_disk_usage resources.
          enum:
            - yes
      responses:
        200:
          description:  for mps_disk_usage
          schema: 
              $ref: '#/definitions/getmps_disk_usagesResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

  /massvc/{customerid}/nitro/v2/config/mps_disk_usage/{id}:
    get:
      tags:
        - mps_disk_usage
      summary: GET by key for mps_disk_usage
      operationId: getbykey_mps_disk_usage
      description: Use this operation to get MPS monitorind health stats
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
      responses:
        200:
          description:  for mps_disk_usage
          schema: 
              $ref: '#/definitions/getmps_disk_usageResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

definitions:
  getmps_disk_usageResponse:
    type: object
    required:
      - mps_disk_usage
    properties:
      mps_disk_usage:
        $ref: '#/definitions/mps_disk_usage'
    title: getmps_disk_usageResponse
    example:
      mps_disk_usage:
        free_space: "number_value"
        parent_name: "string_value"
        disk_usage: "0"
        used_space: "number_value"
        parent_id: "string_value"
        disk_name: "string_value"
        total_space: "number_value"
        disk_partition: "string_value"
        disk_slice: "string_value"
        id: "2b38ae44-a824-4f51-a155-23ab334gfd"
        disk_capacity: "0"

  getmps_disk_usagesResponse:
    type: object
    required:
      - mps_disk_usage
    properties:
      mps_disk_usage:
        type: array
        items:
          $ref: '#/definitions/mps_disk_usage'
    title: getmps_disk_usagesResponse
    example:
      mps_disk_usage:
        free_space: "number_value"
        parent_name: "string_value"
        disk_usage: "0"
        used_space: "number_value"
        parent_id: "string_value"
        disk_name: "string_value"
        total_space: "number_value"
        disk_partition: "string_value"
        disk_slice: "string_value"
        id: "2b38ae44-a824-4f51-a155-23ab334gfd"
        disk_capacity: "0"

  mps_disk_usage_readwrite:
    type: object
    properties:
      parent_name:
        type: string
        format: string
      parent_id:
        type: string
        format: string
      disk_partition:
        description: "Disk Partition"
        type: string
        format: string

  mps_disk_usage:
    allOf:
      -
        properties:
          id:
            type: string
            format: string
          free_space:
             description: "Free space available in KB"
             type: number
             format: double
          disk_usage:
             description: "Disk Usage (%)"
             type: number
             format: double
          used_space:
             description: "Used space available in KB"
             type: number
             format: double
          disk_name:
             description: "Disk Name"
             type: string
             format: string
          total_space:
             description: "Total space in KB"
             type: number
             format: double
          disk_slice:
             description: "Disk Slice"
             type: string
             format: string
          disk_capacity:
             description: "Disk Total Capacity in KB"
             type: number
             format: double
      - $ref: '#/definitions/mps_disk_usage_readwrite'

  Error:
    properties:
      errorcode:
        type: number
        format: int32
        example: 1001
      errormessage:
        type: string
        format: string
        example: "id cannot be found"
