swagger: '2.0'
info:
  description: Configuration for PagerDuty profile details. resource.
  version: 'v2'
  title: pagerduty_profile
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: pagerduty_profile
    description: PagerDuty profile details.
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 sent pagerduty alerts.
   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/pagerduty_profile:
    get:
      tags:
        - pagerduty_profile
      summary: GET all pagerduty_profile
      operationId: getall_pagerduty_profile
      description: Use this operation to get pagerduty 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 pagerduty_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 pagerduty_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 pagerduty_profile resources.
          enum:
            - yes
      responses:
        200:
          description:  for pagerduty_profile
          schema: 
              $ref: '#/definitions/getpagerduty_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:
        - pagerduty_profile
      summary: POST operation for pagerduty_profile
      operationId: post_pagerduty_profile
      description: POST operation for pagerduty_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: pagerduty_profile
          description: pagerduty_profile object
          schema:
              $ref: '#/definitions/addpagerduty_profileRequest'
      responses:
        200:
          description: add for pagerduty_profile
          schema: 
              $ref: '#/definitions/addpagerduty_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/pagerduty_profile/{id}:
    get:
      tags:
        - pagerduty_profile
      summary: GET by key for pagerduty_profile
      operationId: getbykey_pagerduty_profile
      description: Use this operation to get pagerduty 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 pagerduty_profile
          schema: 
              $ref: '#/definitions/getpagerduty_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:
        - pagerduty_profile
      summary: PUT for pagerduty_profile
      operationId: putbykey_pagerduty_profile
      description: Use this operation to modify pagerduty 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
        - in: body
          name: pagerduty_profile
          description: pagerduty_profile object
          schema:
              $ref: '#/definitions/modifypagerduty_profileRequest'
      responses:
        200:
          description: add for pagerduty_profile
          schema: 
              $ref: '#/definitions/modifypagerduty_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:
        - pagerduty_profile
      summary: Delete for pagerduty_profile
      operationId: deletebykey_pagerduty_profile
      description: Use this operation to delete pagerduty 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:
        204:
          description: add for pagerduty_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:
  addpagerduty_profileRequest:
    type: object
    required:
      - pagerduty_profile
    properties:
      pagerduty_profile:
        $ref: '#/definitions/pagerduty_profile_readwrite'
    title: addpagerduty_profileRequest
    example:
      pagerduty_profile:
        service_key: "string_value"
        profile_name: "test_profile"

  addpagerduty_profileResponse:
    type: object
    required:
      - pagerduty_profile
    properties:
      pagerduty_profile:
        $ref: '#/definitions/pagerduty_profile'
    title: addpagerduty_profileResponse
    example:
      pagerduty_profile:
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        service_key: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        profile_name: "test_profile"
        message: "sample"

  getpagerduty_profileResponse:
    type: object
    required:
      - pagerduty_profile
    properties:
      pagerduty_profile:
        $ref: '#/definitions/pagerduty_profile'
    title: getpagerduty_profileResponse
    example:
      pagerduty_profile:
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        service_key: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        profile_name: "test_profile"
        message: "sample"

  getpagerduty_profilesResponse:
    type: object
    required:
      - pagerduty_profile
    properties:
      pagerduty_profile:
        type: array
        items:
          $ref: '#/definitions/pagerduty_profile'
    title: getpagerduty_profilesResponse
    example:
      pagerduty_profile:
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        service_key: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        profile_name: "test_profile"
        message: "sample"

  modifypagerduty_profileRequest:
    type: object
    required:
      - pagerduty_profile
    properties:
      pagerduty_profile:
        $ref: '#/definitions/pagerduty_profile_readwrite'
    title: modifypagerduty_profileRequest
    example:
      pagerduty_profile:
        service_key: "string_value"
        profile_name: "test_profile"

  modifypagerduty_profileResponse:
    type: object
    required:
      - pagerduty_profile
    properties:
      pagerduty_profile:
        $ref: '#/definitions/pagerduty_profile'
    title: modifypagerduty_profileResponse
    example:
      pagerduty_profile:
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        service_key: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        profile_name: "test_profile"
        message: "sample"

  pagerduty_profile_readwrite:
    type: object
    properties:
      service_key:
        description: "Service key"
        type: string
        format: string
      profile_name:
        description: "Profile name through which pagerduty alert will be sent."
        type: string
        format: string
        minLength: 1
        maxLength: 128

  pagerduty_profile:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the sent pagerduty alerts.
            type: string
            format: uuid
      - $ref: '#/definitions/pagerduty_profile_readwrite'

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