swagger: "2.0"
info:
  title: Citrix Cloud Connector Health Data API
  description: APIs for querying Connector health data
  version: "1.0"
host: 'api.cloud.com'
schemes:
  - https
basePath: /healthdata
paths:
  /metricdata:
    get:
      tags:
        - MetricData
      summary: Fetch the metric data for a connector
      operationId: MetricData_FetchMetricDataAsync
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          description: ID of the customer.
          required: true
          type: string
        - name: edgeServerId
          in: query
          description: This is the unique id of the EdgeServer.
          required: true
          type: string
        - name: numOfDays
          in: query
          required: false
          type: integer
          format: int32
        - name: retrieveProvidersData
          in: query
          required: false
          type: boolean
        - name: dataAggregationTime
          in: query
          required: false
          type: string
          enum:
            - OneHour
            - SixHours
            - OneDay
      responses:
        '200':
          description: OK
          schema:
            $ref: "#/definitions/MetricDataResponsesModel"
  /connectivitydata:
    get:
      tags:
        - ConnectivityData
      summary: Fetch the connectivity data for a connector
      operationId: MetricData_FetchConnectivityDataAsync
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          description: ID of the customer.
          required: true
          type: string
        - name: edgeServerId
          in: query
          description: This is the unique id of the EdgeServer.
          required: true
          type: string
        - name: numOfDays
          in: query
          required: false
          type: integer
          format: int32
        - name: retrieveProvidersData
          in: query
          required: false
          type: boolean
        - name: dataAggregationTime
          in: query
          required: false
          type: string
          enum:
            - OneHour
            - SixHours
            - OneDay
      responses:
        '200':
          description: OK
          schema:
            $ref: "#/definitions/ConnectivityDataResponsesModel"
definitions:
  MetricDataResponsesModel:
    type: object
    properties:
      cpuData:
        type: array
        items:
          $ref: "#/definitions/MetricDataResponseModel"
      memoryData:
        type: array
        items:
          $ref: "#/definitions/MetricDataResponseModel"
      networkData:
        type: array
        items:
          $ref: "#/definitions/MetricDataResponseModel"
      diskData:
        type: array
        items:
          $ref: "#/definitions/MetricDataResponseModel"
      providersData:
        type: object
        additionalProperties:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: "#/definitions/MetricDataResponseModel"
  MetricDataResponseModel:
    type: object
    properties:
      identifier:
        type: string
      alert:
        type: boolean
      subtype:
        type: string
      data:
        type: object
        additionalProperties:
          format: float
          type: number
      maxValue:
        format: float
        type: number
      unit:
        type: string
      chartType:
        enum:
          - Line
          - StackedHorizontalBar
        type: string
  ConnectivityDataResponsesModel:
    type: object
    properties:
      overallConnectorConnectivity:
        type: object
        additionalProperties:
          enum:
            - Unknown
            - Connected
            - Disconnected
          type: string
      providersData:
        type: array
        items:
          $ref: "#/definitions/ConnectivityDataProviderResponseModel"
  ConnectivityDataProviderResponseModel:
    description: ''
    type: object
    properties:
      providerName:
        description: Provider Name
        type: string
      displayName:
        description: Display Name
        type: string
      providerVersion:
        description: Provider Version
        type: string
      overallProviderConnectivity:
        description: Overall Provider Connectivity
        type: object
        additionalProperties:
          enum:
            - Unknown
            - Connected
            - Disconnected
          type: string
      connectivityCheckData:
        description: Data of all the checks in the provider
        type: object
        additionalProperties:
          $ref: "#/definitions/ConnectivityCheckResponseModel"
  ConnectivityCheckResponseModel:
    description: Connectivity Check Response Model
    type: object
    properties:
      name:
        description: Check Name
        type: string
      label:
        description: Check Label
        type: string
      description:
        description: Check Description
        type: string
      targetUri:
        description: TargetUri
        type: string
      severity:
        description: Severity of check
        enum:
          - Critical
          - Warning
        type: string
      data:
        description: Data of all the checks in the provider
        type: object
        additionalProperties:
          enum:
            - Unknown
            - Connected
            - Disconnected
          type: string
  EdgeServerModel:
    type: object
    properties:
      id:
        type: string
      fqdn:
        maxLength: 100
        minLength: 0
        type: string
      role:
        maxLength: 256
        minLength: 0
        type: string
      windowsSid:
        maxLength: 100
        minLength: 0
        type: string
      location:
        maxLength: 100
        minLength: 0
        type: string
      status:
        maxLength: 256
        minLength: 0
        type: string
      currentVersion:
        type: string
      currentBootstrapperVersion:
        type: string
      expectedVersion:
        type: string
      expectedBootStrapperVersion:
        type: string
      versionState:
        type: string
      upgradingVersion:
        type: string
      upgradingStatus:
        type: string
      failedUpgradeReason:
        type: string
      lastUpgradeDate:
        type: string
        format: date-time
      lastUpgradeCompletedDate:
        type: string
        format: date-time
      lastContactDate:
        type: string
        format: date-time
      leaseEndDateTime:
        type: string
        format: date-time
      inMaintenance:
        type: boolean
      upgradeDisabled:
        type: boolean
      connectorType:
        $ref: '#/definitions/ConnectorType'
    additionalProperties: false
  ConnectorType:
    enum:
      - 0
      - 1
      - 2147483647
    type: integer
    format: int32