swagger: '2.0'
info:
  description: Configuration for Perf Aggregation Function Config for Network reports resource.
  version: 'v2'
  title: perf_agg_config
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: perf_agg_config
    description: Perf Aggregation Function Config for Network reports
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: report_name
   in: path
   type: string
   description: Report name or ALL for all report
   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_agg_config:
    get:
      tags:
        - perf_agg_config
      summary: GET all perf_agg_config
      operationId: getall_perf_agg_config
      description: get perf aggregation function 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_agg_config 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_agg_config 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_agg_config resources.
          enum:
            - yes
      responses:
        200:
          description:  for perf_agg_config
          schema: 
              $ref: '#/definitions/getperf_agg_configsResponse'
        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_agg_config
      summary: POST operation for perf_agg_config
      operationId: post_perf_agg_config
      description: POST operation for perf_agg_config
      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_agg_config
          description: perf_agg_config object
          schema:
              $ref: '#/definitions/addperf_agg_configRequest'
      responses:
        200:
          description: add for perf_agg_config
          schema: 
              $ref: '#/definitions/addperf_agg_configResponse'
        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_agg_config/{report_name}:
    get:
      tags:
        - perf_agg_config
      summary: GET by key for perf_agg_config
      operationId: getbykey_perf_agg_config
      description: get perf aggregation function 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_agg_config
          schema: 
              $ref: '#/definitions/getperf_agg_configResponse'
        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_agg_config
      summary: PUT for perf_agg_config
      operationId: putbykey_perf_agg_config
      description: modify perf aggregation function 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_agg_config
          description: perf_agg_config object
          schema:
              $ref: '#/definitions/modifyperf_agg_configRequest'
      responses:
        200:
          description: add for perf_agg_config
          schema: 
              $ref: '#/definitions/modifyperf_agg_configResponse'
        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_agg_config
      summary: Delete for perf_agg_config
      operationId: deletebykey_perf_agg_config
      description: Delete perf aggregation function 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_agg_config
        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_agg_configRequest:
    type: object
    required:
      - perf_agg_config
    properties:
      perf_agg_config:
        $ref: '#/definitions/perf_agg_config_readwrite'
    title: addperf_agg_configRequest
    example:
      perf_agg_config:
        agg_level_array: ["string_value1","string_value2"]

  addperf_agg_configResponse:
    type: object
    required:
      - perf_agg_config
    properties:
      perf_agg_config:
        $ref: '#/definitions/perf_agg_config'
    title: addperf_agg_configResponse
    example:
      perf_agg_config:
        report_name: "ALL"
        agg_levels: "1"
        agg_level_array: ["string_value1","string_value2"]

  getperf_agg_configResponse:
    type: object
    required:
      - perf_agg_config
    properties:
      perf_agg_config:
        $ref: '#/definitions/perf_agg_config'
    title: getperf_agg_configResponse
    example:
      perf_agg_config:
        report_name: "ALL"
        agg_levels: "1"
        agg_level_array: ["string_value1","string_value2"]

  getperf_agg_configsResponse:
    type: object
    required:
      - perf_agg_config
    properties:
      perf_agg_config:
        type: array
        items:
          $ref: '#/definitions/perf_agg_config'
    title: getperf_agg_configsResponse
    example:
      perf_agg_config:
        report_name: "ALL"
        agg_levels: "1"
        agg_level_array: ["string_value1","string_value2"]

  modifyperf_agg_configRequest:
    type: object
    required:
      - perf_agg_config
    properties:
      perf_agg_config:
        $ref: '#/definitions/perf_agg_config_readwrite'
    title: modifyperf_agg_configRequest
    example:
      perf_agg_config:
        agg_level_array: ["string_value1","string_value2"]

  modifyperf_agg_configResponse:
    type: object
    required:
      - perf_agg_config
    properties:
      perf_agg_config:
        $ref: '#/definitions/perf_agg_config'
    title: modifyperf_agg_configResponse
    example:
      perf_agg_config:
        report_name: "ALL"
        agg_levels: "1"
        agg_level_array: ["string_value1","string_value2"]

  perf_agg_config_readwrite:
    type: object
    properties:
      agg_level_array:
        description: "Agg level in array"
        type: array
        items:
          type: string
          format: string

  perf_agg_config:
    allOf:
      -
        properties:
          report_name:
            description: Report name or ALL for all report
            type: string
            format: string
          agg_levels:
             description: "Aggregation Levels"
             type: string
             format: string
             maxLength: 4096
      - $ref: '#/definitions/perf_agg_config_readwrite'

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