swagger: '2.0'
info:
  description: Configuration for System Settings resource.
  version: 'v2'
  title: system_settings
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: system_settings
    description: System Settings
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
   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/system_settings:
    get:
      tags:
        - system_settings
      summary: GET all system_settings
      operationId: getall_system_settings
      description: Use this operation to get system settings
      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 system_settings 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 system_settings 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 system_settings resources.
          enum:
            - yes
      responses:
        200:
          description:  for system_settings
          schema: 
              $ref: '#/definitions/getsystem_settingssResponse'
        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/system_settings/{id}:
    get:
      tags:
        - system_settings
      summary: GET by key for system_settings
      operationId: getbykey_system_settings
      description: Use this operation to get system settings
      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:  for system_settings
          schema: 
              $ref: '#/definitions/getsystem_settingsResponse'
        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:
        - system_settings
      summary: PUT for system_settings
      operationId: putbykey_system_settings
      description: Use this operation to modify system settings
      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: system_settings
          description: system_settings object
          schema:
              $ref: '#/definitions/modifysystem_settingsRequest'
      responses:
        200:
          description:  for system_settings
          schema: 
              $ref: '#/definitions/modifysystem_settingsResponse'
        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:
  getsystem_settingsResponse:
    type: object
    required:
      - system_settings
    properties:
      system_settings:
        $ref: '#/definitions/system_settings'
    title: getsystem_settingsResponse
    example:
      system_settings:
        prompt_creds_for_stylebooks: "false"
        svm_ns_comm: "https"
        keep_adc_image_count: "2"
        disable_agent_old_password_input: "false"
        session_timeout: "15"
        session_timeout_unit: "Minutes"
        enable_nsrecover_login: "true"
        inventoryrefreshinterval: "360"
        enable_session_timeout: "false"
        port_model: "0"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ns_br_interface: "string_value"
        enable_certificate_download: "true"
        authorize_deviceapiproxy: "false"
        disk_utilization_threshold: "80"
        keep_alive_ping_interval: "50"
        init_status: "0"
        enable_apiproxy_credentials: "false"
        ns_br_interface_2: "string_value"
        heartbeatinterval: "280"
        enable_shell_access: "true"
        basicauth: "true"
        secure_access_only: "false"
        enable_cuxip: "true"
        vm_auto_poweron: "true"
        is_metering_enabled: "true"
        enable_delete_interface_on_adc: "false"
        act_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        sync_operation: "true"
        reset: "false"

  getsystem_settingssResponse:
    type: object
    required:
      - system_settings
    properties:
      system_settings:
        type: array
        items:
          $ref: '#/definitions/system_settings'
    title: getsystem_settingssResponse
    example:
      system_settings:
        prompt_creds_for_stylebooks: "false"
        svm_ns_comm: "https"
        keep_adc_image_count: "2"
        disable_agent_old_password_input: "false"
        session_timeout: "15"
        session_timeout_unit: "Minutes"
        enable_nsrecover_login: "true"
        inventoryrefreshinterval: "360"
        enable_session_timeout: "false"
        port_model: "0"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ns_br_interface: "string_value"
        enable_certificate_download: "true"
        authorize_deviceapiproxy: "false"
        disk_utilization_threshold: "80"
        keep_alive_ping_interval: "50"
        init_status: "0"
        enable_apiproxy_credentials: "false"
        ns_br_interface_2: "string_value"
        heartbeatinterval: "280"
        enable_shell_access: "true"
        basicauth: "true"
        secure_access_only: "false"
        enable_cuxip: "true"
        vm_auto_poweron: "true"
        is_metering_enabled: "true"
        enable_delete_interface_on_adc: "false"
        act_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        sync_operation: "true"
        reset: "false"

  modifysystem_settingsRequest:
    type: object
    required:
      - system_settings
    properties:
      system_settings:
        $ref: '#/definitions/system_settings_readwrite'
    title: modifysystem_settingsRequest
    example:
      system_settings:
        prompt_creds_for_stylebooks: "false"
        svm_ns_comm: "https"
        keep_adc_image_count: "2"
        disable_agent_old_password_input: "false"
        session_timeout: "15"
        session_timeout_unit: "Minutes"
        enable_nsrecover_login: "true"
        inventoryrefreshinterval: "360"
        enable_session_timeout: "false"
        enable_certificate_download: "true"
        authorize_deviceapiproxy: "false"
        disk_utilization_threshold: "80"
        keep_alive_ping_interval: "50"
        enable_apiproxy_credentials: "false"
        heartbeatinterval: "280"
        enable_shell_access: "true"
        basicauth: "true"
        secure_access_only: "false"
        enable_cuxip: "true"
        is_metering_enabled: "true"
        enable_delete_interface_on_adc: "false"

  modifysystem_settingsResponse:
    type: object
    required:
      - system_settings
    properties:
      system_settings:
        $ref: '#/definitions/system_settings'
    title: modifysystem_settingsResponse
    example:
      system_settings:
        prompt_creds_for_stylebooks: "false"
        svm_ns_comm: "https"
        keep_adc_image_count: "2"
        disable_agent_old_password_input: "false"
        session_timeout: "15"
        session_timeout_unit: "Minutes"
        enable_nsrecover_login: "true"
        inventoryrefreshinterval: "360"
        enable_session_timeout: "false"
        port_model: "0"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ns_br_interface: "string_value"
        enable_certificate_download: "true"
        authorize_deviceapiproxy: "false"
        disk_utilization_threshold: "80"
        keep_alive_ping_interval: "50"
        init_status: "0"
        enable_apiproxy_credentials: "false"
        ns_br_interface_2: "string_value"
        heartbeatinterval: "280"
        enable_shell_access: "true"
        basicauth: "true"
        secure_access_only: "false"
        enable_cuxip: "true"
        vm_auto_poweron: "true"
        is_metering_enabled: "true"
        enable_delete_interface_on_adc: "false"
        act_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        sync_operation: "true"
        reset: "false"

  system_settings_readwrite:
    type: object
    properties:
      prompt_creds_for_stylebooks:
        description: "Prompt Credentials for Stylebooks"
        type: boolean
        format: boolean
      svm_ns_comm:
        description: "Communication with Instances"
        type: string
        format: string
        minLength: 1
        maxLength: 10
      keep_adc_image_count:
        description: "Count for number of NetScaler images to be saved in Agent"
        type: integer
        format: int32
      disable_agent_old_password_input:
        description: "Disable old password input requirement while changing NetScaler Agent password"
        type: boolean
        format: boolean
      session_timeout:
        description: "Session timeout for the system"
        type: integer
        format: int32
      session_timeout_unit:
        description: "Session timeout unit for the system"
        type: string
        format: string
      enable_nsrecover_login:
        description: "This setting enalbes nsrecover login for SVM"
        type: boolean
        format: boolean
      inventoryrefreshinterval:
        description: "Client inventory refresh interval in minutes"
        type: integer
        format: int32
      enable_session_timeout:
        description: "Enables session timeout feature"
        type: boolean
        format: boolean
      enable_certificate_download:
        description: "Enable Certificate Download"
        type: boolean
        format: boolean
      authorize_deviceapiproxy:
        description: "Authorize the DeviceAPIProxy request"
        type: boolean
        format: boolean
      disk_utilization_threshold:
        description: "Disk utilization threshold after which data processing it stopped"
        type: integer
        format: int32
      keep_alive_ping_interval:
        description: "Agent web socket keep alive ping interval for the system"
        type: integer
        format: int32
      enable_apiproxy_credentials:
        description: "Enable API Proxy Credentials"
        type: boolean
        format: boolean
      heartbeatinterval:
        description: "Client heart beat interval in seconds"
        type: integer
        format: int32
      enable_shell_access:
        description: "Enable Shell access for non-nsroot User(s)"
        type: boolean
        format: boolean
      basicauth:
        description: "Allow Basic Authentication Protocol"
        type: boolean
        format: boolean
      secure_access_only:
        description: "Secure Access only"
        type: boolean
        format: boolean
      enable_cuxip:
        description: "Used to enable/disable CUXIP(Customer User Experience Improvement Program)"
        type: boolean
        format: boolean
      is_metering_enabled:
        description: "Enable Metering for NetScaler VPX on SDX"
        type: boolean
        format: boolean
      enable_delete_interface_on_adc:
        description: "Flag to enable/disable deleting interface from ADCs on SDX"
        type: boolean
        format: boolean

  system_settings:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key
            type: string
            format: string
          port_model:
             description: "Port Model for BR instance"
             type: integer
             format: int32
          act_id:
             description: "Activity Id"
             type: string
             format: string
      - $ref: '#/definitions/system_settings_readwrite'

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