swagger: '2.0'
info:
  description: Configuration for Health Monitoring Stats resource.
  version: 'v2'
  title: mps_health
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: mps_health
    description: Health Monitoring Stats
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is system generated key
   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_health:
    get:
      tags:
        - mps_health
      summary: GET all mps_health
      operationId: getall_mps_health
      description: Use this operation to get 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_health 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_health 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_health resources.
          enum:
            - yes
      responses:
        200:
          description:  for mps_health
          schema: 
              $ref: '#/definitions/getmps_healthsResponse'
        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_health/{id}:
    get:
      tags:
        - mps_health
      summary: GET by key for mps_health
      operationId: getbykey_mps_health
      description: Use this operation to get 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_health
          schema: 
              $ref: '#/definitions/getmps_healthResponse'
        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_healthResponse:
    type: object
    required:
      - mps_health
    properties:
      mps_health:
        $ref: '#/definitions/mps_health'
    title: getmps_healthResponse
    example:
      mps_health:
        disks_usage: [{        free_space: "number_value"
,        parent_name: "string_value"
,        disk_usage: "number_value"
,        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: "string_value"
,        disk_capacity: "number_value"
}]
        node_type: "Primary"
        memory_total: "17444110336"
        disk_total_capacity: "128848978944"
        disk_usage: "0"
        disk_total: "120522616832"
        memory_usage: "42.73"
        disk_free: "74178742272"
        page_size: "4096"
        node_id: "2490-4185-911d-b18143df7e55"
        memory_free: "9989640192"
        cpu_usage: "2.04"
        id: "2b38ae44-a824-4f51-a155-23ab334gfd"
        disk_used: "36702066688"

  getmps_healthsResponse:
    type: object
    required:
      - mps_health
    properties:
      mps_health:
        type: array
        items:
          $ref: '#/definitions/mps_health'
    title: getmps_healthsResponse
    example:
      mps_health:
        disks_usage: [{        free_space: "number_value"
,        parent_name: "string_value"
,        disk_usage: "number_value"
,        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: "string_value"
,        disk_capacity: "number_value"
}]
        node_type: "Primary"
        memory_total: "17444110336"
        disk_total_capacity: "128848978944"
        disk_usage: "0"
        disk_total: "120522616832"
        memory_usage: "42.73"
        disk_free: "74178742272"
        page_size: "4096"
        node_id: "2490-4185-911d-b18143df7e55"
        memory_free: "9989640192"
        cpu_usage: "2.04"
        id: "2b38ae44-a824-4f51-a155-23ab334gfd"
        disk_used: "36702066688"

  mps_health_readwrite:
    type: object
    properties:
      disks_usage:
        type: array
        items:
          $ref: '#/definitions/mps_disk_usage_readwrite'
      node_type:
        description: "Application Node Type"
        type: string
        format: string
      node_id:
        description: "Application Node ID"
        type: string
        format: string

  mps_health:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key
            type: string
            format: uuid
          memory_total:
             description: "Total memory in KB"
             type: number
             format: double
          disk_total_capacity:
             description: "Disk Total Capacity in KB"
             type: number
             format: double
          disk_usage:
             description: "Disk Usage (%)"
             type: number
             format: double
          disk_total:
             description: "Total available disk space in KB"
             type: number
             format: double
          memory_usage:
             description: "Memory Usage (%)"
             type: number
             format: double
          disk_free:
             description: "Free disk available in KB"
             type: number
             format: double
          page_size:
             description: "Total memory in KB"
             type: number
             format: double
          memory_free:
             description: "Free memory available in KB"
             type: number
             format: double
          cpu_usage:
             description: "CPU Usage (%)"
             type: number
             format: double
          disk_used:
             description: "Disk used in KB"
             type: number
             format: double
      - $ref: '#/definitions/mps_health_readwrite'

  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"
