swagger: '2.0'
info:
  description: Configuration for NetScaler Configuration Replicate resource.
  version: 'v2'
  title: ns_config_replicate
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_config_replicate
    description: NetScaler Configuration Replicate
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: source_device
   in: path
   type: string
   description: Source NetScaler IP Address
   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:
  /masvc/{customerid}/nitro/v2/config/ns_config_replicate/{source_device}:
    post:
      tags:
        - ns_config_replicate
      summary: POST operation with actions for ns_config_replicate
      operationId: post_ns_config_replicate_actions
      description: POST operation with actions for ns_config_replicate
      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: query
          name: action
          type: string
          required: true
          enum: [replicate]
          description: >
            actions:
              * `replicate` - 

        - in: body
          name: ns_config_replicate
          description: ns_config_replicate object
          schema:
              $ref: '#/definitions/addns_config_replicateRequest'
      responses:
        200:
          description: replicate for ns_config_replicate
          schema: 
              $ref: '#/definitions/addns_config_replicateResponse'
        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:
  addns_config_replicateRequest:
    type: object
    required:
      - ns_config_replicate
    properties:
      ns_config_replicate:
        $ref: '#/definitions/ns_config_replicate_readwrite'
    title: addns_config_replicateRequest
    example:
      ns_config_replicate:
        target_device: ["string_value1","string_value2"]

  addns_config_replicateResponse:
    type: object
    required:
      - ns_config_replicate
    properties:
      ns_config_replicate:
        $ref: '#/definitions/ns_config_replicate'
    title: addns_config_replicateResponse
    example:
      ns_config_replicate:
        source_device: "string_value"
        target_device: ["string_value1","string_value2"]

  ns_config_replicate_readwrite:
    type: object
    properties:
      target_device:
        description: "Target device IP Address Array on which replicate config from source device"
        type: array
        items:
          type: string
          format: IP Address

  ns_config_replicate:
    allOf:
      -
        properties:
          source_device:
            description: Source NetScaler IP Address
            type: string
            format: IP Address
      - $ref: '#/definitions/ns_config_replicate_readwrite'

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