swagger: '2.0'
info:
  description: Configuration for Trap Forward Profile resource.
  version: 'v2'
  title: trap_forward_profile
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: trap_forward_profile
    description: Trap Forward Profile
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 mail profile.
   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/trap_forward_profile:
    get:
      tags:
        - trap_forward_profile
      summary: GET all trap_forward_profile
      operationId: getall_trap_forward_profile
      description: Use this operation to get trap_forward profile.
      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 trap_forward_profile 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 trap_forward_profile 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 trap_forward_profile resources.
          enum:
            - yes
      responses:
        200:
          description:  for trap_forward_profile
          schema: 
              $ref: '#/definitions/gettrap_forward_profilesResponse'
        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:
        - trap_forward_profile
      summary: POST operation for trap_forward_profile
      operationId: post_trap_forward_profile
      description: POST operation for trap_forward_profile
      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: trap_forward_profile
          description: trap_forward_profile object
          schema:
              $ref: '#/definitions/addtrap_forward_profileRequest'
      responses:
        200:
          description: add for trap_forward_profile
          schema: 
              $ref: '#/definitions/addtrap_forward_profileResponse'
        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/trap_forward_profile/{id}:
    get:
      tags:
        - trap_forward_profile
      summary: GET by key for trap_forward_profile
      operationId: getbykey_trap_forward_profile
      description: Use this operation to get trap_forward profile.
      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 trap_forward_profile
          schema: 
              $ref: '#/definitions/gettrap_forward_profileResponse'
        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:
        - trap_forward_profile
      summary: PUT for trap_forward_profile
      operationId: putbykey_trap_forward_profile
      description: Use this operation to modify trap_forward profile.
      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: trap_forward_profile
          description: trap_forward_profile object
          schema:
              $ref: '#/definitions/modifytrap_forward_profileRequest'
      responses:
        200:
          description: add for trap_forward_profile
          schema: 
              $ref: '#/definitions/modifytrap_forward_profileResponse'
        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:
        - trap_forward_profile
      summary: Delete for trap_forward_profile
      operationId: deletebykey_trap_forward_profile
      description: Use this operation to delete trap_forward profile.
      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 trap_forward_profile
        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:
  addtrap_forward_profileRequest:
    type: object
    required:
      - trap_forward_profile
    properties:
      trap_forward_profile:
        $ref: '#/definitions/trap_forward_profile_readwrite'
    title: addtrap_forward_profileRequest
    example:
      trap_forward_profile:
        trap_destination_port: "22"
        trap_community: "public"
        trap_destination: "1.1.1.1"
        profile_name: "Test trap"

  addtrap_forward_profileResponse:
    type: object
    required:
      - trap_forward_profile
    properties:
      trap_forward_profile:
        $ref: '#/definitions/trap_forward_profile'
    title: addtrap_forward_profileResponse
    example:
      trap_forward_profile:
        trap_destination_port: "22"
        tenant_id: "d5a24271-f31f-4280-892a-04da7a0e8b89"
        trap_community: "public"
        id: "797b7377-17c4-4635-8f9f-04cf4582d0c3"
        trap_destination: "1.1.1.1"
        profile_name: "Test trap"

  gettrap_forward_profileResponse:
    type: object
    required:
      - trap_forward_profile
    properties:
      trap_forward_profile:
        $ref: '#/definitions/trap_forward_profile'
    title: gettrap_forward_profileResponse
    example:
      trap_forward_profile:
        trap_destination_port: "22"
        tenant_id: "d5a24271-f31f-4280-892a-04da7a0e8b89"
        trap_community: "public"
        id: "797b7377-17c4-4635-8f9f-04cf4582d0c3"
        trap_destination: "1.1.1.1"
        profile_name: "Test trap"

  gettrap_forward_profilesResponse:
    type: object
    required:
      - trap_forward_profile
    properties:
      trap_forward_profile:
        type: array
        items:
          $ref: '#/definitions/trap_forward_profile'
    title: gettrap_forward_profilesResponse
    example:
      trap_forward_profile:
        trap_destination_port: "22"
        tenant_id: "d5a24271-f31f-4280-892a-04da7a0e8b89"
        trap_community: "public"
        id: "797b7377-17c4-4635-8f9f-04cf4582d0c3"
        trap_destination: "1.1.1.1"
        profile_name: "Test trap"

  modifytrap_forward_profileRequest:
    type: object
    required:
      - trap_forward_profile
    properties:
      trap_forward_profile:
        $ref: '#/definitions/trap_forward_profile_readwrite'
    title: modifytrap_forward_profileRequest
    example:
      trap_forward_profile:
        trap_destination_port: "22"
        trap_community: "public"
        trap_destination: "1.1.1.1"
        profile_name: "Test trap"

  modifytrap_forward_profileResponse:
    type: object
    required:
      - trap_forward_profile
    properties:
      trap_forward_profile:
        $ref: '#/definitions/trap_forward_profile'
    title: modifytrap_forward_profileResponse
    example:
      trap_forward_profile:
        trap_destination_port: "22"
        tenant_id: "d5a24271-f31f-4280-892a-04da7a0e8b89"
        trap_community: "public"
        id: "797b7377-17c4-4635-8f9f-04cf4582d0c3"
        trap_destination: "1.1.1.1"
        profile_name: "Test trap"

  trap_forward_profile_readwrite:
    type: object
    properties:
      trap_destination_port:
        description: "SNMP port to forward trap"
        type: string
        format: int32
        minLength: 1
        maxLength: 128
      trap_community:
        description: "SNMP community name using which we want to forward the trap"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      trap_destination:
        description: "SMTP server IP"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 128
      profile_name:
        description: "Profile name for the mail setting."
        type: string
        format: string
        minLength: 1
        maxLength: 128

  trap_forward_profile:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the mail profile.
            type: string
            format: uuid
          tenant_id:
             description: "Tenant Id "
             type: string
             format: uuid
      - $ref: '#/definitions/trap_forward_profile_readwrite'

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