swagger: '2.0'
info:
  description: Configuration for Custom Dashboard for Network reports resource.
  version: 'v2'
  title: perf_custom_dashboard
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: perf_custom_dashboard
    description: Custom Dashboard for Network reports
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 for all the perf custom dashboard configuration 
   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/perf_custom_dashboard:
    get:
      tags:
        - perf_custom_dashboard
      summary: GET all perf_custom_dashboard
      operationId: getall_perf_custom_dashboard
      description: get perf custom dashboard configuration
      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 perf_custom_dashboard 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 perf_custom_dashboard 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 perf_custom_dashboard resources.
          enum:
            - yes
      responses:
        200:
          description:  for perf_custom_dashboard
          schema: 
              $ref: '#/definitions/getperf_custom_dashboardsResponse'
        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'

    post:
      tags:
        - perf_custom_dashboard
      summary: POST operation for perf_custom_dashboard
      operationId: post_perf_custom_dashboard
      description: POST operation for perf_custom_dashboard
      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: onerror
          description: Use this parameter to set the onerror status for nitro request. Applicable only for bulk requests.
          required: false
          type: string
          default: CONTINUE
          enum:
            - EXIT
            - CONTINUE
        - in: body
          name: perf_custom_dashboard
          description: perf_custom_dashboard object
          schema:
              $ref: '#/definitions/addperf_custom_dashboardRequest'
      responses:
        200:
          description: add for perf_custom_dashboard
          schema: 
              $ref: '#/definitions/addperf_custom_dashboardResponse'
        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/perf_custom_dashboard/{id}:
    get:
      tags:
        - perf_custom_dashboard
      summary: GET by key for perf_custom_dashboard
      operationId: getbykey_perf_custom_dashboard
      description: get perf custom dashboard configuration
      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: add for perf_custom_dashboard
          schema: 
              $ref: '#/definitions/getperf_custom_dashboardResponse'
        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'

    put:
      tags:
        - perf_custom_dashboard
      summary: PUT for perf_custom_dashboard
      operationId: putbykey_perf_custom_dashboard
      description: modify perf custom dashboard configuration
      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
        - in: body
          name: perf_custom_dashboard
          description: perf_custom_dashboard object
          schema:
              $ref: '#/definitions/modifyperf_custom_dashboardRequest'
      responses:
        200:
          description: add for perf_custom_dashboard
          schema: 
              $ref: '#/definitions/modifyperf_custom_dashboardResponse'
        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'

    delete:
      tags:
        - perf_custom_dashboard
      summary: Delete for perf_custom_dashboard
      operationId: deletebykey_perf_custom_dashboard
      description: Delete perf custom dashboard configuration
      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:
        204:
          description: add for perf_custom_dashboard
        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:
  addperf_custom_dashboardRequest:
    type: object
    required:
      - perf_custom_dashboard
    properties:
      perf_custom_dashboard:
        $ref: '#/definitions/perf_custom_dashboard_readwrite'
    title: addperf_custom_dashboardRequest
    example:
      perf_custom_dashboard:
        device_family: "ns"
        name: "CPU_Dashboard"
        description: "Test Report"
        no_of_columns: "2"
        timestamp: "1579491807.00"
        entity_type: "global"
        agg_level: "1"
        entities_array: ["string_value1","string_value2"]
        coordinates_array: ["string_value1","string_value2"]
        instances_array: ["string_value1","string_value2"]
        report_names_array: ["string_value1","string_value2"]

  addperf_custom_dashboardResponse:
    type: object
    required:
      - perf_custom_dashboard
    properties:
      perf_custom_dashboard:
        $ref: '#/definitions/perf_custom_dashboard'
    title: addperf_custom_dashboardResponse
    example:
      perf_custom_dashboard:
        report_names: "perf_lb_connections_report,perf_lb_transactions_report"
        coordinates: "1,2"
        instances: "1.1.1.1,1.1.1.2"
        device_family: "ns"
        name: "CPU_Dashboard"
        description: "Test Report"
        entities: "CSV1@1.1.1.1,CSV2@1.1.1.2"
        no_of_columns: "2"
        timestamp: "1579491807.00"
        entity_type: "global"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        agg_level: "1"
        entities_array: ["string_value1","string_value2"]
        coordinates_array: ["string_value1","string_value2"]
        instances_array: ["string_value1","string_value2"]
        report_names_array: ["string_value1","string_value2"]

  getperf_custom_dashboardResponse:
    type: object
    required:
      - perf_custom_dashboard
    properties:
      perf_custom_dashboard:
        $ref: '#/definitions/perf_custom_dashboard'
    title: getperf_custom_dashboardResponse
    example:
      perf_custom_dashboard:
        report_names: "perf_lb_connections_report,perf_lb_transactions_report"
        coordinates: "1,2"
        instances: "1.1.1.1,1.1.1.2"
        device_family: "ns"
        name: "CPU_Dashboard"
        description: "Test Report"
        entities: "CSV1@1.1.1.1,CSV2@1.1.1.2"
        no_of_columns: "2"
        timestamp: "1579491807.00"
        entity_type: "global"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        agg_level: "1"
        entities_array: ["string_value1","string_value2"]
        coordinates_array: ["string_value1","string_value2"]
        instances_array: ["string_value1","string_value2"]
        report_names_array: ["string_value1","string_value2"]

  getperf_custom_dashboardsResponse:
    type: object
    required:
      - perf_custom_dashboard
    properties:
      perf_custom_dashboard:
        type: array
        items:
          $ref: '#/definitions/perf_custom_dashboard'
    title: getperf_custom_dashboardsResponse
    example:
      perf_custom_dashboard:
        report_names: "perf_lb_connections_report,perf_lb_transactions_report"
        coordinates: "1,2"
        instances: "1.1.1.1,1.1.1.2"
        device_family: "ns"
        name: "CPU_Dashboard"
        description: "Test Report"
        entities: "CSV1@1.1.1.1,CSV2@1.1.1.2"
        no_of_columns: "2"
        timestamp: "1579491807.00"
        entity_type: "global"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        agg_level: "1"
        entities_array: ["string_value1","string_value2"]
        coordinates_array: ["string_value1","string_value2"]
        instances_array: ["string_value1","string_value2"]
        report_names_array: ["string_value1","string_value2"]

  modifyperf_custom_dashboardRequest:
    type: object
    required:
      - perf_custom_dashboard
    properties:
      perf_custom_dashboard:
        $ref: '#/definitions/perf_custom_dashboard_readwrite'
    title: modifyperf_custom_dashboardRequest
    example:
      perf_custom_dashboard:
        device_family: "ns"
        name: "CPU_Dashboard"
        description: "Test Report"
        no_of_columns: "2"
        timestamp: "1579491807.00"
        entity_type: "global"
        agg_level: "1"
        entities_array: ["string_value1","string_value2"]
        coordinates_array: ["string_value1","string_value2"]
        instances_array: ["string_value1","string_value2"]
        report_names_array: ["string_value1","string_value2"]

  modifyperf_custom_dashboardResponse:
    type: object
    required:
      - perf_custom_dashboard
    properties:
      perf_custom_dashboard:
        $ref: '#/definitions/perf_custom_dashboard'
    title: modifyperf_custom_dashboardResponse
    example:
      perf_custom_dashboard:
        report_names: "perf_lb_connections_report,perf_lb_transactions_report"
        coordinates: "1,2"
        instances: "1.1.1.1,1.1.1.2"
        device_family: "ns"
        name: "CPU_Dashboard"
        description: "Test Report"
        entities: "CSV1@1.1.1.1,CSV2@1.1.1.2"
        no_of_columns: "2"
        timestamp: "1579491807.00"
        entity_type: "global"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        agg_level: "1"
        entities_array: ["string_value1","string_value2"]
        coordinates_array: ["string_value1","string_value2"]
        instances_array: ["string_value1","string_value2"]
        report_names_array: ["string_value1","string_value2"]

  perf_custom_dashboard_readwrite:
    type: object
    properties:
      device_family:
        description: "Device Family of which this custom dashboard belongs to"
        type: string
        format: string
      name:
        description: "name"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      description:
        description: "Custom dashboard description"
        type: string
        format: string
      no_of_columns:
        description: "No of columns in dashboard"
        type: integer
        format: int32
      timestamp:
        description: "timestamp in seconds"
        type: number
        format: double
      entity_type:
        description: "Entity Type"
        type: string
        format: string
      agg_level:
        description: "Aggregation Level"
        type: string
        format: string
      entities_array:
        description: "Entities (Virtual servers or Network Interfaces)"
        type: array
        items:
          type: string
          format: string
      coordinates_array:
        description: "Co-ordinates in array"
        type: array
        items:
          type: string
          format: string
      instances_array:
        description: "Instances in array"
        type: array
        items:
          type: string
          format: string
      report_names_array:
        description: "Report names in array"
        type: array
        items:
          type: string
          format: string

  perf_custom_dashboard:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the perf custom dashboard configuration 
            type: string
            format: uuid
          report_names:
             description: "Report Names"
             type: string
             format: string
             maxLength: 4096
          coordinates:
             description: "Co-ordinates"
             type: string
             format: string
             maxLength: 4096
          instances:
             description: "Display Names of NetScaler instances"
             type: string
             format: string
             maxLength: 4096
          entities:
             description: "Entities(virtual servers or network interfaces) with instance display_names"
             type: string
             format: string
             maxLength: 4096
      - $ref: '#/definitions/perf_custom_dashboard_readwrite'

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