swagger: '2.0'
info:
  description: Configuration for NetScaler Console License Information resource.
  version: 'v2'
  title: mas_license
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: mas_license
    description: NetScaler Console License Information
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/mas_license:
    get:
      tags:
        - mas_license
      summary: GET all mas_license
      operationId: getall_mas_license
      description: Use this operation to get NetScaler Console license information
      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 mas_license 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 mas_license 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 mas_license resources.
          enum:
            - yes
      responses:
        200:
          description:  for mas_license
          schema: 
              $ref: '#/definitions/getmas_licensesResponse'
        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/mas_license/{id}:
    get:
      tags:
        - mas_license
      summary: GET by key for mas_license
      operationId: getbykey_mas_license
      description: Use this operation to get NetScaler Console license information
      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 mas_license
          schema: 
              $ref: '#/definitions/getmas_licenseResponse'
        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:
        - mas_license
      summary: PUT for mas_license
      operationId: putbykey_mas_license
      description: Use this operation to enable/disable NetScaler Console system features
      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: mas_license
          description: mas_license object
          schema:
              $ref: '#/definitions/modifymas_licenseRequest'
      responses:
        200:
          description:  for mas_license
          schema: 
              $ref: '#/definitions/modifymas_licenseResponse'
        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:
  getmas_licenseResponse:
    type: object
    required:
      - mas_license
    properties:
      mas_license:
        $ref: '#/definitions/mas_license'
    title: getmas_licenseResponse
    example:
      mas_license:
        vcpu_lic: "1"
        max_vips_val: "10"
        adv_analytics: "1"
        perf: "3"
        tenantnslictype: "CPL, CUL"
        node_id: "a2f7a85e-f388-4d2d-ae0e-646b4f66797e"
        id: "a2f7a85e-f388-4d2d-ae0e-646b4f66797e"
        snmp_traps: "3"
        cpx_lic: "1"
        lic_type: "0"
        max_vips: "10"
        max_storage: "0"
        analytics: "3"
        fips_bw_lic: "1"
        upgrade_time: "1632242070"
        mhc_lic: "0"
        syslog: "3"
        max_tp_vservers: "10"
        vpx_lic: "1"
        fips_vcpu_lic: "0"
        rpt_sampletime: "1580906346"
        pooled_lic: "1"
        ns_vpnvserver_managed_count: "0"
        total_managed_tp_vservers: "30"
        vpx_rule_max_limit: "0"
        entitled_db_storage: "0"
        ns_vpnvserver_count: "0"
        total_managed_vips: "30"
        total_allowed_tp_vservers: "30"
        ns_crvserver_count: "0"
        ns_lbvserver_count: "3"
        ns_csvserver_managed_count: "0"
        get_consumed_db: "false"
        ns_gslbvserver_managed_count: "0"
        ns_authenticationvserver_managed_count: "0"
        ns_authenticationvserver_count: "0"
        total_licenses_consumed: "0"
        cpx_rule_licensed_count: "0"
        ns_gslbvserver_count: "0"
        ns_lbvserver_managed_count: "0"
        ns_csvserver_count: "0"
        total_discovered_vips: "30"
        ns_crvserver_managed_count: "0"
        auto_licensed_count: "0"
        manual_licensed_count: "0"
        consumed_db_storage: "0"
        vpx_rule_licensed_count: "0"
        total_allowed_vips: "30"
        cpx_rule_max_limit: "0"
        total_discovered_tp_vservers: "30"

  getmas_licensesResponse:
    type: object
    required:
      - mas_license
    properties:
      mas_license:
        type: array
        items:
          $ref: '#/definitions/mas_license'
    title: getmas_licensesResponse
    example:
      mas_license:
        vcpu_lic: "1"
        max_vips_val: "10"
        adv_analytics: "1"
        perf: "3"
        tenantnslictype: "CPL, CUL"
        node_id: "a2f7a85e-f388-4d2d-ae0e-646b4f66797e"
        id: "a2f7a85e-f388-4d2d-ae0e-646b4f66797e"
        snmp_traps: "3"
        cpx_lic: "1"
        lic_type: "0"
        max_vips: "10"
        max_storage: "0"
        analytics: "3"
        fips_bw_lic: "1"
        upgrade_time: "1632242070"
        mhc_lic: "0"
        syslog: "3"
        max_tp_vservers: "10"
        vpx_lic: "1"
        fips_vcpu_lic: "0"
        rpt_sampletime: "1580906346"
        pooled_lic: "1"
        ns_vpnvserver_managed_count: "0"
        total_managed_tp_vservers: "30"
        vpx_rule_max_limit: "0"
        entitled_db_storage: "0"
        ns_vpnvserver_count: "0"
        total_managed_vips: "30"
        total_allowed_tp_vservers: "30"
        ns_crvserver_count: "0"
        ns_lbvserver_count: "3"
        ns_csvserver_managed_count: "0"
        get_consumed_db: "false"
        ns_gslbvserver_managed_count: "0"
        ns_authenticationvserver_managed_count: "0"
        ns_authenticationvserver_count: "0"
        total_licenses_consumed: "0"
        cpx_rule_licensed_count: "0"
        ns_gslbvserver_count: "0"
        ns_lbvserver_managed_count: "0"
        ns_csvserver_count: "0"
        total_discovered_vips: "30"
        ns_crvserver_managed_count: "0"
        auto_licensed_count: "0"
        manual_licensed_count: "0"
        consumed_db_storage: "0"
        vpx_rule_licensed_count: "0"
        total_allowed_vips: "30"
        cpx_rule_max_limit: "0"
        total_discovered_tp_vservers: "30"

  modifymas_licenseRequest:
    type: object
    required:
      - mas_license
    properties:
      mas_license:
        $ref: '#/definitions/mas_license_readwrite'
    title: modifymas_licenseRequest
    example:
      mas_license:
        vcpu_lic: "1"
        max_vips_val: "10"
        adv_analytics: "1"
        perf: "3"
        tenantnslictype: "CPL, CUL"
        snmp_traps: "3"
        cpx_lic: "1"
        lic_type: "0"
        analytics: "3"
        fips_bw_lic: "1"
        upgrade_time: "1632242070"
        mhc_lic: "0"
        syslog: "3"
        vpx_lic: "1"
        fips_vcpu_lic: "0"
        pooled_lic: "1"
        ns_vpnvserver_managed_count: "0"
        vpx_rule_max_limit: "0"
        ns_vpnvserver_count: "0"
        ns_crvserver_count: "0"
        ns_lbvserver_count: "3"
        ns_csvserver_managed_count: "0"
        get_consumed_db: "false"
        ns_gslbvserver_managed_count: "0"
        ns_authenticationvserver_managed_count: "0"
        ns_authenticationvserver_count: "0"
        total_licenses_consumed: "0"
        cpx_rule_licensed_count: "0"
        ns_gslbvserver_count: "0"
        ns_lbvserver_managed_count: "0"
        ns_csvserver_count: "0"
        ns_crvserver_managed_count: "0"
        auto_licensed_count: "0"
        manual_licensed_count: "0"
        vpx_rule_licensed_count: "0"
        cpx_rule_max_limit: "0"

  modifymas_licenseResponse:
    type: object
    required:
      - mas_license
    properties:
      mas_license:
        $ref: '#/definitions/mas_license'
    title: modifymas_licenseResponse
    example:
      mas_license:
        vcpu_lic: "1"
        max_vips_val: "10"
        adv_analytics: "1"
        perf: "3"
        tenantnslictype: "CPL, CUL"
        node_id: "a2f7a85e-f388-4d2d-ae0e-646b4f66797e"
        id: "a2f7a85e-f388-4d2d-ae0e-646b4f66797e"
        snmp_traps: "3"
        cpx_lic: "1"
        lic_type: "0"
        max_vips: "10"
        max_storage: "0"
        analytics: "3"
        fips_bw_lic: "1"
        upgrade_time: "1632242070"
        mhc_lic: "0"
        syslog: "3"
        max_tp_vservers: "10"
        vpx_lic: "1"
        fips_vcpu_lic: "0"
        rpt_sampletime: "1580906346"
        pooled_lic: "1"
        ns_vpnvserver_managed_count: "0"
        total_managed_tp_vservers: "30"
        vpx_rule_max_limit: "0"
        entitled_db_storage: "0"
        ns_vpnvserver_count: "0"
        total_managed_vips: "30"
        total_allowed_tp_vservers: "30"
        ns_crvserver_count: "0"
        ns_lbvserver_count: "3"
        ns_csvserver_managed_count: "0"
        get_consumed_db: "false"
        ns_gslbvserver_managed_count: "0"
        ns_authenticationvserver_managed_count: "0"
        ns_authenticationvserver_count: "0"
        total_licenses_consumed: "0"
        cpx_rule_licensed_count: "0"
        ns_gslbvserver_count: "0"
        ns_lbvserver_managed_count: "0"
        ns_csvserver_count: "0"
        total_discovered_vips: "30"
        ns_crvserver_managed_count: "0"
        auto_licensed_count: "0"
        manual_licensed_count: "0"
        consumed_db_storage: "0"
        vpx_rule_licensed_count: "0"
        total_allowed_vips: "30"
        cpx_rule_max_limit: "0"
        total_discovered_tp_vservers: "30"

  mas_license_readwrite:
    type: object
    properties:
      vcpu_lic:
        description: "vCPU Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      max_vips_val:
        description: "Maximum VIPs decoded"
        type: integer
        format: int32
      adv_analytics:
        description: "Advanced Analytics, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      perf:
        description: "Perf, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      tenantnslictype:
        description: "Tenant NS license type"
        type: string
        format: string
      snmp_traps:
        description: "SNMP Traps, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      cpx_lic:
        description: "CPX Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      lic_type:
        description: "0 = Trial Period, 1 = Licensed, 2 = Grace period, 3 = unlicensed"
        type: integer
        format: int32
      analytics:
        description: "Analytics, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      fips_bw_lic:
        description: "FIPS BW Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      upgrade_time:
        description: "Last upgraded time when license reduced from 30 to 2"
        type: integer
        format: int32
      mhc_lic:
        description: "Multi Hybrid Cloud Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      syslog:
        description: "Syslog, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      vpx_lic:
        description: "VPX Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      fips_vcpu_lic:
        description: "FIPS vCPU Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      pooled_lic:
        description: "Pooled Licenses, 0=Unlicensed/Disabled, 1=Unlicensed/Enabled, 2=Licensed/Disabled, 3=Licensed/Enabled"
        type: integer
        format: int32
      ns_vpnvserver_managed_count:
        description: "Total licensed ns vpnvservers in MAS"
        type: integer
        format: int32
      vpx_rule_max_limit:
        description: "VPX rule policy max limit in MAS"
        type: integer
        format: int32
      ns_vpnvserver_count:
        description: "Total ns vpnvservers in the system"
        type: integer
        format: int32
      ns_crvserver_count:
        description: "Total ns crvservers in the system"
        type: integer
        format: int32
      ns_lbvserver_count:
        description: "Total ns lbvservers in the system"
        type: integer
        format: int32
      ns_csvserver_managed_count:
        description: "Total licensed ns csvservers in MAS"
        type: integer
        format: int32
      get_consumed_db:
        description: "Get Consumed DB"
        type: boolean
        format: boolean
      ns_gslbvserver_managed_count:
        description: "Total licensed ns gslbvservers in MAS"
        type: integer
        format: int32
      ns_authenticationvserver_managed_count:
        description: "Total licensed ns authenticationvservers in MAS"
        type: integer
        format: int32
      ns_authenticationvserver_count:
        description: "Total ns authenticationvservers in the system"
        type: integer
        format: int32
      total_licenses_consumed:
        description: "Total licneses consumed(excluding free licenses)"
        type: integer
        format: int32
      cpx_rule_licensed_count:
        description: "Total cpx-rule based licensed vservers in MAS"
        type: integer
        format: int32
      ns_gslbvserver_count:
        description: "Total ns gslbvservers in the system"
        type: integer
        format: int32
      ns_lbvserver_managed_count:
        description: "Total licensed ns lbvservers in MAS"
        type: integer
        format: int32
      ns_csvserver_count:
        description: "Total ns csvservers in the system"
        type: integer
        format: int32
      ns_crvserver_managed_count:
        description: "Total licensed ns crvservers in MAS"
        type: integer
        format: int32
      auto_licensed_count:
        description: "Total auto licensed vservers in MAS"
        type: integer
        format: int32
      manual_licensed_count:
        description: "Total manually licensed vservers in MAS"
        type: integer
        format: int32
      vpx_rule_licensed_count:
        description: "Total vpx-rule based licensed vservers in MAS"
        type: integer
        format: int32
      cpx_rule_max_limit:
        description: "CPX rule policy max limit in MAS"
        type: integer
        format: int32

  mas_license:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key
            type: string
            format: uuid
          node_id:
             description: "Node ID"
             type: string
             format: uuid
          max_vips:
             description: "Maximum VIPs"
             type: string
             format: password
          max_storage:
             description: "Max Storage"
             type: string
             format: password
          max_tp_vservers:
             description: "Maximum Third Party Vservers"
             type: string
             format: password
          rpt_sampletime:
             description: "Time Stamp"
             type: number
             format: int64
          total_managed_tp_vservers:
             description: "Total managed Third Party Vservers"
             type: integer
             format: int32
          entitled_db_storage:
             description: "Entitled DB storage in GB"
             type: number
             format: double
          total_managed_vips:
             description: "Total managed VIPs"
             type: integer
             format: int32
          total_allowed_tp_vservers:
             description: "Total Allowed Third Party Vservres"
             type: integer
             format: int32
          total_discovered_vips:
             description: "Total discovered VIPs"
             type: integer
             format: int32
          consumed_db_storage:
             description: "Consumed DB storage"
             type: string
             format: string
          total_allowed_vips:
             description: "Total Allowed VIPs"
             type: integer
             format: int32
          total_discovered_tp_vservers:
             description: "Total discovered Third Party Vservres"
             type: integer
             format: int32
      - $ref: '#/definitions/mas_license_readwrite'

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