swagger: '2.0'
info:
  description: Configuration for CSV Export resource.
  version: 'v2'
  title: csv_export
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: csv_export
    description: CSV Export
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is CSV export Id
   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/csv_export:
    get:
      tags:
        - csv_export
      summary: GET all csv_export
      operationId: getall_csv_export
      description: Use this operation to get CSV Export
      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 csv_export 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 csv_export 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 csv_export resources.
          enum:
            - yes
      responses:
        200:
          description:  for csv_export
          schema: 
              $ref: '#/definitions/getcsv_exportsResponse'
        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:
        - csv_export
      summary: POST operation for csv_export
      operationId: post_csv_export
      description: POST operation for csv_export
      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: csv_export
          description: csv_export object
          schema:
              $ref: '#/definitions/addcsv_exportRequest'
      responses:
        200:
          description: add for csv_export
          schema: 
              $ref: '#/definitions/addcsv_exportResponse'
        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/csv_export/{id}:
    get:
      tags:
        - csv_export
      summary: GET by key for csv_export
      operationId: getbykey_csv_export
      description: Use this operation to get CSV Export
      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 csv_export
          schema: 
              $ref: '#/definitions/getcsv_exportResponse'
        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:
        - csv_export
      summary: Delete for csv_export
      operationId: deletebykey_csv_export
      description: Use this operation to delete  CSV Export
      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 csv_export
        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:
  addcsv_exportRequest:
    type: object
    required:
      - csv_export
    properties:
      csv_export:
        $ref: '#/definitions/csv_export_readwrite'
    title: addcsv_exportRequest
    example:
      csv_export:
        report_end_time: "number_value"
        order_by: "string_value"
        args: "string_value"
        pageno: "1"
        report_start_time: "number_value"
        resource_id: "string_value"
        asc: "string_value"
        duration_summary: "string_value"
        graphql_variable: "string_value"
        section_title: "string_value"
        attrs: "string_value"
        is_count: "string_value"
        report_type: "string_value"
        filter: "string_value"
        detailview: "string_value"
        duration: "last_1_day"
        graphql_query: "string_value"
        cr_enabled: "string_value"
        sla_enabled: "string_value"
        type: "Text Field"
        resource_name: "nsroot"
        pagesize: "5000"
        csv_mapping_id: "string_value"

  addcsv_exportResponse:
    type: object
    required:
      - csv_export
    properties:
      csv_export:
        $ref: '#/definitions/csv_export'
    title: addcsv_exportResponse
    example:
      csv_export:
        report_end_time: "number_value"
        order_by: "string_value"
        args: "string_value"
        pageno: "1"
        report_start_time: "number_value"
        resource_id: "string_value"
        asc: "string_value"
        duration_summary: "string_value"
        graphql_variable: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        section_title: "string_value"
        attrs: "string_value"
        is_count: "string_value"
        report_type: "string_value"
        filter: "string_value"
        detailview: "string_value"
        duration: "last_1_day"
        graphql_query: "string_value"
        cr_enabled: "string_value"
        sla_enabled: "string_value"
        type: "Text Field"
        resource_name: "nsroot"
        pagesize: "5000"
        csv_mapping_id: "string_value"

  getcsv_exportResponse:
    type: object
    required:
      - csv_export
    properties:
      csv_export:
        $ref: '#/definitions/csv_export'
    title: getcsv_exportResponse
    example:
      csv_export:
        report_end_time: "number_value"
        order_by: "string_value"
        args: "string_value"
        pageno: "1"
        report_start_time: "number_value"
        resource_id: "string_value"
        asc: "string_value"
        duration_summary: "string_value"
        graphql_variable: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        section_title: "string_value"
        attrs: "string_value"
        is_count: "string_value"
        report_type: "string_value"
        filter: "string_value"
        detailview: "string_value"
        duration: "last_1_day"
        graphql_query: "string_value"
        cr_enabled: "string_value"
        sla_enabled: "string_value"
        type: "Text Field"
        resource_name: "nsroot"
        pagesize: "5000"
        csv_mapping_id: "string_value"

  getcsv_exportsResponse:
    type: object
    required:
      - csv_export
    properties:
      csv_export:
        type: array
        items:
          $ref: '#/definitions/csv_export'
    title: getcsv_exportsResponse
    example:
      csv_export:
        report_end_time: "number_value"
        order_by: "string_value"
        args: "string_value"
        pageno: "1"
        report_start_time: "number_value"
        resource_id: "string_value"
        asc: "string_value"
        duration_summary: "string_value"
        graphql_variable: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        section_title: "string_value"
        attrs: "string_value"
        is_count: "string_value"
        report_type: "string_value"
        filter: "string_value"
        detailview: "string_value"
        duration: "last_1_day"
        graphql_query: "string_value"
        cr_enabled: "string_value"
        sla_enabled: "string_value"
        type: "Text Field"
        resource_name: "nsroot"
        pagesize: "5000"
        csv_mapping_id: "string_value"

  csv_export_readwrite:
    type: object
    properties:
      report_end_time:
        description: "Report end time."
        type: number
        format: int64
      order_by:
        description: "Order By"
        type: string
        format: string
        maxLength: 32
      args:
        description: "args"
        type: string
        format: string
      pageno:
        description: "Page no."
        type: integer
        format: int32
      report_start_time:
        description: "Report start time."
        type: number
        format: int64
      resource_id:
        description: "Resource id"
        type: string
        format: string
        maxLength: 512
      asc:
        description: "asc"
        type: string
        format: string
        maxLength: 32
      duration_summary:
        description: "Duration summary."
        type: string
        format: string
        maxLength: 16
      graphql_variable:
        description: "GraphQL query variable for export"
        type: string
        format: string
      section_title:
        description: "Section title"
        type: string
        format: string
        maxLength: 512
      attrs:
        description: "attrs"
        type: string
        format: string
      is_count:
        description: "is_count"
        type: string
        format: string
        maxLength: 32
      report_type:
        description: "report_type 'active' in case active report"
        type: string
        format: string
      filter:
        description: "filter"
        type: string
        format: string
      detailview:
        description: "detailview"
        type: string
        format: string
        maxLength: 64
      duration:
        description: "Duration"
        type: string
        format: string
        maxLength: 64
      graphql_query:
        description: "GraphQL query for export"
        type: string
        format: string
      cr_enabled:
        description: "CR Enabled."
        type: string
        format: string
        maxLength: 16
      sla_enabled:
        description: "SLA Enabled."
        type: string
        format: string
        maxLength: 16
      type:
        description: "Type"
        type: string
        format: string
        maxLength: 32
      resource_name:
        description: "Resource name"
        type: string
        format: string
        minLength: 1
        maxLength: 255
      pagesize:
        description: "Page size"
        type: integer
        format: int32
      csv_mapping_id:
        description: "Schedule export csv_mapping_id"
        type: string
        format: string
        maxLength: 32

  csv_export:
    allOf:
      -
        properties:
          id:
            description: Id is CSV export Id
            type: string
            format: string
      - $ref: '#/definitions/csv_export_readwrite'

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