swagger: '2.0'
info:
  description: Configuration for Radius Server configuration resource.
  version: 'v2'
  title: radius_server
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: radius_server
    description: Radius Server configuration
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 radius servers
   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/radius_server:
    get:
      tags:
        - radius_server
      summary: GET all radius_server
      operationId: getall_radius_server
      description: Use this operation to get Radius server details
      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 radius_server 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 radius_server 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 radius_server resources.
          enum:
            - yes
      responses:
        200:
          description:  for radius_server
          schema: 
              $ref: '#/definitions/getradius_serversResponse'
        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:
        - radius_server
      summary: POST operation for radius_server
      operationId: post_radius_server
      description: POST operation for radius_server
      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: radius_server
          description: radius_server object
          schema:
              $ref: '#/definitions/addradius_serverRequest'
      responses:
        200:
          description: add for radius_server
          schema: 
              $ref: '#/definitions/addradius_serverResponse'
        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/radius_server/{id}:
    get:
      tags:
        - radius_server
      summary: GET by key for radius_server
      operationId: getbykey_radius_server
      description: Use this operation to get Radius server details
      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 radius_server
          schema: 
              $ref: '#/definitions/getradius_serverResponse'
        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:
        - radius_server
      summary: PUT for radius_server
      operationId: putbykey_radius_server
      description: Use this operation to modify Radius server
      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: radius_server
          description: radius_server object
          schema:
              $ref: '#/definitions/modifyradius_serverRequest'
      responses:
        200:
          description: add for radius_server
          schema: 
              $ref: '#/definitions/modifyradius_serverResponse'
        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:
        - radius_server
      summary: Delete for radius_server
      operationId: deletebykey_radius_server
      description: Use this operation to delete Radius server
      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 radius_server
        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:
  addradius_serverRequest:
    type: object
    required:
      - radius_server
    properties:
      radius_server:
        $ref: '#/definitions/radius_server_readwrite'
    title: addradius_serverRequest
    example:
      radius_server:
        auth_timeout: "3"
        group_separator: ";"
        pass_encoding: "pap"
        enable_nas_ip: "false"
        radius_key: "string_value"
        default_authentication_group: "string_value"
        ip_vendor_id: "0"
        ip_address: "1.1.1.1"
        ip_attribute_type: "0"
        attribute_type: "6"
        nas_id: "SSID1"
        vendor_id: "66"
        name: "Radius_server"
        port: "1812"
        groups_prefix: "string_value"
        pwd_vendor_id: "0"
        pwd_attribute_type: "0"
        accounting: "false"

  addradius_serverResponse:
    type: object
    required:
      - radius_server
    properties:
      radius_server:
        $ref: '#/definitions/radius_server'
    title: addradius_serverResponse
    example:
      radius_server:
        auth_timeout: "3"
        group_separator: ";"
        pass_encoding: "pap"
        enable_nas_ip: "false"
        radius_key: "string_value"
        default_authentication_group: "string_value"
        ip_vendor_id: "0"
        id: "012ec227-97db-413a-8ace-7380f9d813ad"
        ip_address: "1.1.1.1"
        ip_attribute_type: "0"
        attribute_type: "6"
        nas_id: "SSID1"
        vendor_id: "66"
        name: "Radius_server"
        port: "1812"
        groups_prefix: "string_value"
        pwd_vendor_id: "0"
        pwd_attribute_type: "0"
        accounting: "false"
        address_type: "0"

  getradius_serverResponse:
    type: object
    required:
      - radius_server
    properties:
      radius_server:
        $ref: '#/definitions/radius_server'
    title: getradius_serverResponse
    example:
      radius_server:
        auth_timeout: "3"
        group_separator: ";"
        pass_encoding: "pap"
        enable_nas_ip: "false"
        radius_key: "string_value"
        default_authentication_group: "string_value"
        ip_vendor_id: "0"
        id: "012ec227-97db-413a-8ace-7380f9d813ad"
        ip_address: "1.1.1.1"
        ip_attribute_type: "0"
        attribute_type: "6"
        nas_id: "SSID1"
        vendor_id: "66"
        name: "Radius_server"
        port: "1812"
        groups_prefix: "string_value"
        pwd_vendor_id: "0"
        pwd_attribute_type: "0"
        accounting: "false"
        address_type: "0"

  getradius_serversResponse:
    type: object
    required:
      - radius_server
    properties:
      radius_server:
        type: array
        items:
          $ref: '#/definitions/radius_server'
    title: getradius_serversResponse
    example:
      radius_server:
        auth_timeout: "3"
        group_separator: ";"
        pass_encoding: "pap"
        enable_nas_ip: "false"
        radius_key: "string_value"
        default_authentication_group: "string_value"
        ip_vendor_id: "0"
        id: "012ec227-97db-413a-8ace-7380f9d813ad"
        ip_address: "1.1.1.1"
        ip_attribute_type: "0"
        attribute_type: "6"
        nas_id: "SSID1"
        vendor_id: "66"
        name: "Radius_server"
        port: "1812"
        groups_prefix: "string_value"
        pwd_vendor_id: "0"
        pwd_attribute_type: "0"
        accounting: "false"
        address_type: "0"

  modifyradius_serverRequest:
    type: object
    required:
      - radius_server
    properties:
      radius_server:
        $ref: '#/definitions/radius_server_readwrite'
    title: modifyradius_serverRequest
    example:
      radius_server:
        auth_timeout: "3"
        group_separator: ";"
        pass_encoding: "pap"
        enable_nas_ip: "false"
        radius_key: "string_value"
        default_authentication_group: "string_value"
        ip_vendor_id: "0"
        ip_address: "1.1.1.1"
        ip_attribute_type: "0"
        attribute_type: "6"
        nas_id: "SSID1"
        vendor_id: "66"
        name: "Radius_server"
        port: "1812"
        groups_prefix: "string_value"
        pwd_vendor_id: "0"
        pwd_attribute_type: "0"
        accounting: "false"

  modifyradius_serverResponse:
    type: object
    required:
      - radius_server
    properties:
      radius_server:
        $ref: '#/definitions/radius_server'
    title: modifyradius_serverResponse
    example:
      radius_server:
        auth_timeout: "3"
        group_separator: ";"
        pass_encoding: "pap"
        enable_nas_ip: "false"
        radius_key: "string_value"
        default_authentication_group: "string_value"
        ip_vendor_id: "0"
        id: "012ec227-97db-413a-8ace-7380f9d813ad"
        ip_address: "1.1.1.1"
        ip_attribute_type: "0"
        attribute_type: "6"
        nas_id: "SSID1"
        vendor_id: "66"
        name: "Radius_server"
        port: "1812"
        groups_prefix: "string_value"
        pwd_vendor_id: "0"
        pwd_attribute_type: "0"
        accounting: "false"
        address_type: "0"

  radius_server_readwrite:
    type: object
    properties:
      auth_timeout:
        description: "The maximum number of seconds the system will wait for a response from the Radius server"
        type: integer
        format: int32
      group_separator:
        description: " Group separator string that delimits group names within a RADIUS attribute for RADIUS group extraction"
        type: string
        format: string
        maxLength: 7
      pass_encoding:
        description: "Enable password encoding in RADIUS packets send to the RADIUS server"
        type: string
        format: string
      enable_nas_ip:
        description: "Enable NAS IP extraction"
        type: boolean
        format: boolean
      radius_key:
        description: "Key of radius server"
        type: string
        format: password
        minLength: 4
        maxLength: 32
      default_authentication_group:
        description: "This is the default group that is chosen when the authentication succeeds in addition to extracted groups"
        type: string
        format: string
        maxLength: 64
      ip_vendor_id:
        description: "The vendor ID of the attribute in the RADIUS response which denotes the intranet IP"
        type: integer
        format: int32
      ip_address:
        description: "IP Address of radius server"
        type: string
        format: ip_address
        minLength: 1
        maxLength: 64
      ip_attribute_type:
        description: "The attribute type of the remote IP address attribute in a RADIUS response"
        type: integer
        format: int32
      attribute_type:
        description: "Attribute type for RADIUS group extraction"
        type: integer
        format: int32
      nas_id:
        description: "NAS ID"
        type: string
        format: string
        maxLength: 128
      vendor_id:
        description: "Vendor ID for RADIUS group extraction"
        type: integer
        format: int32
      name:
        description: "Name of radius server"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      port:
        description: "Port number of radius server"
        type: integer
        format: int32
      groups_prefix:
        description: "Prefix string that precedes group names within a RADIUS attribute for RADIUS group extraction"
        type: string
        format: string
        maxLength: 31
      pwd_vendor_id:
        description: "Vendor ID of the password in the RADIUS response. Used to extract the user password"
        type: integer
        format: int32
      pwd_attribute_type:
        description: "The attribute type of the password attribute in a RADIUS response."
        type: integer
        format: int32
      accounting:
        description: "Enable accounting in the radius server"
        type: boolean
        format: boolean

  radius_server:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the radius servers
            type: string
            format: uuid
          address_type:
             description: "Configuration Type. Values: 0: IPv4, 1: IPv6, -1: Hostname"
             type: integer
             format: int32
      - $ref: '#/definitions/radius_server_readwrite'

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