swagger: '2.0'
info:
  description: Configuration for Trigger Detail resource.
  version: 'v2'
  title: trigger_detail
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: trigger_detail
    description: Trigger Detail
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   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/trigger_detail:
    get:
      tags:
        - trigger_detail
      summary: GET all trigger_detail
      operationId: getall_trigger_detail
      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 trigger_detail 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 trigger_detail 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 trigger_detail resources.
          enum:
            - yes
      responses:
        200:
          description:  for trigger_detail
          schema: 
              $ref: '#/definitions/gettrigger_detailsResponse'
        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:
  gettrigger_detailResponse:
    type: object
    required:
      - trigger_detail
    properties:
      trigger_detail:
        $ref: '#/definitions/trigger_detail'
    title: gettrigger_detailResponse
    example:
      trigger_detail:
        expiry: "string_value"
        parent_name: "string_value"
        daily_time: "string_value"
        trigger_type: "string_value"
        recur_hr: "string_value"
        duration: "string_value"
        description: "Provisioned on 10 Jan 18"
        parent_id: "string_value"
        monthday_time: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        weekday_time: "string_value"
        recur_min: "string_value"
        start: "string_value"

  gettrigger_detailsResponse:
    type: object
    required:
      - trigger_detail
    properties:
      trigger_detail:
        type: array
        items:
          $ref: '#/definitions/trigger_detail'
    title: gettrigger_detailsResponse
    example:
      trigger_detail:
        expiry: "string_value"
        parent_name: "string_value"
        daily_time: "string_value"
        trigger_type: "string_value"
        recur_hr: "string_value"
        duration: "string_value"
        description: "Provisioned on 10 Jan 18"
        parent_id: "string_value"
        monthday_time: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        weekday_time: "string_value"
        recur_min: "string_value"
        start: "string_value"

  trigger_detail_readwrite:
    type: object
    properties:
      expiry:
        description: "Time at which the trigger should end.Format:YY:MM:DD:HH:MM.Applicable for trigger of type fixed"
        type: string
        format: string
      parent_name:
        type: string
        format: string
      daily_time:
        description: "Time of the day.Format is HH:MM where HH is hours and MM is minutes.Applicable for trigger of type daily"
        type: string
        format: string
      trigger_type:
        description: "Trigger type.Possible values: fixed,daily,weekly,monthly"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      recur_hr:
        description: "Recur interval in hours. Applicable for trigger of type fixed"
        type: string
        format: string
      duration:
        description: "Duration in days for which the trigger should last. Applicable for trigger of type fixed"
        type: string
        format: string
      description:
        description: "Trigger description"
        type: string
        format: string
      parent_id:
        type: string
        format: string
      monthday_time:
        description: "Days of the month.Format is DD:HH:MM where DD is either 1-31 or last for days of the month,HH is hours and MM is minutes.Applicable for trigger of type monthly."
        type: string
        format: string
      weekday_time:
        description: "Days of the week.Format is Day:HH:MM where Day is 0-6 for sunday-saturday,HH is hours and MM is minutes.Applicable for trigger of type weekly"
        type: string
        format: string
      recur_min:
        description: "Recur interval in minutes. Applicable for trigger of type fixed"
        type: string
        format: string
      start:
        description: "Time at which the trigger should start.Format:YY:MM:DD:HH:MM"
        type: string
        format: string

  trigger_detail:
    allOf:
      -
        properties:
          id:
            type: string
            format: string
      - $ref: '#/definitions/trigger_detail_readwrite'

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