swagger: '2.0'
info:
  description: Configuration for Auto-Scale Group configuration/stylebook parameters resource.
  version: 'v2'
  title: autoscalegroup_config
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: autoscalegroup_config
    description: Auto-Scale Group configuration/stylebook parameters
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 for all the auto-scale group config
   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/autoscalegroup_config:
    get:
      tags:
        - autoscalegroup_config
      summary: GET all autoscalegroup_config
      operationId: getall_autoscalegroup_config
      description: Use this operation to get auto-scale group configurations
      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 autoscalegroup_config 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 autoscalegroup_config 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 autoscalegroup_config resources.
          enum:
            - yes
      responses:
        200:
          description:  for autoscalegroup_config
          schema: 
              $ref: '#/definitions/getautoscalegroup_configsResponse'
        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:
        - autoscalegroup_config
      summary: POST operation for autoscalegroup_config
      operationId: post_autoscalegroup_config
      description: POST operation for autoscalegroup_config
      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: autoscalegroup_config
          description: autoscalegroup_config object
          schema:
              $ref: '#/definitions/addautoscalegroup_configRequest'
      responses:
        200:
          description: add for autoscalegroup_config
          schema: 
              $ref: '#/definitions/addautoscalegroup_configResponse'
        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/autoscalegroup_config/{id}:
    get:
      tags:
        - autoscalegroup_config
      summary: GET by key for autoscalegroup_config
      operationId: getbykey_autoscalegroup_config
      description: Use this operation to get auto-scale group configurations
      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 autoscalegroup_config
          schema: 
              $ref: '#/definitions/getautoscalegroup_configResponse'
        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:
        - autoscalegroup_config
      summary: PUT for autoscalegroup_config
      operationId: putbykey_autoscalegroup_config
      description: Use this operation to modify auto-scale group configurations
      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: autoscalegroup_config
          description: autoscalegroup_config object
          schema:
              $ref: '#/definitions/modifyautoscalegroup_configRequest'
      responses:
        200:
          description: add for autoscalegroup_config
          schema: 
              $ref: '#/definitions/modifyautoscalegroup_configResponse'
        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:
        - autoscalegroup_config
      summary: Delete for autoscalegroup_config
      operationId: deletebykey_autoscalegroup_config
      description: Use this operation to delete auto-scale group configurations
      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 autoscalegroup_config
        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:
  addautoscalegroup_configRequest:
    type: object
    required:
      - autoscalegroup_config
    properties:
      autoscalegroup_config:
        $ref: '#/definitions/autoscalegroup_config_readwrite'
    title: addautoscalegroup_configRequest
    example:
      autoscalegroup_config:
        generated_domain_name: "backstage"
        autoscalegroup_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        zone_name: "citrix.com"
        app_name: "new_vip"
        ipset_name: "testasg_ipset"
        backend_port: "1025"
        is_https_redirect: "f"
        probe_port: "80"
        url: "com.citrix.adc.stylebooks/1.1/lb"
        probe_protocol: "HTTP"
        stylebook_name: "lb"
        ip_address: "1.1.1.1"
        frontend_ip: "1.1.1.1"
        last_modified_time: "number_value"
        backend_http_redirect_port: "21025"
        service_type: "HTTP"
        activity_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        version: "1.1"
        backend_probe_port: "11025"
        redirect_port: "80"
        access_type: "0"
        virtual_port: "443"
        domain_name: "backstage"
        is_endpoint: "f"
        frontend_name: "forntend_app"
        configpack_id: "12345678"
        force_delete: "f"
        autoscalegroup_name: "autoscale_name"
        stylebook_params: "com.citrix.adc.stylebooks/1.1/lb"
        stylebook_namespace: "com.citrix.adc.stylebooks"
        is_migration: "f"
        probe_enabled: "f"

  addautoscalegroup_configResponse:
    type: object
    required:
      - autoscalegroup_config
    properties:
      autoscalegroup_config:
        $ref: '#/definitions/autoscalegroup_config'
    title: addautoscalegroup_configResponse
    example:
      autoscalegroup_config:
        generated_domain_name: "backstage"
        autoscalegroup_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        state: "ASG_APP_DEPLOY_SUCCESS"
        zone_name: "citrix.com"
        app_name: "new_vip"
        ipset_name: "testasg_ipset"
        backend_port: "1025"
        is_https_redirect: "f"
        probe_port: "80"
        url: "com.citrix.adc.stylebooks/1.1/lb"
        probe_protocol: "HTTP"
        stylebook_name: "lb"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ip_address: "1.1.1.1"
        frontend_ip: "1.1.1.1"
        last_modified_time: "number_value"
        backend_http_redirect_port: "21025"
        service_type: "HTTP"
        activity_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        version: "1.1"
        backend_probe_port: "11025"
        redirect_port: "80"
        access_type: "0"
        virtual_port: "443"
        domain_name: "backstage"
        is_endpoint: "f"
        frontend_name: "forntend_app"
        configpack_id: "12345678"
        force_delete: "f"
        autoscalegroup_name: "autoscale_name"
        stylebook_params: "com.citrix.adc.stylebooks/1.1/lb"
        stylebook_namespace: "com.citrix.adc.stylebooks"
        is_migration: "f"
        probe_enabled: "f"

  getautoscalegroup_configResponse:
    type: object
    required:
      - autoscalegroup_config
    properties:
      autoscalegroup_config:
        $ref: '#/definitions/autoscalegroup_config'
    title: getautoscalegroup_configResponse
    example:
      autoscalegroup_config:
        generated_domain_name: "backstage"
        autoscalegroup_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        state: "ASG_APP_DEPLOY_SUCCESS"
        zone_name: "citrix.com"
        app_name: "new_vip"
        ipset_name: "testasg_ipset"
        backend_port: "1025"
        is_https_redirect: "f"
        probe_port: "80"
        url: "com.citrix.adc.stylebooks/1.1/lb"
        probe_protocol: "HTTP"
        stylebook_name: "lb"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ip_address: "1.1.1.1"
        frontend_ip: "1.1.1.1"
        last_modified_time: "number_value"
        backend_http_redirect_port: "21025"
        service_type: "HTTP"
        activity_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        version: "1.1"
        backend_probe_port: "11025"
        redirect_port: "80"
        access_type: "0"
        virtual_port: "443"
        domain_name: "backstage"
        is_endpoint: "f"
        frontend_name: "forntend_app"
        configpack_id: "12345678"
        force_delete: "f"
        autoscalegroup_name: "autoscale_name"
        stylebook_params: "com.citrix.adc.stylebooks/1.1/lb"
        stylebook_namespace: "com.citrix.adc.stylebooks"
        is_migration: "f"
        probe_enabled: "f"

  getautoscalegroup_configsResponse:
    type: object
    required:
      - autoscalegroup_config
    properties:
      autoscalegroup_config:
        type: array
        items:
          $ref: '#/definitions/autoscalegroup_config'
    title: getautoscalegroup_configsResponse
    example:
      autoscalegroup_config:
        generated_domain_name: "backstage"
        autoscalegroup_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        state: "ASG_APP_DEPLOY_SUCCESS"
        zone_name: "citrix.com"
        app_name: "new_vip"
        ipset_name: "testasg_ipset"
        backend_port: "1025"
        is_https_redirect: "f"
        probe_port: "80"
        url: "com.citrix.adc.stylebooks/1.1/lb"
        probe_protocol: "HTTP"
        stylebook_name: "lb"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ip_address: "1.1.1.1"
        frontend_ip: "1.1.1.1"
        last_modified_time: "number_value"
        backend_http_redirect_port: "21025"
        service_type: "HTTP"
        activity_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        version: "1.1"
        backend_probe_port: "11025"
        redirect_port: "80"
        access_type: "0"
        virtual_port: "443"
        domain_name: "backstage"
        is_endpoint: "f"
        frontend_name: "forntend_app"
        configpack_id: "12345678"
        force_delete: "f"
        autoscalegroup_name: "autoscale_name"
        stylebook_params: "com.citrix.adc.stylebooks/1.1/lb"
        stylebook_namespace: "com.citrix.adc.stylebooks"
        is_migration: "f"
        probe_enabled: "f"

  modifyautoscalegroup_configRequest:
    type: object
    required:
      - autoscalegroup_config
    properties:
      autoscalegroup_config:
        $ref: '#/definitions/autoscalegroup_config_readwrite'
    title: modifyautoscalegroup_configRequest
    example:
      autoscalegroup_config:
        generated_domain_name: "backstage"
        autoscalegroup_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        zone_name: "citrix.com"
        app_name: "new_vip"
        ipset_name: "testasg_ipset"
        backend_port: "1025"
        is_https_redirect: "f"
        probe_port: "80"
        url: "com.citrix.adc.stylebooks/1.1/lb"
        probe_protocol: "HTTP"
        stylebook_name: "lb"
        ip_address: "1.1.1.1"
        frontend_ip: "1.1.1.1"
        last_modified_time: "number_value"
        backend_http_redirect_port: "21025"
        service_type: "HTTP"
        activity_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        version: "1.1"
        backend_probe_port: "11025"
        redirect_port: "80"
        access_type: "0"
        virtual_port: "443"
        domain_name: "backstage"
        is_endpoint: "f"
        frontend_name: "forntend_app"
        configpack_id: "12345678"
        force_delete: "f"
        autoscalegroup_name: "autoscale_name"
        stylebook_params: "com.citrix.adc.stylebooks/1.1/lb"
        stylebook_namespace: "com.citrix.adc.stylebooks"
        is_migration: "f"
        probe_enabled: "f"

  modifyautoscalegroup_configResponse:
    type: object
    required:
      - autoscalegroup_config
    properties:
      autoscalegroup_config:
        $ref: '#/definitions/autoscalegroup_config'
    title: modifyautoscalegroup_configResponse
    example:
      autoscalegroup_config:
        generated_domain_name: "backstage"
        autoscalegroup_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        state: "ASG_APP_DEPLOY_SUCCESS"
        zone_name: "citrix.com"
        app_name: "new_vip"
        ipset_name: "testasg_ipset"
        backend_port: "1025"
        is_https_redirect: "f"
        probe_port: "80"
        url: "com.citrix.adc.stylebooks/1.1/lb"
        probe_protocol: "HTTP"
        stylebook_name: "lb"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        ip_address: "1.1.1.1"
        frontend_ip: "1.1.1.1"
        last_modified_time: "number_value"
        backend_http_redirect_port: "21025"
        service_type: "HTTP"
        activity_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        version: "1.1"
        backend_probe_port: "11025"
        redirect_port: "80"
        access_type: "0"
        virtual_port: "443"
        domain_name: "backstage"
        is_endpoint: "f"
        frontend_name: "forntend_app"
        configpack_id: "12345678"
        force_delete: "f"
        autoscalegroup_name: "autoscale_name"
        stylebook_params: "com.citrix.adc.stylebooks/1.1/lb"
        stylebook_namespace: "com.citrix.adc.stylebooks"
        is_migration: "f"
        probe_enabled: "f"

  autoscalegroup_config_readwrite:
    type: object
    properties:
      generated_domain_name:
        description: "Name of generated domain"
        type: string
        format: string
        minLength: 1
        maxLength: 40
      autoscalegroup_id:
        description: "ID of autoscalegroup"
        type: string
        format: uuid
      zone_name:
        description: "Name of zone"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      app_name:
        description: "Name of application"
        type: string
        format: string
        minLength: 1
        maxLength: 256
      ipset_name:
        description: "Name of IPSet"
        type: string
        format: string
      backend_port:
        description: "Backend Port"
        type: integer
        format: int32
      is_https_redirect:
        description: "Enabled for https redirect"
        type: boolean
        format: boolean
      probe_port:
        description: "Probe Port"
        type: integer
        format: int32
      url:
        description: "Stylebook URL which has namespace, version and stylebook_name"
        type: string
        format: string
        minLength: 1
        maxLength: 256
      probe_protocol:
        description: "Probe Protocol"
        type: string
        format: string
        minLength: 1
        maxLength: 64
      stylebook_name:
        description: "Stylebook Name"
        type: string
        format: string
        minLength: 1
        maxLength: 64
      ip_address:
        description: "IP of VIP"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      frontend_ip:
        description: "The frontend IP of Azure ALB applications"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      last_modified_time:
        description: "last modified time in seconds"
        type: number
        format: double
      backend_http_redirect_port:
        description: "Backend HTTP Redirect Port"
        type: integer
        format: int32
      service_type:
        description: "Service Type"
        type: string
        format: string
        minLength: 1
        maxLength: 64
      activity_id:
        description: "Most recent activity_id of this autoscalegroup config"
        type: string
        format: uuid
        maxLength: 128
      version:
        description: "Stylebook version"
        type: string
        format: string
        minLength: 1
        maxLength: 16
      backend_probe_port:
        description: "Backend Probe Port"
        type: integer
        format: int32
      redirect_port:
        description: "redirect_port"
        type: integer
        format: int32
      access_type:
        description: "Access Type (0.External(public)/1.Internal(private)/2.None)"
        type: integer
        format: int32
      virtual_port:
        description: "Virtual Port"
        type: integer
        format: int32
      domain_name:
        description: "Name of domain"
        type: string
        format: string
        minLength: 1
        maxLength: 256
      is_endpoint:
        description: "Enabled for End Point Application"
        type: boolean
        format: boolean
      frontend_name:
        description: "The frontend name of application"
        type: string
        format: string
        minLength: 1
        maxLength: 256
      configpack_id:
        description: "ID of deployed configpack on autoscalegroup"
        type: string
        format: string
        minLength: 1
        maxLength: 64
      force_delete:
        description: "Option to delete the configpack forcefully"
        type: boolean
        format: boolean
      autoscalegroup_name:
        description: "Name of autoscalegroup"
        type: string
        format: uuid
      stylebook_params:
        description: "Inlcudes all the Stylebook parameters"
        type: string
        format: string
      stylebook_namespace:
        description: "Stylebook Namespace"
        type: string
        format: string
      is_migration:
        description: "Enabled for configpack migration"
        type: boolean
        format: boolean
      probe_enabled:
        description: "This flag is set to true if the NetScaler version (13.0.76.0 and above) has support for probe port and protocol"
        type: boolean
        format: boolean

  autoscalegroup_config:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the auto-scale group config
            type: string
            format: uuid
      - $ref: '#/definitions/autoscalegroup_config_readwrite'

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