swagger: '2.0'
info:
  description: Configuration for Device Backup  Policy resource.
  version: 'v2'
  title: device_backup_policy
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: device_backup_policy
    description: Device Backup  Policy
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/device_backup_policy:
    get:
      tags:
        - device_backup_policy
      summary: GET all device_backup_policy
      operationId: getall_device_backup_policy
      description: Use this operation to get the frequency of device backup
      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 device_backup_policy 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 device_backup_policy 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 device_backup_policy resources.
          enum:
            - yes
      responses:
        200:
          description:  for device_backup_policy
          schema: 
              $ref: '#/definitions/getdevice_backup_policysResponse'
        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:
  adddevice_backup_policyRequest:
    type: object
    required:
      - device_backup_policy
    properties:
      device_backup_policy:
        $ref: '#/definitions/device_backup_policy_readwrite'
    title: adddevice_backup_policyRequest
    example:
      device_backup_policy:
        backup_on_cfg_sav_trap: "false"
        backup_ontrap_delay: "60"
        sdx_backup_timeout: "10"
        encrypt_backup_file: "false"
        enable_scheduled_backups: "true"
        enable_external_transfer: "false"
        polling_interval: "12"
        backup_times: "20:45"
        number_of_backups: "3"
        is_interval_based: "true"
        enable_geodb_backups: "false"

  adddevice_backup_policyResponse:
    type: object
    required:
      - device_backup_policy
    properties:
      device_backup_policy:
        $ref: '#/definitions/device_backup_policy'
    title: adddevice_backup_policyResponse
    example:
      device_backup_policy:
        external_storage_info: {        parent_name: "string_value"
,        delete_from_svm: "boolean_value"
,        port: "integer_value"
,        parent_id: "string_value"
,        username: "string_value"
,        transfer_protocol: "string_value"
,        password: "string_value"
,        directory_path: "string_value"
,        id: "string_value"
,        server: "string_value"
}
        backup_on_cfg_sav_trap: "false"
        device_family: "ns"
        backup_ontrap_delay: "60"
        backup_password: "password"
        sdx_backup_timeout: "10"
        encrypt_backup_file: "false"
        enable_scheduled_backups: "true"
        enable_external_transfer: "false"
        polling_interval: "12"
        backup_times: "20:45"
        number_of_backups: "3"
        is_interval_based: "true"
        enable_geodb_backups: "false"

  getdevice_backup_policyResponse:
    type: object
    required:
      - device_backup_policy
    properties:
      device_backup_policy:
        $ref: '#/definitions/device_backup_policy'
    title: getdevice_backup_policyResponse
    example:
      device_backup_policy:
        external_storage_info: {        parent_name: "string_value"
,        delete_from_svm: "boolean_value"
,        port: "integer_value"
,        parent_id: "string_value"
,        username: "string_value"
,        transfer_protocol: "string_value"
,        password: "string_value"
,        directory_path: "string_value"
,        id: "string_value"
,        server: "string_value"
}
        backup_on_cfg_sav_trap: "false"
        device_family: "ns"
        backup_ontrap_delay: "60"
        backup_password: "password"
        sdx_backup_timeout: "10"
        encrypt_backup_file: "false"
        enable_scheduled_backups: "true"
        enable_external_transfer: "false"
        polling_interval: "12"
        backup_times: "20:45"
        number_of_backups: "3"
        is_interval_based: "true"
        enable_geodb_backups: "false"

  getdevice_backup_policysResponse:
    type: object
    required:
      - device_backup_policy
    properties:
      device_backup_policy:
        type: array
        items:
          $ref: '#/definitions/device_backup_policy'
    title: getdevice_backup_policysResponse
    example:
      device_backup_policy:
        external_storage_info: {        parent_name: "string_value"
,        delete_from_svm: "boolean_value"
,        port: "integer_value"
,        parent_id: "string_value"
,        username: "string_value"
,        transfer_protocol: "string_value"
,        password: "string_value"
,        directory_path: "string_value"
,        id: "string_value"
,        server: "string_value"
}
        backup_on_cfg_sav_trap: "false"
        device_family: "ns"
        backup_ontrap_delay: "60"
        backup_password: "password"
        sdx_backup_timeout: "10"
        encrypt_backup_file: "false"
        enable_scheduled_backups: "true"
        enable_external_transfer: "false"
        polling_interval: "12"
        backup_times: "20:45"
        number_of_backups: "3"
        is_interval_based: "true"
        enable_geodb_backups: "false"

  modifydevice_backup_policyRequest:
    type: object
    required:
      - device_backup_policy
    properties:
      device_backup_policy:
        $ref: '#/definitions/device_backup_policy_readwrite'
    title: modifydevice_backup_policyRequest
    example:
      device_backup_policy:
        backup_on_cfg_sav_trap: "false"
        backup_ontrap_delay: "60"
        sdx_backup_timeout: "10"
        encrypt_backup_file: "false"
        enable_scheduled_backups: "true"
        enable_external_transfer: "false"
        polling_interval: "12"
        backup_times: "20:45"
        number_of_backups: "3"
        is_interval_based: "true"
        enable_geodb_backups: "false"

  modifydevice_backup_policyResponse:
    type: object
    required:
      - device_backup_policy
    properties:
      device_backup_policy:
        $ref: '#/definitions/device_backup_policy'
    title: modifydevice_backup_policyResponse
    example:
      device_backup_policy:
        external_storage_info: {        parent_name: "string_value"
,        delete_from_svm: "boolean_value"
,        port: "integer_value"
,        parent_id: "string_value"
,        username: "string_value"
,        transfer_protocol: "string_value"
,        password: "string_value"
,        directory_path: "string_value"
,        id: "string_value"
,        server: "string_value"
}
        backup_on_cfg_sav_trap: "false"
        device_family: "ns"
        backup_ontrap_delay: "60"
        backup_password: "password"
        sdx_backup_timeout: "10"
        encrypt_backup_file: "false"
        enable_scheduled_backups: "true"
        enable_external_transfer: "false"
        polling_interval: "12"
        backup_times: "20:45"
        number_of_backups: "3"
        is_interval_based: "true"
        enable_geodb_backups: "false"

  device_backup_policy_readwrite:
    type: object
    properties:
      backup_on_cfg_sav_trap:
        description: "Backup on recieving NetscalerConfigSave trap"
        type: boolean
        format: boolean
      backup_ontrap_delay:
        description: "Delay in taking Backup on Receiving NetscalerConfigSave trap"
        type: integer
        format: int32
      sdx_backup_timeout:
        description: "Backup Timeout for SDX Backup"
        type: integer
        format: int32
      encrypt_backup_file:
        description: "Encrypts backup files"
        type: boolean
        format: boolean
      enable_scheduled_backups:
        description: "Enable Scheduled Backup (default is enabled)"
        type: boolean
        format: boolean
      enable_external_transfer:
        description: "Enable transfer of device backup files to external server"
        type: boolean
        format: boolean
      polling_interval:
        description: "Frequency of device backup in hours"
        type: integer
        format: int32
      backup_times:
        description: "Comma Separated string of backup times to be scheduled."
        type: string
        format: string
      number_of_backups:
        description: "Number of backup files maintained per device"
        type: integer
        format: int32
      is_interval_based:
        description: "Parameter to decide whether backup setting is interval based or time based"
        type: boolean
        format: boolean
      enable_geodb_backups:
        description: "Enable GeoDB Backup from NetScaler (default is disabled)"
        type: boolean
        format: boolean

  device_backup_policy:
    allOf:
      - $ref: '#/definitions/device_backup_policy_readwrite'

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