swagger: '2.0'
info:
  description: Configuration for Af datarecord logging enable or disable resource.
  version: 'v2'
  title: log_datarecord
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: log_datarecord
    description: Af datarecord logging enable or disable
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  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/log_datarecord:
    get:
      tags:
        - log_datarecord
      summary: GET all log_datarecord
      operationId: getall_log_datarecord
      description: To get data record logging value
      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 log_datarecord 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 log_datarecord 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 log_datarecord resources.
          enum:
            - yes
      responses:
        200:
          description:  for log_datarecord
          schema: 
              $ref: '#/definitions/getlog_datarecordsResponse'
        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:
        - log_datarecord
      summary: POST operation for log_datarecord
      operationId: post_log_datarecord
      description: POST operation for log_datarecord
      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: log_datarecord
          description: log_datarecord object
          schema:
              $ref: '#/definitions/addlog_datarecordRequest'
      responses:
        200:
          description: add for log_datarecord
          schema: 
              $ref: '#/definitions/addlog_datarecordResponse'
        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:
  addlog_datarecordRequest:
    type: object
    required:
      - log_datarecord
    properties:
      log_datarecord:
        $ref: '#/definitions/log_datarecord_readwrite'
    title: addlog_datarecordRequest
    example:
      log_datarecord:
        cbwan: "true"
        web: "true"
        hdx: "true"
        security: "true"

  addlog_datarecordResponse:
    type: object
    required:
      - log_datarecord
    properties:
      log_datarecord:
        $ref: '#/definitions/log_datarecord'
    title: addlog_datarecordResponse
    example:
      log_datarecord:
        cbwan: "true"
        web: "true"
        hdx: "true"
        security: "true"

  getlog_datarecordResponse:
    type: object
    required:
      - log_datarecord
    properties:
      log_datarecord:
        $ref: '#/definitions/log_datarecord'
    title: getlog_datarecordResponse
    example:
      log_datarecord:
        cbwan: "true"
        web: "true"
        hdx: "true"
        security: "true"

  getlog_datarecordsResponse:
    type: object
    required:
      - log_datarecord
    properties:
      log_datarecord:
        type: array
        items:
          $ref: '#/definitions/log_datarecord'
    title: getlog_datarecordsResponse
    example:
      log_datarecord:
        cbwan: "true"
        web: "true"
        hdx: "true"
        security: "true"

  modifylog_datarecordRequest:
    type: object
    required:
      - log_datarecord
    properties:
      log_datarecord:
        $ref: '#/definitions/log_datarecord_readwrite'
    title: modifylog_datarecordRequest
    example:
      log_datarecord:
        cbwan: "true"
        web: "true"
        hdx: "true"
        security: "true"

  modifylog_datarecordResponse:
    type: object
    required:
      - log_datarecord
    properties:
      log_datarecord:
        $ref: '#/definitions/log_datarecord'
    title: modifylog_datarecordResponse
    example:
      log_datarecord:
        cbwan: "true"
        web: "true"
        hdx: "true"
        security: "true"

  log_datarecord_readwrite:
    type: object
    properties:
      cbwan:
        description: "Enable NetScaler SD-WAN wan insight data record logging value"
        type: boolean
        format: boolean
      web:
        description: "Enable web insight data record logging value"
        type: boolean
        format: boolean
      hdx:
        description: "Enable hdx insight data record logging value"
        type: boolean
        format: boolean
      security:
        description: "Enable security insight data record logging value"
        type: boolean
        format: boolean

  log_datarecord:
    allOf:
      - $ref: '#/definitions/log_datarecord_readwrite'

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