swagger: '2.0'
info:
  description: Configuration for vpn user report resource.
  version: 'v2'
  title: vpn_user
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: vpn_user
    description: vpn user report
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  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/vpn_user:
    get:
      tags:
        - vpn_user
      summary: GET all vpn_user
      operationId: getall_vpn_user
      description: Af Report for Device.
      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 vpn_user 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 vpn_user 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 vpn_user resources.
          enum:
            - yes
      responses:
        200:
          description:  for vpn_user
          schema: 
              $ref: '#/definitions/getvpn_usersResponse'
        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:
  getvpn_userResponse:
    type: object
    required:
      - vpn_user
    properties:
      vpn_user:
        $ref: '#/definitions/vpn_user'
    title: getvpn_userResponse
    example:
      vpn_user:
        __count: "10"
        http_resp_status_name: "200"
        server_ip_address: "1.1.1.1"
        http_req_method_name: "GET"
        name: "user1"
        rpt_sample_time: "1543268790"
        total_bytes: "1503.2"
        user_agent_name: "test_user_agent"
        device_ip_address: "1.1.1.1"
        max_transaction_time: "1543778790"
        client_ip_address: "1.1.1.1"
        id: "00000000-0000-375c-0000-000400000004"
        total_requests: "100"
        operating_system_name: "Windows"

  getvpn_usersResponse:
    type: object
    required:
      - vpn_user
    properties:
      vpn_user:
        type: array
        items:
          $ref: '#/definitions/vpn_user'
    title: getvpn_usersResponse
    example:
      vpn_user:
        __count: "10"
        http_resp_status_name: "200"
        server_ip_address: "1.1.1.1"
        http_req_method_name: "GET"
        name: "user1"
        rpt_sample_time: "1543268790"
        total_bytes: "1503.2"
        user_agent_name: "test_user_agent"
        device_ip_address: "1.1.1.1"
        max_transaction_time: "1543778790"
        client_ip_address: "1.1.1.1"
        id: "00000000-0000-375c-0000-000400000004"
        total_requests: "100"
        operating_system_name: "Windows"

  vpn_user_readwrite:
    type: object
    properties:
      __count:
        description: "count."
        type: number
        format: double
      name:
        description: "vpn user name."
        type: string
        format: string
        maxLength: 255
      rpt_sample_time:
        description: "Report Sample time."
        type: number
        format: double
      total_bytes:
        description: "Total bytes accounted by this URL in sampled timeframe."
        type: number
        format: double
      max_transaction_time:
        description: "Last Transaction Time for this URL in the sampled timeframe."
        type: number
        format: double
      id:
        description: "vpn user name"
        type: string
        format: uuid
        maxLength: 255
      total_requests:
        description: "Total Requests for this device in given sampled timeframe."
        type: number
        format: double

  vpn_user:
    allOf:
      - $ref: '#/definitions/vpn_user_readwrite'

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