openapi: 3.0.0
info:
  title: Automation
  version: 2.0.0
  description: Automation API Documentation
  contact:
    name: OpsRamp Support
    email: support@opsramp.com
    url: 'https://www.opsramp.com/about-opsramp/contact-us/'
tags:
  - name: automation
    description: Example description.
    externalDocs:
      url: 'https://develop.opsramp.com/automation/'
servers:
  - url: 'https://api.opsramp.com'
    description: Partner - All Others
  - url: 'https://{subdomain}.api.opsramp.com'
    description: Partner or Client custom branded sub-domain
    variables:
      subdomain:
        default: demo
        description: Custom sub-domain assigned to the client
paths:
  '/api/v2/tenants/{tenantId}/jobs':
    summary: Create Job
    description: Creates a job.
    post:
      operationId: api-v2-tenants-tenantid-jobs-post
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  entities:
                    $ref: '#/components/schemas/entities'
                  schedule:
                    $ref: '#/components/schemas/schedule'
                  jobQueued:
                    type: boolean
                  script:
                    $ref: '#/components/schemas/script'
                  id:
                    type: string
              examples:
                example-ad-checklist:
                  value:
                    name: Ad Check List
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: adCheckList
                    id: 4902d87c-b5df-4797-9f45-e807cd871ac9
                example-network-configuration-backup:
                  value:
                    name: Network Config Backup
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: networkconfigbackup
                      configParams:
                        versionsSaved: ALL_VERSIONS
                        backUpTrigger: true
                        startupConfigAlert: true
                        runtimeConfigAlert: true
                        startUpConfigFilesBackUp: true
                        runTimeConfigFilesBackUp: true
                    id: cc242a8d-b0b4-430e-a89f-7081bc5e79b0
                example-app-install:
                  value:
                    name: test
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: appinstall
                      approvalType:
                        approvalType: 1
                        approvalReason: for testing
                        alertRequired: true
                    id: 8a87f644-0bdc-4d5a-9e41-0ca333b71acd
                example-custom-script:
                  value:
                    name: Job - test script
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      customScript:
                        id: '7'
                        name: test script
                        description: test script
                        platforms:
                          - WINDOWS
                      parameters:
                        - paramId: '2'
                          name: String
                          value: '150'
                      userType: 2
                    id: ce1088d5-81cc-4262-b515-a75230f0d8e4
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                script:
                  $ref: '#/components/schemas/script'
                entities:
                  $ref: '#/components/schemas/entities'
                name:
                  type: string
                  description: The job name.
                jobQueued:
                  type: boolean
                  description: To run a job constantly after execution of other jobs.
                schedule:
                  $ref: '#/components/schemas/schedule'
                credentialSet:
                  type: object
                  properties:
                    uniqueId:
                      type: string
                      description: |-
                        Device or client credential set ID.
                        - Use Get Minimal Details of Device Credential Sets API to fetch the list of credentials sets assigned to a device.
                        - Use Get Minimal Details of Client Credential Sets API to fetch the list of credentials assigned to a client.
            examples:
              example-ad-checklist:
                value:
                  name: Ad Check List
                  jobQueued: true
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  script:
                    jobType: adCheckList
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
              example-network-configuration-backup:
                value:
                  name: Network Config Backup
                  jobQueued: true
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  script:
                    jobType: networkconfigbackup
                    configParams:
                      versionsSaved: ALL_VERSIONS
                      backUpTrigger: true
                      startupConfigAlert: true
                      runtimeConfigAlert: true
                      startUpConfigFilesBackUp: true
                      runTimeConfigFilesBackUp: true
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
              example-app-install:
                value:
                  name: test
                  jobQueued: true
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  script:
                    jobType: appinstall
                    approvalType:
                      approvalType: 1
                      approvalReason: for testing
                      alertRequired: true
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
              example-custom-script:
                value:
                  jobQueued: true
                  script:
                    jobType: custom
                    userType: 2
                    customScript:
                      id: '7'
                    parameters:
                      - paramId: '2'
                        value: '150'
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
    parameters:
      - $ref: '#/components/parameters/tenantId'
  '/api/v2/tenants/{tenantId}/jobs/{jobId}':
    summary: Manage Jobs
    description: 'Gets, update, and delete the jobs.'
    get:
      operationId: api-v2-tenants-tenantid-jobs-id-get
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  entities:
                    $ref: '#/components/schemas/entities'
                  schedule:
                    $ref: '#/components/schemas/schedule'
                  jobQueued:
                    type: boolean
                  script:
                    $ref: '#/components/schemas/script'
                  id:
                    type: string
              examples:
                example-ad-checklist:
                  value:
                    name: Ad Check List
                    entities:
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                            resourceType: Desktop
                            resourceName: abc
                            aliasName: ''
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                            resourceType: Desktop
                            resourceName: abcd
                            aliasName: ''
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: adCheckList
                    id: 4902d87c-b5df-4797-9f45-e807cd871ac9
                example-script:
                  value:
                    name: Job - test script
                    entities:
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      customScript:
                        id: '7'
                        name: test script
                        description: test script
                        platforms:
                          - WINDOWS
                      parameters:
                        - paramId: '2'
                          name: String
                          value: '150'
                      userType: 2
                    id: ce1088d5-81cc-4262-b515-a75230f0d8e4
                example-network-configuration-backup:
                  value:
                    name: Network Config Backup
                    entities:
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: networkconfigbackup
                      configParams:
                        versionsSaved: ALL_VERSIONS
                        backUpTrigger: true
                        startupConfigAlert: true
                        runtimeConfigAlert: true
                        startUpConfigFilesBackUp: true
                        runTimeConfigFilesBackUp: true
                    id: cc242a8d-b0b4-430e-a89f-7081bc5e79b0
      description: ''
    delete:
      operationId: api-v2-tenants-tenantid-jobs-id-delete
      description: Partners and service providers have permission to delete a client job.
      tags:
        - automation
      responses:
        '200':
          description: OK
    post:
      operationId: api-v2-tenants-tenantid-jobs-id-post
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  entities:
                    $ref: '#/components/schemas/entities'
                  schedule:
                    $ref: '#/components/schemas/schedule'
                  jobQueued:
                    type: boolean
                  script:
                    $ref: '#/components/schemas/script'
                  id:
                    type: string
              examples:
                example-ad-checklist:
                  value:
                    name: Ad Check List
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: adCheckList
                    id: 4902d87c-b5df-4797-9f45-e807cd871ac9
                example-network-configuration-backup:
                  value:
                    name: Network Config Backup
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: networkconfigbackup
                      configParams:
                        versionsSaved: ALL_VERSIONS
                        backUpTrigger: true
                        startupConfigAlert: true
                        runtimeConfigAlert: true
                        startUpConfigFilesBackUp: true
                        runTimeConfigFilesBackUp: true
                    id: cc242a8d-b0b4-430e-a89f-7081bc5e79b0
                example-app-install:
                  value:
                    name: test
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      jobType: appinstall
                      approvalType:
                        approvalType: 1
                        approvalReason: for testing
                        alertRequired: true
                    id: 8a87f644-0bdc-4d5a-9e41-0ca333b71acd
                example-custom-script:
                  value:
                    name: Job - test script
                    entities:
                      - resource:
                          id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                          generalInfo:
                            ipAddresses: 10.233.19.130
                            hostName: 10.233.19.130
                          clientUniqueId: client_13
                          type: DEVICE
                      - resource:
                          id: 4e96d5bc-763c-4c00-beab-928d653a0422
                          generalInfo:
                            ipAddresses: 172.30.1.60
                            hostName: 172.30.1.60
                          clientUniqueId: client_13
                          type: DEVICE
                    schedule:
                      startDate: '2016-04-14T10:10:00+0000'
                      pattern:
                        type: daily
                        frequency: recurrence
                        repeatFrequency: 2
                        repeatType: days
                    jobQueued: true
                    script:
                      customScript:
                        id: '7'
                        name: test script
                        description: test script
                        platforms:
                          - WINDOWS
                      parameters:
                        - paramId: '2'
                          name: String
                          value: '150'
                      userType: 2
                    id: ce1088d5-81cc-4262-b515-a75230f0d8e4
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
                jobQueued:
                  type: boolean
                entities:
                  $ref: '#/components/schemas/entities'
                script:
                  $ref: '#/components/schemas/script'
                schedule:
                  $ref: '#/components/schemas/schedule'
            examples:
              example-ad-checklist:
                value:
                  id: 4902d87c-b5df-4797-9f45-e807cd871ac9
                  name: Ad Check List
                  jobQueued: true
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  script:
                    jobType: adCheckList
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
              example-network-configuration-backup:
                value:
                  id: cc242a8d-b0b4-430e-a89f-7081bc5e79b0
                  name: Network Config Backup
                  jobQueued: true
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  script:
                    jobType: networkconfigbackup
                    configParams:
                      versionsSaved: ALL_VERSIONS
                      backUpTrigger: true
                      startupConfigAlert: true
                      runtimeConfigAlert: true
                      startUpConfigFilesBackUp: true
                      runTimeConfigFilesBackUp: true
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
              example-app-install:
                value:
                  id: 8a87f644-0bdc-4d5a-9e41-0ca333b71acd
                  name: test
                  jobQueued: true
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  script:
                    jobType: appinstall
                    approvalType:
                      approvalType: 1
                      approvalReason: for testing
                      alertRequired: true
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
              example-custom-script:
                value:
                  id: ce1088d5-81cc-4262-b515-a75230f0d8e4
                  jobQueued: true
                  script:
                    jobType: custom
                    userType: 2
                    customScript:
                      id: '7'
                    parameters:
                      - paramId: '2'
                        value: '150'
                  entities:
                    - resource:
                        id: 709824de-8315-4cf9-ad1c-b15aaf7bf2a5
                        type: DEVICE
                    - resource:
                        id: 4e96d5bc-763c-4c00-beab-928d653a0422
                        type: DEVICE
                  schedule:
                    startDate: '2016-04-14T10:10:10+0000'
                    pattern:
                      type: daily
                      frequency: recurrence
                      repeatType: days
                      repeatFrequency: 2
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - $ref: '#/components/parameters/jobId'
  '/api/v2/tenants/{tenantId}/jobs/search':
    summary: Get Tenant Jobs List
    description: Gets the list of jobs defined by a tenant. This endpoint can be used to fetch the paginated list of the scheduled jobs of a partner or client.
    get:
      tags:
        - automation
      parameters:
        - schema:
            type: integer
          in: query
          name: pageNo
        - schema:
            type: integer
            default: 100
          in: query
          name: pageSize
        - schema:
            type: boolean
            default: true
          in: query
          name: isDescendingOrder
        - schema:
            type: string
            default: id
          in: query
          name: sortName
        - schema:
            type: string
          in: query
          name: queryString
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        jobQueued:
                          type: boolean
                        script:
                          $ref: '#/components/schemas/script'
                        id:
                          type: string
                        totalResults:
                          type: integer
                        orderBy:
                          type: string
                        pageNo:
                          type: integer
                        pageSize:
                          type: integer
                        totalPages:
                          type: integer
                        nextPage:
                          type: boolean
                        previousPageNo:
                          type: integer
                        descendingOrder:
                          type: boolean
              examples:
                example-jobs:
                  value:
                    results:
                      - name: test
                        schedule:
                          startDate: '2016-04-14T10:10:00+0000'
                          pattern:
                            type: daily
                            frequency: recurrence
                            repeatFrequency: 2
                            repeatType: days
                        jobQueued: true
                        script:
                          jobType: appinstall
                          approvalType:
                            approvalType: 1
                            approvalReason: for testing
                            alertRequired: true
                        id: 8a87f644-0bdc-4d5a-9e41-0ca333b71acd
                      - name: Network Config Backup
                        schedule:
                          startDate: '2016-04-14T10:10:00+0000'
                          pattern:
                            type: daily
                            frequency: recurrence
                            repeatFrequency: 2
                            repeatType: days
                        jobQueued: true
                        script:
                          jobType: networkconfigbackup
                          configParams:
                            versionsSaved: ALL_VERSIONS
                            backUpTrigger: true
                            startupConfigAlert: true
                            runtimeConfigAlert: true
                            startUpConfigFilesBackUp: true
                            runTimeConfigFilesBackUp: true
                        id: cc242a8d-b0b4-430e-a89f-7081bc5e79b0
                      - name: Job - test script
                        schedule:
                          startDate: '2016-04-14T10:10:00+0000'
                          pattern:
                            type: daily
                            frequency: recurrence
                            repeatFrequency: 2
                            repeatType: days
                        jobQueued: true
                        script:
                          customScript:
                            id: '7'
                            name: test script
                            description: test script
                            platforms:
                              - WINDOWS
                          userType: 2
                        id: ce1088d5-81cc-4262-b515-a75230f0d8e4
                      - name: Ad Check List
                        schedule:
                          startDate: '2016-04-14T10:10:00+0000'
                          pattern:
                            type: daily
                            frequency: recurrence
                            repeatFrequency: 2
                            repeatType: days
                        jobQueued: true
                        script:
                          jobType: adCheckList
                        id: 4902d87c-b5df-4797-9f45-e807cd871ac9
                    totalResults: 4
                    orderBy: job.name
                    pageNo: 1
                    pageSize: 10
                    totalPages: 1
                    nextPage: false
                    previousPageNo: 0
                    descendingOrder: true
    parameters:
      - $ref: '#/components/parameters/tenantId'
  '/api/v2/tenants/{tenantId}/jobs/types':
    summary: Get Job Types
    description: Gets the list of job types.
    get:
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobNameAndType:
                    type: array
                    items:
                      type: object
                      properties:
                        jobName:
                          type: string
                        jobtype:
                          type: string
              examples:
                example-job-types:
                  value:
                    jobNameAndType:
                      - jobName: AD CheckList
                        jobtype: adCheckList
                      - jobName: Anti SpyWare
                        jobtype: antispyware
                      - jobName: Antivirus Update
                        jobtype: antivirus
                      - jobName: Application Scan
                        jobtype: appaudit
                      - jobName: Asset Information
                        jobtype: assetinfo
                      - jobName: BackUp Agent
                        jobtype: backupagent
                      - jobName: Disk Defragmentation
                        jobtype: diskdefrag
                      - jobName: EXBPA CheckList
                        jobtype: exbpaCheckList
                      - jobName: Missing Patches Request
                        jobtype: missingPatchesRequest
                      - jobName: MSSQL Report
                        jobtype: sqlreport
                      - jobName: Network Configuration Backup
                        jobtype: networkconfigbackup
                      - jobName: TempFiles Deletion
                        jobtype: tempfilesreport
                      - jobName: Application Install
                        jobtype: appinstall
                      - jobName: Application Update
                        jobtype: appupdate
    parameters:
      - $ref: '#/components/parameters/tenantId'
  '/api/v2/tenants/{tenantId}/jobs/{jobId}/run':
    summary: Run Scheduled Job
    description: Runs a scheduled job.
    post:
      tags:
        - automation
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  description: |
                    Reason to run the job
            examples:
              example-job-run-details:
                value:
                  reason: To run job on demand
      responses:
        '200':
          description: OK
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - $ref: '#/components/parameters/jobId'
  '/api/v2/tenants/{tenantId}jobs/{jobId}/script/run':
    summary: Run a Script
    description: Define scripts as code that can run commonly-run tasks. This endpoint can be used to run an existing job script.
    post:
      tags:
        - automation
      responses:
        '200':
          description: OK
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - $ref: '#/components/parameters/jobId'
  '/api/v2/tenants/{tenantId}/rba/categories':
    summary: Manage RBA Categories
    description: Creates and updates an RBA category and gets a list of RBA categories.
    post:
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  id:
                    type: integer
              examples:
                example-rba-category:
                  value:
                    id: 28
                    name: CLIENT-Category
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the category
                parent:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Specify the parent ID of the category to create a subcategory.
              required:
                - name
            examples:
              example-rba-category:
                value:
                  name: CLIENT-Category
                  parent:
                    id: 27
    get:
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/rba'
              examples:
                example-categories:
                  value:
                    - id: 1
                      name: Miscellaneous
                    - id: 16
                      name: API Task Category
                      childs:
                        - id: 17
                          name: Child-1
                          childs:
                            - id: 33
                              name: child-1-child
                        - id: 18
                          name: Child-2
                        - id: 19
                          name: Child-3-client
                    - id: 7
                      name: Applications
                      childs:
                        - id: 8
                          name: QuickBooks
                    - id: 31
                      name: C_Category
                    - id: 24
                      name: SP_Category
                      childs:
                        - id: 25
                          name: SP_Category_child
                        - id: 26
                          name: MSP-Category
                    - id: 13
                      name: Test Global Category
    put:
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  id:
                    type: integer
              examples:
                example-1:
                  value:
                    id: 22
                    name: CLIENT-Category_UpdatedName
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: |
                    Name of the category
                id:
                  type: integer
              required:
                - name
                - id
            examples:
              example-update-category:
                value:
                  id: 22
                  name: CLIENT-Category_UpdatedName
    parameters:
      - $ref: '#/components/parameters/tenantId'
  '/api/v2/tenants/{tenantId}/rba/categories/{categoryId}':
    summary: Delete RBA Category
    description: Categories are only deleted when no scripts exist in that category (or related child categories).
    delete:
      tags:
        - automation
      responses:
        '200':
          description: OK
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - schema:
          type: string
        in: path
        name: categoryId
        required: true
  '/api/v2/tenants/{tenantId}/rba/categories/{categoryId}/scripts':
    summary: Manage Scripts
    description: Creates and deletes a script and gets a list of scripts for a category.
    post:
      description: |-
        When creating a script:

        - Attachment files must be converted to byte stream and base64-encoded. Always include a name and file.
        - To get the list of available categories, invoke the Get Categories endpoint.
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rbaScript'
              examples:
                example-rba-shell-script:
                  value:
                    id: 78
                    name: Restart Service
                    description: Restart Service
                    category:
                      id: 28
                      name: CLIENT-Category
                    platforms:
                      - WINDOWS
                      - LINUX
                    parameters:
                      - id: 102
                        name: Test Param - 1
                        description: Testing please ignore
                        defaultValue: '10'
                        type: REQUIRED
                        dataType: INTEGER
                      - id: 103
                        name: Test Param - 2
                        description: Testing please ignore
                        defaultValue: '50'
                        type: OPTIONAL
                        dataType: STRING
                    executionType: SHELL
                    installTimeout: 50
                    attachment:
                      id: 0
                      name: apache-restart.sh
                      contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=0.00'
                    scriptVersion: '0.00'
                    registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                    registryValue: 'dword:00000001'
                    processName: cmd.exe
                    serviceName: OpsRampAgent
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Script name.
                description:
                  type: string
                  description: Description for the script.
                platforms:
                  type: array
                  description: |
                    OS platforms.Example: WINDOWS, LINUX
                  items:
                    type: string
                executionType:
                  type: string
                  description: 'Script execution type.Supported Values: BATCHFILE, COMMAND, DOWNLOAD, EXE, MSI, POWERSHELL, PYTHON, PERL, PHP, SHELL, VBS'
                  enum:
                    - BATCHFILE
                    - COMMAND
                    - DOWNLOAD
                    - EXE
                    - MSI
                    - POWERSHELL
                    - PYTHON
                    - PERL
                    - PHP
                    - SHELL
                    - VBS
                installTimeout:
                  type: integer
                  description: Maximum time for installation.
                registryPath:
                  type: string
                  description: Registry path for sanity check after execution.
                registryValue:
                  type: string
                  description: Registry Value for sanity check after execution.
                processName:
                  type: string
                  description: Process name for sanity check.
                serviceName:
                  type: string
                  description: Service name for sanity check.
                attachment:
                  type: object
                  description: 'If executionType is COMMAND, then command is needed else attachment file is needed.'
                  properties:
                    name:
                      type: string
                    file:
                      type: string
                parameters:
                  type: array
                  description: Parameter data.
                  items:
                    $ref: '#/components/schemas/rbaScriptParameter'
                command:
                  type: string
                outputDirectory:
                  type: string
                  description: 'Output directory supported required only when executionType is DOWNLOAD, EXE, MSI.'
                outputFile:
                  type: string
                  description: 'Output file supported required only when executionType is DOWNLOAD, EXE, MSI.'
            examples:
              example-rba-shell-script:
                value:
                  name: Restart Apache
                  description: Restart Apache using Shell
                  platforms:
                    - WINDOWS
                    - LINUX
                  executionType: SHELL
                  installTimeout: 50
                  registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                  registryValue: 'dword:00000001'
                  processName: cmd.exe
                  serviceName: OpsRampAgent
                  attachment:
                    name: apache-restart.sh
                    file: UkVTVEFSVD0iL3NiaW4vc2VydmljZSBodHRwZCByZXN0YXJ0Ig0KUEdSRVA9Ii91c3IvYmluL3BncmVwIg0KSFRUUEQ9Imh0dHBkIg0KJFBHUkVQICR7SFRUUER9DQppZiBbICQ/IC1uZSAwIF0NCnRoZW4NCiAkUkVTVEFSVA0KZmk=
                  parameters:
                    - name: Test Param - 1
                      description: Testing please ignore
                      defaultValue: '10'
                      type: REQUIRED
                      dataType: INTEGER
                    - name: Test Param - 2
                      description: Testing please ignore
                      defaultValue: '50'
                      type: OPTIONAL
                      dataType: STRING
    delete:
      description: Partners can delete client or partner scripts. A client can only delete client-specific scripts.
      tags:
        - automation
      responses:
        '200':
          description: OK
    get:
      description: A list of scripts is retrieved within a category.
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rbaScript'
              examples:
                example-rba-scripts:
                  value:
                    id: 73
                    name: Restart Apache Service
                    description: Restart Apache Service
                    category:
                      id: 28
                      name: CLIENT-Category
                    platforms:
                      - WINDOWS
                      - LINUX
                    parameters:
                      - id: 94
                        name: Test Param - 1
                        description: Testing please ignore
                        defaultValue: '10'
                        type: REQUIRED
                        dataType: INTEGER
                      - id: 95
                        name: Test Param - 2
                        description: Testing please ignore
                        defaultValue: '50'
                        type: OPTIONAL
                        dataType: STRING
                      - id: 96
                        name: New param - 3
                        description: Testing please ignore
                        defaultValue: '50'
                        type: OPTIONAL
                        dataType: STRING
                    executionType: SHELL
                    installTimeout: 50
                    attachment:
                      id: 0
                      name: apache-restart.sh
                      contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=5.00'
                    scriptVersion: '5.00'
                    registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                    registryValue: 'dword:00000001'
                    processName: cmd.exe
                    serviceName: OpsRampAgent
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - $ref: '#/components/parameters/categoryId'
  '/api/v2/tenants/{tenantId}/rba/categories/{categoryId}/scripts/{scriptId}':
    summary: Manage Scripts by ID
    description: Gets and update the details of a script.
    get:
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/rbaScript'
              examples:
                example-get-script:
                  value:
                    - id: 73
                      name: Restart Apache Service
                      description: Restart Apache Service
                      category:
                        id: 28
                        name: CLIENT-Category
                      platforms:
                        - WINDOWS
                        - LINUX
                      parameters:
                        - id: 94
                          name: Test Param - 1
                          description: Testing please ignore
                          defaultValue: '10'
                          type: REQUIRED
                          dataType: INTEGER
                        - id: 95
                          name: Test Param - 2
                          description: Testing please ignore
                          defaultValue: '50'
                          type: OPTIONAL
                          dataType: STRING
                        - id: 96
                          name: New param - 3
                          description: Testing please ignore
                          defaultValue: '50'
                          type: OPTIONAL
                          dataType: STRING
                      executionType: SHELL
                      installTimeout: 50
                      attachment:
                        id: 0
                        name: apache-restart.sh
                        contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=5.00'
                      scriptVersion: '5.00'
                      registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                      registryValue: 'dword:00000001'
                      processName: cmd.exe
                      serviceName: OpsRampAgent
                    - id: 77
                      name: Restart Apache test
                      description: Restart Apache using Shell
                      category:
                        id: 28
                        name: CLIENT-Category
                      platforms:
                        - WINDOWS
                        - LINUX
                      parameters:
                        - id: 100
                          name: Test Param - 1
                          description: Testing please ignore
                          defaultValue: '10'
                          type: REQUIRED
                          dataType: INTEGER
                        - id: 101
                          name: Test Param - 2
                          description: Testing please ignore
                          defaultValue: '50'
                          type: OPTIONAL
                          dataType: STRING
                      executionType: SHELL
                      installTimeout: 50
                      attachment:
                        id: 0
                        name: apache-restart.sh
                        contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=0.00'
                      scriptVersion: '0.00'
                      registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                      registryValue: 'dword:00000001'
                      processName: cmd.exe
                      serviceName: OpsRampAgent
                    - id: 78
                      name: Restart Service
                      description: Restart Apache using Shell
                      category:
                        id: 28
                        name: CLIENT-Category
                      platforms:
                        - WINDOWS
                        - LINUX
                      parameters:
                        - id: 102
                          name: Test Param - 1
                          description: Testing please ignore
                          defaultValue: '10'
                          type: REQUIRED
                          dataType: INTEGER
                        - id: 103
                          name: Test Param - 2
                          description: Testing please ignore
                          defaultValue: '50'
                          type: OPTIONAL
                          dataType: STRING
                      executionType: SHELL
                      installTimeout: 50
                      attachment:
                        id: 0
                        name: apache-restart.sh
                        contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=0.00'
                      scriptVersion: '0.00'
                      registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                      registryValue: 'dword:00000001'
                      processName: cmd.exe
                      serviceName: OpsRampAgent
                    - id: 79
                      name: Restart Service shell
                      description: Restart Apache using Shell
                      category:
                        id: 28
                        name: CLIENT-Category
                      platforms:
                        - WINDOWS
                        - LINUX
                      parameters:
                        - id: 104
                          name: Test Param - 1
                          description: Testing please ignore
                          defaultValue: '10'
                          type: REQUIRED
                          dataType: INTEGER
                        - id: 105
                          name: Test Param - 2
                          description: Testing please ignore
                          defaultValue: '50'
                          type: OPTIONAL
                          dataType: STRING
                      executionType: SHELL
                      installTimeout: 50
                      attachment:
                        id: 0
                        name: apache-restart.sh
                        contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=0.00'
                      scriptVersion: '0.00'
                      registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                      registryValue: 'dword:00000001'
                      processName: cmd.exe
                      serviceName: OpsRampAgent
    post:
      description: |-
        To update a script:

        - Attachment files must be converted to byte stream and base64-encoded. Always include a name and file.
        - To get the list of available categories, invoke the Get Categories endpoint.
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rbaScript'
              examples:
                example-rba-script:
                  value:
                    id: 73
                    name: Restart Apache Service
                    description: Restart Apache Service
                    category:
                      id: 28
                      name: CLIENT-Category
                    platforms:
                      - WINDOWS
                      - LINUX
                    parameters:
                      - id: 94
                        name: Test Param - 1
                        description: Testing please ignore
                        defaultValue: '10'
                        type: REQUIRED
                        dataType: INTEGER
                      - id: 95
                        name: Test Param - 2
                        description: Testing please ignore
                        defaultValue: '50'
                        type: OPTIONAL
                        dataType: STRING
                      - id: 96
                        name: New param - 3
                        description: Testing please ignore
                        defaultValue: '50'
                        type: OPTIONAL
                        dataType: STRING
                    executionType: SHELL
                    installTimeout: 50
                    attachment:
                      id: 0
                      name: apache-restart.sh
                      contentURL: 'https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=6.00'
                    scriptVersion: '6.00'
                    registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                    registryValue: 'dword:00000001'
                    processName: cmd.exe
                    serviceName: OpsRampAgent
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                platforms:
                  type: array
                  items:
                    type: string
                registryPath:
                  type: string
                registryValue:
                  type: string
                processName:
                  type: string
                serviceName:
                  type: string
                parameters:
                  type: array
                  items:
                    $ref: '#/components/schemas/rbaScriptParameter'
                executionType:
                  type: string
                installTimeout:
                  type: number
                attachment:
                  type: object
                  properties:
                    name:
                      type: string
                    file:
                      type: string
            examples:
              example-rba-script:
                value:
                  name: Restart Apache Service
                  description: Restart Apache Service
                  platforms:
                    - WINDOWS
                    - LINUX
                  registryPath: HKEY_CURRENT_USER/Control Panel/Desktop
                  registryValue: 'dword:00000001'
                  processName: cmd.exe
                  serviceName: OpsRampAgent
                  parameters:
                    - name: Test Param - 1
                      description: Testing please ignore
                      defaultValue: '10'
                      type: REQUIRED
                      dataType: INTEGER
                    - name: Test Param - 2
                      description: Testing please ignore
                      defaultValue: '50'
                      type: OPTIONAL
                      dataType: STRING
                    - name: New param - 3
                      description: Testing please ignore
                      defaultValue: '50'
                      type: OPTIONAL
                      dataType: STRING
                  executionType: SHELL
                  installTimeout: 50
                  attachment:
                    name: apache-restart.sh
                    file: UkVTVEFSVD0iL3NiaW4vc2VydmljZSBodHRwZCByZXN0YXJ0Ig0KUEdSRVA9Ii91c3IvYmluL3BncmVwIg0KSFRUUEQ9Imh0dHBkIg0KJFBHUkVQICR7SFRUUER9DQppZiBbICQ/IC1uZSAwIF0NCnRoZW4NCiAkUkVTVEFSVA0KZmk=
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - $ref: '#/components/parameters/categoryId'
      - $ref: '#/components/parameters/scriptId'
  '/api/v2/tenants/{tenantId}/rba/scripts/{scriptId}/paginatedOutputs':
    summary: Get Output Logs
    description: Gets paginated output logs of a script.
    get:
      tags:
        - automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        output:
                          type: string
                        responseDate:
                          type: string
                        type:
                          type: string
                        task:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                        owner:
                          type: object
                          properties:
                            loginName:
                              type: string
                            lastName:
                              type: string
                            firstName:
                              type: string
                            email:
                              type: string
                            phoneNumber:
                              type: string
                  totalResults:
                    type: integer
                  orderBy:
                    type: string
                  pageNo:
                    type: integer
                  pageSize:
                    type: integer
                  totalPages:
                    type: integer
                  nextPage:
                    type: boolean
                  previousPageNo:
                    type: integer
                  descendingOrder:
                    type: boolean
              examples:
                example-get-rba-scripts:
                  value:
                    results:
                      - output: Agent Offline
                        responseDate: '2017-04-02T05:35:10+0000'
                        type: ONDEMAND
                        task:
                          id: '8'
                          name: Host Namme
                        device:
                          id: 3b05e1ff-9eac-476d-8d45-06c8e1f5299f
                          generalInfo:
                            osName: Ubuntu 12.04.5 LTS
                            ipAddresses: 172.22.221.41
                            hostName: luminalto-qa45k.luml.com
                          clientUniqueId: client_69828
                          type: DEVICE
                        owner:
                          loginName: superadmin
                          lastName: Admin
                          firstName: Super
                          email: john.smith@domain.com
                          phoneNumber: ''
                      - output: Agent Offline
                        responseDate: '2017-04-02T05:35:10+0000'
                        type: ONDEMAND
                        task:
                          id: '8'
                          name: Host Namme
                        device:
                          id: DEV0000015681
                          generalInfo:
                            osName: 'Microsoft Windows 7 Professional Service Pack 1, 32-bit'
                            ipAddresses: 172.22.221.37
                            hostName: qa-win2k8ssta.testbed.qa.com
                            osbuildNumber: 0
                          clientUniqueId: client_69828
                          type: DEVICE
                        owner:
                          loginName: superadmin
                          lastName: Admin
                          firstName: Super
                          email: john.smith@domain.com
                          phoneNumber: ''
                      - output: ''
                        responseDate: '2017-04-02T05:35:10+0000'
                        type: ONDEMAND
                        device:
                          id: DEV0000015679
                          generalInfo:
                            ipAddresses: 172.22.221.107
                            hostName: hydpc007.luminalto.com
                            buildNumber: 0
                          clientUniqueId: client_69828
                          type: DEVICE
                        owner:
                          id: USR0000000001
                          loginName: superadmin
                          lastName: Admin
                          firstName: Super
                          email: john.smith@domain.com
                          phoneNumber: ''
                    totalResults: 2
                    orderBy: res.response_time
                    pageNo: 1
                    pageSize: 100
                    totalPages: 1
                    nextPage: false
                    previousPageNo: 0
                    descendingOrder: true
    parameters:
      - $ref: '#/components/parameters/tenantId'
      - $ref: '#/components/parameters/scriptId'
  '/api/v2/tenants/{tenant_id}/metadata/processes':
    summary: Create a Process Workflow Automation
    description: Create a Process Workflow Automation
    parameters:
      - schema:
          type: string
        name: tenant_id
        in: path
        required: true
        description: clientId of the tenant
    post:
      summary: Create a Process Definition
      operationId: post-api-v2-tenants-tenant_id-metadata-processes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                x-examples:
                  example-1:
                    uniqueId: PROCESS_56381b97-67f7-410e-bec1-c3eb5766bc2a
                properties:
                  uniqueId:
                    type: string
                    minLength: 1
              examples:
                example-process-definition:
                  value:
                    uniqueId: PROCESS_56381b97-67f7-410e-bec1-c3eb5766bc2a
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/workflow'
            examples:
              example-process-definition:
                value:
                  name: Sample Workflow
                  createdDate: '2020-01-21T07:02:02+0000'
                  createdBy: USR0000000273
                  updatedDate: '2020-01-22T04:51:33+0000'
                  updatedBy: USR0000000007
                  description: ''
                  enabled: false
                  variables: []
                  startEvents:
                    - '@type': SignalStartEvent
                      uniqueId: StartEvent_1pxu3q3
                      name: 'null'
                      formName: alert
                      eventOperation: CREATED
                      eventCondition: $currentState = "Critical"
                  activities:
                    - '@type': SendMessageTask
                      uniqueId: Task_0eogjde
                      name: Mail event
                      entity: $StartEvent_1pxu3q3.alert
                      async: false
                      messageRecipients:
                        ROSTER: ''
                        USER: buser3
                        USERGROUP: ''
                      notificationTemplateRef: c2fa27a5-2ad7-4de6-ba44-947363b37f54
                      notificationPriority: NORMAL
                    - '@type': RestServiceTask
                      uniqueId: Task_0t8lier
                      name: Invoke integration
                      entity: $StartEvent_1pxu3q3.alert
                      async: false
                      integrationRef: INTG-2418f51d-f2c9-41a9-9ef1-9d4f8c74b5eb
                      integrationEventRef: INTG-EVENT-b59c3af5-77ef-4ca2-a0a6-6f2c4cc8d3a1
                    - '@type': SendMessageTask
                      uniqueId: Task_0t1v9n2
                      name: Update mail
                      entity: $StartEvent_1pxu3q3.alert
                      async: false
                      messageRecipients:
                        ROSTER: ''
                        USER: buser3
                        USERGROUP: ''
                      notificationTemplateRef: c2fa27a5-2ad7-4de6-ba44-947363b37f54
                      notificationPriority: NORMAL
                  gateways:
                    - '@type': ExclusiveGateway
                      uniqueId: ExclusiveGateway_1x5l54b
                      name: 'null'
                      defaultSequenceFlow: SequenceFlow_1tycyne
                  sequenceFlows:
                    - '@type': SequenceFlow
                      uniqueId: SequenceFlow_17hco2p
                      name: 'null'
                      source: Task_0t8lier
                      target: ExclusiveGateway_1x5l54b
                    - '@type': SequenceFlow
                      uniqueId: SequenceFlow_1rhs6kb
                      name: 'null'
                      source: Task_0t1v9n2
                      target: EndEvent_1spnb7x
                    - '@type': SequenceFlow
                      uniqueId: SequenceFlow_08qvs1l
                      name: '1'
                      source: ExclusiveGateway_1x5l54b
                      target: Task_0t1v9n2
                      conditionExpression: $Task_0t8lier.priority = "High"
                    - '@type': SequenceFlow
                      uniqueId: SequenceFlow_1hszcv0
                      name: 'null'
                      source: Task_0eogjde
                      target: EndEvent_0im2rr5
                    - '@type': SequenceFlow
                      uniqueId: SequenceFlow_0b2ikfc
                      name: 'null'
                      source: StartEvent_1pxu3q3
                      target: Task_0t8lier
                    - '@type': SequenceFlow
                      uniqueId: SequenceFlow_1tycyne
                      name: '2'
                      source: ExclusiveGateway_1x5l54b
                      target: Task_0eogjde
                      conditionExpression: $Task_0t8lier.priority = "Low"
                  endEvents:
                    - '@type': EndEvent
                      uniqueId: EndEvent_0im2rr5
                      name: 'null'
                    - '@type': EndEvent
                      uniqueId: EndEvent_1spnb7x
                      name: 'null'
      tags:
        - automation
  '/api/v2/tenants/{tenant_id}/metadata/processes/{uniqueId}':
    summary: Manage Process Workflows
    description: Get and Delete Process workflows
    parameters:
      - schema:
          type: string
        name: tenant_id
        in: path
        required: true
        description: tenantId of the client
      - schema:
          type: string
        name: uniqueId
        in: path
        required: true
        description: Process unique identifier
    delete:
      summary: This API Is to Delete the Process Definition
      operationId: delete-api-v2-tenants-tenant_id-metadata-processes-uniqueId
      responses:
        '200':
          description: OK
      description: ''
      tags:
        - automation
    get:
      summary: This API Retrieves the Given Process Definition
      operationId: get-api-v2-tenants-tenant_id-metadata-processes-uniqueId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/activeWorkflow'
              examples:
                example-process-definition-details:
                  value:
                    name: HandleResourceCreation
                    uniqueId: d7f85078-d922-4107-b18e-e698310145ec
                    enabled: true
                    permissions:
                      - roleId: 'pepsi_cloud_role_id '
                        permissionLevel: VIEW
                    createdDate: '2018-10-08T11:49:21 0000'
                    createdBy: Joe Bob
                    updatedDate: '2018-11-01T11:49:21 0000'
                    updatedBy: Sally Sue
                    variables:
                      - id: '400000001'
                        name: REST Result
                        dataType: STRING
                        required: true
                    inputs: []
                    outputs: []
                    startEvents:
                      - '@type': SignalStartEvent
                        uniqueId: m5b85078-d922-4107-b18e-7f98310145ec
                        formName: resource
                        eventOperation: CREATED
                        eventCondition: $location.name = "San Jose"
                      - '@type': TimerStartEvent
                        uniqueId: i4385078-d922-4107-b18e-7f98310138wr
                        timeInterval: 'R5/2019-07-01T13:00:00Z'
                        repeatRule: F2M
                    activities:
                      - '@type': SendMessageTask
                        uniqueId: l8c85078-d922-4107-b18e-7f98950145ec
                        entity: $m5b85078-d922-4107-b18e-7f98310145ec.resource
                        messageRecipients:
                          USER: 'johnDoe, sallySue'
                          USERGROUP: 'SR Approver Group, Shared Service Admins'
                          ROSTER: '1st Shift Roster, Primary Escalation Contacts'
                        notificationTemplateRef: ...
                        notificationPriority: NORMAL
                      - '@type': RestServiceTask
                        uniqueId: o0j85078-d922-4107-b18e-7f98310189u1
                        serviceRef: 875ed563-325d-49a3-b01d-9fae0ac88ue9
                        entityType: RESOURCE
                        entity: $m5b85078-d922-4107-b18e-7f98310145ec.resource
                      - '@type': TimerIntermediateEvent
                        uniqueId: 28r85078-d922-8707-b18e-7f98950149rk
                        timeOrDuration: PT2H
                    displayProps: ...
      tags:
        - automation
  '/api/v2/tenants/{tenant_id}/metadata/processes/search':
    summary: Search Process Workflows
    description: Search process workflows
    parameters:
      - schema:
          type: string
        name: tenant_id
        in: path
        required: true
        description: clientId of the tenant
    get:
      description: This API can be used to search processes of a client.
      operationId: get-api-v2-tenants-tenant_id-metadata-processes-search
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                x-examples:
                  example-1:
                    totalResults: 1
                    orderBy: createdTime
                    pageNo: 1
                    pageSize: 100
                    totalPages: 1
                    nextPage: false
                    previousPageNo: 0
                    descendingOrder: true
                properties:
                  totalResults:
                    type: number
                  orderBy:
                    type: string
                    minLength: 1
                  pageNo:
                    type: number
                  pageSize:
                    type: number
                  totalPages:
                    type: number
                  nextPage:
                    type: boolean
                  previousPageNo:
                    type: number
                  descendingOrder:
                    type: boolean
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/activeProcess'
                required:
                  - totalResults
                  - orderBy
                  - pageNo
                  - pageSize
                  - totalPages
                  - nextPage
                  - previousPageNo
                  - descendingOrder
              examples:
                example-attributesToFetch:
                  value:
                    results:
                      - name: HandleResourceCreation
                        updatedDate: '2018-11-01T11:49:21 0000'
                        updatedBy: Sally Sue
                        startEvents:
                          - '@type': SignalStartEvent
                            uniqueId: m5b85078-d922-4107-b18e-7f98310145ec
                            formName: resource
                            eventOperation: CREATED
                            eventCondition: $location.name = "San Jose"
                          - '@type': TimerStartEvent
                            uniqueId: i4385078-d922-4107-b18e-7f98310138wr
                            timeInterval: 'R/2019-07-01T13:00:00Z'
                            repeatRule: F1D
                    totalResults: 1
                    orderBy: createdTime
                    pageNo: 1
                    pageSize: 100
                    totalPages: 1
                    nextPage: false
                    previousPageNo: 0
                    descendingOrder: true
                example-without-attributes:
                  value:
                    results:
                      - name: HandleResourceCreation
                        uniqueId: d7f85078-d922-4107-b18e-e698310145ec
                        enabled: true
                        permissions:
                          - roleId: pepsi_cloud_role_id
                            permissionLevel: VIEW
                        createdDate: '2018-10-08T11:49:21 0000'
                        createdBy: Joe Bob
                        updatedDate: '2018-11-01T11:49:21 0000'
                        updatedBy: Sally Sue
                        variables:
                          - id: '400000001'
                            name: REST Result
                            dataType: STRING
                            required: true
                        inputs: []
                        outputs: []
                        startEvents:
                          - '@type': SignalStartEvent
                            uniqueId: m5b85078-d922-4107-b18e-7f98310145ec
                            formName: resource
                            eventOperation: CREATED
                            eventCondition: $location.name = "San Jose"
                          - '@type': TimerStartEvent
                            uniqueId: i4385078-d922-4107-b18e-7f98310138wr
                            timeInterval: 'R/2019-07-01T13:00:00Z'
                            repeatRule: F1D
                        activities:
                          - '@type': SendMessageTask
                            uniqueId: l8c85078-d922-4107-b18e-7f98950145ec
                            entity: $m5b85078-d922-4107-b18e-7f98310145ec.resource
                            messageRecipients:
                              Users: 'johnDoe, sallySue'
                              Groups: 'SR Approver Group, Shared Service Admins'
                              Rosters: '1st Shift Roster, Primary Escalation Contacts'
                            notificationTemplateRef: ...
                            notificationPriority: NORMAL
                          - '@type': RestServiceTask
                            uniqueId: o0j85078-d922-4107-b18e-7f98310189u1
                            serviceRef: 875ed563-325d-49a3-b01d-9fae0ac88ue9
                            entityType: RESOURCE
                            entity: $m5b85078-d922-4107-b18e-7f98310145ec.resource
                          - '@type': TimerIntermediateEvent
                            uniqueId: 28r85078-d922-8707-b18e-7f98950149rk
                            timeOrDuration: PT2H
                    totalResults: 1
                    orderBy: createdTime
                    pageNo: 1
                    pageSize: 100
                    totalPages: 1
                    nextPage: false
                    previousPageNo: 0
                    descendingOrder: true
      tags:
        - automation
      parameters:
        - schema:
            type: string
          in: query
          name: processName
          description: Query processes with name
        - schema:
            type: string
            enum:
              - SIGNAL
              - TIMER
              - NONE
          in: query
          name: startEventType
          description: Query  processes that are having event type
        - schema:
            type: string
            enum:
              - CREATED
              - UPDATED
          in: query
          name: startEventOperation
          description: Query process with operation type
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
          in: query
          name: enabled
          description: Query processes that are enabled or not enabled.
        - schema:
            type: string
          in: query
          description: Query processes that are deployed or not deployed.
          name: deployed
        - schema:
            type: string
            enum:
              - alert
              - resource
              - incident
          in: query
          name: formName
          description: Query processes that are defined against start event object.
  '/api/v2/tenants/{tenantId}/metadata/processes/processInstances/{processInstanceId}':
    summary: Manage Process Instances
    description: Get and delete process instances.
    parameters:
      - schema:
          type: string
        name: tenantId
        in: path
        required: true
        description: clientId of the tenant
      - schema:
          type: string
        name: processInstanceId
        in: path
        required: true
        description: UUID of the process instance
    get:
      description: This API retrieves the given process instance.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/processInstance'
              examples:
                example-process-instance:
                  value:
                    id: 53db2698-a99e-11eb-bad2-5254003eb5f4
                    processDefinitionId: PROCESS_f8d6c135-a33e-4458-a88f-fd541e766041
                    processDefinitionName: Timer - daily
                    processDefinitionVersion: 1
                    deploymentId: 2fd6e58e-a740-11eb-b0d7-525400bf3044
                    startTime: 1619778304000
                    startEventId: StartEvent_1cw81lg
                    tenantId: client_160
                    state: ACTIVE
                    diagram: ...
                    activityInstances:
                      - activityId: StartEvent_1cw81lg
                        activityName: timer
                        activityType: startTimerEvent
                        startTime: 1619778304000
                        endTime: 1619778304000
                        durationInMillis: 5
                        activityInstanceId: 'StartEvent_1cw81lg:53db74b9-a99e-11eb-bad2-5254003eb5f4'
                        completeScope: false
                        canceled: false
                      - activityId: Task_1kj1ze4
                        activityName: Task
                        activityType: userTask
                        startTime: 1619778304000
                        activityResult: '{"task":"TASK0000199936"}'
                        activityInstanceId: 'Task_1kj1ze4:53ea41cb-a99e-11eb-bad2-5254003eb5f4'
                        completeScope: false
                        canceled: false
                    variables:
                      - id: 54e14bfe-a99e-11eb-bad2-5254003eb5f4
                        name: 53db2698-a99e-11eb-bad2-5254003eb5f4
                        type: object
                        value: '{task=TASK0000199936}'
                    userTasks:
                      - startTime: 1619778304000
                        id: TASK0000199936
                        name: Task
                        description: User Task daily
                        asigneeGroup: 5.5 Group
                        completeScope: false
                        canceled: false
                    statistics:
                      - id: Task_1kj1ze4
                        instances: 1
                    errors: []
      operationId: get-api-v2-tenants-tenantId-metadata-processes-processInstances-processInstanceId
      tags:
        - automation
    delete:
      description: This API cancels the given running process instance.
      operationId: delete-api-v2-tenants-tenantId-metadata-processes-processInstances-processInstanceId
      responses:
        '200':
          description: OK
      tags:
        - automation
  '/api/v2/tenants/{tenant_id}/metadata/processes/processInstances/search':
    summary: Search Process Instances
    description: Search process instances.
    parameters:
      - schema:
          type: string
        name: tenant_id
        in: path
        required: true
        description: clientId of the tentant
    get:
      description: This API can be used to search process instances of a client.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                x-examples:
                  example-1:
                    totalResults: 205
                    orderBy: startTime
                    pageNo: 1
                    pageSize: 20
                    totalPages: 11
                    nextPage: true
                    nextPageNo: 2
                    previousPageNo: 0
                    descendingOrder: true
                properties:
                  totalResults:
                    type: number
                  orderBy:
                    type: string
                    minLength: 1
                  pageNo:
                    type: number
                  pageSize:
                    type: number
                  totalPages:
                    type: number
                  nextPage:
                    type: boolean
                  nextPageNo:
                    type: number
                  previousPageNo:
                    type: number
                  descendingOrder:
                    type: boolean
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/activeProcessInstance'
                required:
                  - totalResults
                  - orderBy
                  - pageNo
                  - pageSize
                  - totalPages
                  - nextPage
                  - nextPageNo
                  - previousPageNo
                  - descendingOrder
              examples:
                example-process-instances:
                  value:
                    results:
                      - id: a2e3849f-3dfa-11eb-ad00-12d3805c3647
                        processDefinitionId: PROCESS_d6d9c259-21f3-4018-b3c0-f19ccdc8a3d7
                        processDefinitionName: up
                        processDefinitionVersion: 1
                        startTime: 1607943225000
                        startEventId: StartEvent_14tu1x3
                        startEventType: NONE
                        tenantId: client_11
                        state: ACTIVE
                      - id: cb6ef8ee-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680870000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: cb5fddb8-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680870000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: cb555662-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680870000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: cb20ffeb-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680870000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: cab063bd-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680869000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: c6349f92-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680862000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: c5fc2a6a-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680861000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: c5da7192-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680861000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: c5d0fbad-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680861000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: c0cb951c-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680853000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: c07cffe6-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680852000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: be6f2e7c-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680849000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: be034d46-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680848000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: bdb49100-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680847000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: b96534f9-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680840000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: b9611644-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680840000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: b8434a27-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680838000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: b826c172-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680838000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                      - id: b81bebfd-3b97-11eb-9cb7-12d3805c3647
                        processDefinitionId: PROCESS_2d0c96e1-0a78-454f-b888-713b10a22563
                        processDefinitionName: alert actions
                        processDefinitionVersion: 12
                        startTime: 1607680838000
                        startEventId: StartEvent_1krjkj1
                        startEventType: SIGNAL
                        tenantId: client_11
                        state: ACTIVE
                    totalResults: 205
                    orderBy: startTime
                    pageNo: 1
                    pageSize: 20
                    totalPages: 11
                    nextPage: true
                    nextPageNo: 2
                    previousPageNo: 0
                    descendingOrder: true
      operationId: get-api-v2-tenants-tenant_id-metadata-processes-processInstances-search
      tags:
        - automation
      parameters:
        - schema:
            type: string
            enum:
              - ACTIVE
              - COMPLETED
              - INTERNALLY_TERMINATED
              - EXTERNALLY_TERMIANTED
              - SUSPENDED
          in: query
          name: state
          description: Query based on process instances states
        - schema:
            type: string
          in: query
          name: startedAfter
          description: Query for process instances that are started after
        - schema:
            type: string
          in: query
          name: startedBefore
          description: Query for  process instances that are started before
        - schema:
            type: string
          in: query
          name: finishedBefore
          description: Query for process instances that are finished before
        - schema:
            type: string
          in: query
          name: finishedAfter
          description: Query for process instances that are finishes after
        - schema:
            type: string
          in: query
          name: processDefinitionId
          description: Query for process instances against process definition id
        - schema:
            type: string
          in: query
          name: processDefinitionName
          description: Query for  process instances against process definition name
  '/api/v2/tenants/{tenant_id}/metadata/processes/{action}/{uniqueId}':
    summary: Process Actions
    description: Process actions.
    parameters:
      - schema:
          type: string
        name: tenant_id
        in: path
        required: true
        description: clientId of the tenant
      - schema:
          type: string
        name: action
        in: path
        required: true
        description: action = deploy or start
      - schema:
          type: string
        name: uniqueId
        in: path
        required: true
        description: process uuid
    post:
      operationId: post-api-v2-tenants-tenant_id-metadata-processes-action-uniqueId
      responses:
        '200':
          description: OK
      requestBody:
        content:
          application/json:
            schema:
              description: ''
              type: object
              x-examples:
                example-1:
                  StartEvent_13p9zxn:
                    alert: '959'
                    eventType: CREATED
              properties:
                StartEvent_13p9zxn:
                  type: object
                  properties:
                    alert:
                      type: string
                      minLength: 1
                    eventType:
                      type: string
                      minLength: 1
                    resource:
                      type: string
            examples:
              example-process-alert-event:
                value:
                  StartEvent_13p9zxn:
                    alert: '959'
                    eventType: CREATED
              example-process-resource-event:
                value:
                  StartEvent_13p9zxn:
                    resource: 459d4958-01a4-464f-adf3-b00bbbb27b94
                    eventType: CREATED
      tags:
        - automation
  '/v2/tenants/{tenant_id}/metadata/processes/externalTaskExecutionResult':
    summary: Signal External Task
    description: Signal external task execution
    parameters:
      - schema:
          type: string
        name: tenant_id
        in: path
        required: true
        description: clientId of the tenant
    post:
      operationId: post-v2-tenants-tenant_id-metadata-processes-externalTaskExecutionResult
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                example-external-task-success:
                  value: SUCCESS
                example-external-task-failure:
                  value: FAILURE
      requestBody:
        content:
          application/json:
            schema:
              description: ''
              type: object
              x-examples:
                example-1:
                  executionId: ca02d58b-fc81-4b2b-8136-2a7cab564836
                  status: SUCCESS
                  taskExecutionResult:
                    output: Agent Offline
              properties:
                executionId:
                  type: string
                  minLength: 1
                  description: Execution identifier
                status:
                  type: string
                  minLength: 1
                  description: Status of the execution
                  enum:
                    - SUCCESS
                    - FAILURE
                taskExecutionResult:
                  type: object
                  required:
                    - output
                  properties:
                    output:
                      type: string
                      minLength: 1
                      description: Output message of the executed task.
              required:
                - executionId
                - status
                - taskExecutionResult
            examples:
              example-process-external-task:
                value:
                  executionId: ca02d58b-fc81-4b2b-8136-2a7cab564836
                  status: SUCCESS
                  taskExecutionResult:
                    output: Agent Offline
      tags:
        - automation
components:
  securitySchemes:
    accessToken:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: 'https://subdomain.api.opsramp.com'
          scopes: {}
  parameters:
    tenantId:
      in: path
      name: tenantId
      schema:
        type: string
      required: true
      description: Describes the client ID or msp ID of the tenant.
      x-more-information-url: /
      x-more-information-title: See "Getting Started" guide
    jobId:
      name: jobId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Job unique identifier
    categoryId:
      name: categoryId
      in: path
      required: true
      schema:
        type: string
      description: Defined category id
    scriptId:
      name: scriptId
      in: path
      required: true
      schema:
        type: string
      description: Given script id
  schemas:
    generalInfo:
      title: generalInfo
      type: object
      properties:
        ipAddresses:
          type: string
        hostName:
          type: string
        osName:
          type: string
        osBuildNumber:
          type: string
    resource:
      title: resource
      type: object
      properties:
        id:
          type: string
        generalInfo:
          $ref: '#/components/schemas/generalInfo'
        clientUniqueId:
          type: string
        type:
          type: string
    entities:
      title: entities
      type: array
      items:
        type: object
        properties:
          resource:
            $ref: '#/components/schemas/resource'
    pattern:
      title: pattern
      type: object
      properties:
        type:
          type: string
          description: Recurrence pattern type.
          enum:
            - daily
            - weekly
            - monthly
            - never
            - run once
        frequency:
          type: string
          description: |
            Days on which the schedule is applied. Frequency is dependent on recurrence pattern type. Example: Provide type as weekly, then frequency is the day on which the job is run.
          enum:
            - everyday
            - every weekday
            - recurrence
        repeatType:
          type: string
          description: Run the job constantly on specific days.
          enum:
            - days
        weekDays:
          type: string
          description: Days on which the job is run.
          enum:
            - Sunday
            - Monday
            - Tuesday
            - Wednesday
            - Thursday
            - Saturday
        dayOfMonth:
          type: string
          description: Day on which the job is scheduled to run every month. Days range between 1 to 31.
          minLength: 1
          maxLength: 31
        weekIndex:
          type: string
          description: Week on which the job is run.
          enum:
            - First
            - Second
            - Third
            - Fourth
            - Last
        dayOfIndex:
          type: string
          description: Day on which the job is scheduled to run.
          enum:
            - Sunday
            - Monday
            - Tuesday
            - Wednesday
            - Thursday
            - Friday
            - Saturday
        repeatFrequency:
          type: integer
    schedule:
      title: schedule
      type: object
      properties:
        startDate:
          type: string
          format: date-time
        pattern:
          $ref: '#/components/schemas/pattern'
    approvalType:
      title: approvalType
      type: object
      description: Approval for the job type App Install
      properties:
        approvalType:
          type: integer
          description: |
            Approval type required to install the app. Example: Provide 0 as approvalType which indicates app is manually installed.
          minimum: 0
          maximum: 1
        approvalReason:
          type: string
          description: Reason for approval of installing app.
        alertRequired:
          type: boolean
    customScript:
      title: customScript
      type: object
      description: Script ID for the job type Custom Script
      properties:
        id:
          type: string
          description: Custom script ID.
        name:
          type: string
        description:
          type: string
        platforms:
          type: array
          items:
            type: string
    configParams:
      title: configParams
      type: object
      description: Parameters to configure for the job type Network Backup Configuration
      properties:
        versionsSaved:
          type: string
          enum:
            - ALL_VERSIONS
            - VERSION_WITH_CHANGES
          description: Take Backup of versions saved.
        backUpTrigger:
          type: boolean
          description: Perform a backup on the receipt of a configuration change SNMP Trap.
        startupConfigAlert:
          type: boolean
          description: Generate alerts on changes to startup configuration.
        runConfigAlert:
          type: boolean
          description: Generate alerts on changes to runtime configuration.
        startUpConfigFilesBackUp:
          type: boolean
          description: Startup configuration file to be backed up.
        runTimeConfigFilesBackUp:
          type: boolean
          description: Runtime configuration file to be backed up.
    script:
      title: script
      type: object
      properties:
        jobType:
          type: string
          description: 'Job type. To view job types that OpsRamp supports, see Get Job Types API.'
          enum:
            - adCheckList
            - networkconfigbackup
            - appinstall
            - custom
        userType:
          $ref: '#/components/schemas/userType'
        configParams:
          $ref: '#/components/schemas/configParams'
        approvalType:
          $ref: '#/components/schemas/approvalType'
        customScript:
          $ref: '#/components/schemas/customScript'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/parameter'
    parameter:
      title: parameter
      type: object
      properties:
        paramId:
          type: string
          description: The parameter Id
        value:
          type: string
        name:
          type: string
    userType:
      title: userType
      type: integer
      minimum: 1
      maximum: 2
      description: |-
        The user type.
        1- system user,
        2- Other user
    rba:
      title: rba
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
    rbaScriptParameter:
      title: rbaScriptParameter
      type: object
      properties:
        name:
          type: string
          description: Name of parameter.
        description:
          type: string
          description: Description for parameter.
        defaultValue:
          type: string
          description: Default Value for the parameter.
        type:
          type: string
          description: Parameter is mandatory or optional.
        dataType:
          type: string
          description: Data Type of the parameter.
          enum:
            - STRING
            - INTEGER
            - PASSWORD
    rbaScript:
      title: rbaScript
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        category:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
        platforms:
          type: array
          items:
            type: string
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/rbaScriptParameter'
        executionType:
          type: string
        installTimeout:
          type: integer
        attachment:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            contentURL:
              type: string
        scriptVersion:
          type: string
        registryPath:
          type: string
        registryValue:
          type: string
        processName:
          type: string
        serviceName:
          type: string
    workflow:
      description: ''
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Represents the name of the created process workflow.
        createdDate:
          type: string
          minLength: 1
          description: 'Create date of the process workflow  '
        createdBy:
          type: string
          minLength: 1
          description: '  Creator of the process workflow'
        updatedDate:
          type: string
          minLength: 1
          description: Last update on
        updatedBy:
          type: string
          minLength: 1
          description: last updated by
        description:
          type: string
          description: Details of the purpose ofthe workflow
        enabled:
          type: boolean
          description: This indicates if the process is enabled for execution or not.
        variables:
          type: array
          description: Associated variable details.
          items:
            type: object
            description: REST result object details.
            properties:
              id:
                type: string
                description: Variable uuid of REST output.
              name:
                type: string
                description: Variable name of the REST ouput.
              dataType:
                type: string
                description: Data Typ of the output
              required:
                type: boolean
                description: Required or not.
        startEvents:
          oneOf:
            - type: array
              description: Workflow signal event.
              items:
                $ref: '#/components/schemas/workflowSigEvent'
            - $ref: '#/components/schemas/workflowTimerEvent'
          description: 'This list contains process start events. The process can be started by a platform event (SIGNAL) or a timer.  Valid values for eventOperation is CREATED, UPDATED'
        activities:
          type: array
          description: 'This list contains activities to perform when the process is started. The supported tasks are SERVICE_TASK and SEND_MESSAGE_TASK. For the service task, the server input and output are defined by the service. The "input map" of Service Task is about how to map process variables to the service input and "output map" is about how to map the service output to process variables.'
          items:
            anyOf:
              - $ref: '#/components/schemas/msgTask'
              - $ref: '#/components/schemas/restTask'
            description: Trigger one of the event Message notification or REST message.
        endEvents:
          type: array
          uniqueItems: true
          minItems: 1
          description: Ending events process details.
          items:
            type: object
            properties:
              '@type':
                type: string
                minLength: 1
              uniqueId:
                type: string
                minLength: 1
              name:
                type: string
                minLength: 1
        gateways:
          type: array
          description: This list has decision flows termed as gateways. There are two types of gateway - Exclusive gateway and Parallel gateway. Exclusive gateway is the decision point in the flow and parallel gateway creates parallel flows. Exclustive gateway has property "defaultSequenceFlow" to indicate the default outgoing flow.
          items:
            $ref: '#/components/schemas/gateway'
        sequenceFlows:
          type: array
          description: 'This list contains sequence flow. Sequence flow links all process elements. It has "source" and "target", and optional "conditionExpression" attribute. The condition expression is typically used along with exclusive gateway(Decision flows) to direct the outgoing flow.'
          items:
            $ref: '#/components/schemas/sequenceFlow'
    activeFlow:
      description: ''
      type: object
      properties:
        uniqueId:
          type: string
          minLength: 1
          description: Active process uuid
        permissions:
          type: array
          uniqueItems: true
          minItems: 1
          description: Permission details
          items:
            type: object
            properties:
              roleId:
                type: string
                minLength: 1
                description: role uuid
              permissionLevel:
                type: string
                minLength: 1
                description: 'Supported permission '
        inputs:
          type: array
          items:
            type: string
        outputs:
          type: array
          items:
            type: string
        displayProps:
          type: string
          minLength: 1
          description: Display properties details.
    workflowSigEvent:
      description: Process flow signal event details.
      type: object
      title: ''
      properties:
        '@type':
          type: string
          minLength: 1
          description: Different types of event.
          example: SignalStartEvent
        uniqueId:
          type: string
          minLength: 1
          description: Represents the unique idenity for the process.
        name:
          type: string
          minLength: 1
          description: Signal event name.
        formName:
          type: string
          minLength: 1
          description: Associate entity for event trigger.
          example: alert
          enum:
            - alert
            - resource
        eventOperation:
          type: string
          minLength: 1
          enum:
            - CREATED
            - UPDATED
          description: 'Type of event triggered. {Created|Updated|Signal}'
        eventCondition:
          type: string
          minLength: 1
          description: Conditional expression to trigger the event.
    workflowTimerEvent:
      description: Time Process flow events details.
      type: object
      properties:
        '@type':
          type: string
          minLength: 1
          description: Timer event
        uniqueId:
          type: string
          minLength: 1
          description: uuid for process timer event
        timeInterval:
          type: string
          minLength: 1
          description: Timer event interval for event
        repeatRule:
          type: string
          minLength: 1
          description: Repeat rule
      required:
        - '@type'
        - uniqueId
        - timeInterval
        - repeatRule
    sequenceFlow:
      description: ''
      type: object
      properties:
        '@type':
          type: string
          minLength: 1
          default: SequenceFlow
          description: Sequence flow identifier
        uniqueId:
          type: string
          minLength: 1
          description: Sequence flow process uuid.
        name:
          type: string
          minLength: 1
          description: Sequence flow process name.
        source:
          type: string
          minLength: 1
          description: From source event.
        target:
          type: string
          minLength: 1
          description: To Target event
        conditionExpression:
          type: string
          minLength: 1
          description: Conditional expression as permited by the system.
      required:
        - '@type'
        - uniqueId
        - name
        - source
        - target
    endEvent:
      description: ''
      type: object
      properties:
        '@type':
          type: string
          minLength: 1
          enum:
            - EndEvent
        uniqueId:
          type: string
          minLength: 1
          description: unique identifier for the process.
        name:
          type: string
          minLength: 1
          description: End event process name
      required:
        - '@type'
        - uniqueId
        - name
    gateway:
      description: Decision flow operator
      type: object
      properties:
        '@type':
          type: string
          minLength: 1
          description: Type of decision flow.
          enum:
            - ExclusiveGateway
            - ParallelGateway
        uniqueId:
          type: string
          minLength: 1
          description: Unique idenfier of the decision gateway.
        name:
          type: string
          minLength: 1
          description: |
            Name of decision flow gateway.
        defaultSequenceFlow:
          type: string
          minLength: 1
          description: Default sequence flow unique identifier.
      required:
        - '@type'
        - uniqueId
        - name
        - defaultSequenceFlow
    processInstance:
      description: Processinstance details.
      type: object
      title: ''
      properties:
        id:
          type: string
          minLength: 1
          description: Unique process instance id
        processDefinitionId:
          type: string
          minLength: 1
          description: Process definition uniqueId
        processDefinitionName:
          type: string
          minLength: 1
          description: Process definition name
        processDefinitionVersion:
          type: number
          description: Process definition version
        startTime:
          type: number
          description: Start time in long number
        deploymentId:
          type: string
          minLength: 1
          description: Process definition delployment Id
        startEventId:
          type: string
          minLength: 1
          description: unique start event idenfier
        tenantId:
          type: string
          minLength: 1
          description: Client uuid
        state:
          type: string
          minLength: 1
          description: Current state
          enum:
            - ACTIVE
            - INACTIVE
        diagram:
          type: string
          minLength: 1
          description: Process definition workflow
        activityInstances:
          type: array
          description: Activity instances collections
          items:
            $ref: '#/components/schemas/activityInstance'
        userTasks:
          type: array
          description: Uer
          items:
            $ref: '#/components/schemas/userTask'
        statistics:
          type: array
          description: Process statistics collection
          items:
            $ref: '#/components/schemas/statistic'
        errors:
          type: array
          description: Error collections.
          items:
            type: string
        variables:
          type: array
          description: REST output object collection.
          items:
            $ref: '#/components/schemas/variable'
      required:
        - id
        - processDefinitionId
        - processDefinitionName
        - processDefinitionVersion
        - startTime
        - deploymentId
        - startEventId
        - tenantId
        - state
    msgTask:
      description: SEND_MESSAGE_TASK i..e Message notification task
      type: object
      properties:
        '@type':
          type: string
          minLength: 1
          description: Task type
        uniqueId:
          type: string
          minLength: 1
          description: Unique identifier of the notificaton process
        name:
          type: string
          minLength: 1
          description: Name of notification process.
        entity:
          type: string
          minLength: 1
          description: Related start event.
        async:
          type: boolean
          description: Async notification to be true or false.
          default: false
        messageRecipients:
          type: object
          description: Notifications receipients
          properties:
            ROSTER:
              type: string
              description: Roster name
            USER:
              type: string
              minLength: 1
              description: user name to notify
            USERGROUP:
              type: string
              description: usergroup to notify
        notificationTemplateRef:
          type: string
          minLength: 1
          description: uuid of the notification template
        notificationPriority:
          type: string
          minLength: 1
          description: Notification priority i..e Normal to High
          example: NORMAL
    restTask:
      description: REST task process details.
      type: object
      title: ''
      properties:
        '@type':
          type: string
          minLength: 1
          enum:
            - RestServiceTask
          description: REST task definition identifier
        uniqueId:
          type: string
          minLength: 1
          description: REST task unique identifier
        name:
          type: string
          minLength: 1
          description: Name of the REST task
        entity:
          type: string
          minLength: 1
          description: Related start event.
          enum:
            - RESOURCE
            - ALERT
        async:
          type: boolean
          description: Sync or Asyn process.
        integrationRef:
          type: string
          minLength: 1
          description: Associated integration uuid.
        integrationEventRef:
          type: string
          minLength: 1
          description: Associated integration event uuid.
    permission:
      description: Permission details.
      type: object
      properties:
        roleId:
          type: string
          minLength: 1
          description: The uuid of the role who has the access to this process workflows.
        permissionLevel:
          type: string
          minLength: 1
          description: 'The level of access. The valid value is: VIEW. VIEW perssmion lets  the user in the role to view the process workflow.Only Administrator role can create or update the process definition.'
      required:
        - roleId
        - permissionLevel
    activeWorkflow:
      title: activeWorkflow
      allOf:
        - $ref: '#/components/schemas/workflow'
        - $ref: '#/components/schemas/activeFlow'
    activeProcess:
      description: ''
      type: object
      properties:
        name:
          type: string
          minLength: 1
        updatedDate:
          type: string
          minLength: 1
        updatedBy:
          type: string
          minLength: 1
        startEvents:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/workflowSigEvent'
              - $ref: '#/components/schemas/workflowTimerEvent'
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/permission'
        inputs:
          type: array
          items:
            type: string
        outputs:
          type: array
          items:
            type: string
        activities:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/msgTask'
              - $ref: '#/components/schemas/restTask'
              - $ref: '#/components/schemas/timerIntmEvent'
        variables:
          type: array
          items:
            $ref: '#/components/schemas/variable'
    timerIntmEvent:
      description: Time event process details.
      type: object
      properties:
        '@type':
          type: string
          minLength: 1
          enum:
            - TimerStartEvent
          description: Time event process type
        uniqueId:
          type: string
          minLength: 1
          description: Unique identifier for the timer event process
        timeInterval:
          type: string
          minLength: 1
          description: The time interval within which the event will trigger.
        timeOrDuration:
          type: string
          description: Timer duration for event trigger.
          example: PT2H
    userTask:
      description: ''
      type: object
      properties:
        startTime:
          type: number
          description: Start time in long number
        id:
          type: string
          minLength: 1
          description: Unique id of the timer event.
        name:
          type: string
          minLength: 1
          description: Name of the user Task
        description:
          type: string
          minLength: 1
          description: Purpose description of the user task process.
        asigneeGroup:
          type: string
          minLength: 1
          description: Assigned group for the task
        completeScope:
          type: boolean
        canceled:
          type: boolean
      required:
        - startTime
        - id
        - name
        - description
        - asigneeGroup
        - completeScope
        - canceled
    statistic:
      description: ''
      type: object
      properties:
        id:
          type: string
          minLength: 1
        instances:
          type: number
      required:
        - id
        - instances
    activityInstance:
      description: Activity instance details
      type: object
      properties:
        activityId:
          type: string
          minLength: 1
          description: Unique identify of the activity
        activityName:
          type: string
          minLength: 1
          description: Acitivty Name
        activityType:
          type: string
          minLength: 1
          description: Acivity Type
          example: userTask
          enum:
            - userTask
            - startTimerEvent
        startTime:
          type: number
          description: Starting time in long number
        endTime:
          type: number
          description: Ending time in long number
        durationInMillis:
          type: number
          description: Duration in milli seconds
        completeScope:
          type: boolean
        activityInstanceId:
          type: string
          minLength: 1
          description: Acvitiy uuid
        canceled:
          type: boolean
          description: ''
    variable:
      description: ''
      type: object
      title: variable
      properties:
        id:
          type: string
          minLength: 1
        name:
          type: string
          minLength: 1
        type:
          type: string
          minLength: 1
        value:
          type: string
          minLength: 1
    activeProcessInstance:
      description: ''
      type: object
      properties:
        id:
          type: string
          minLength: 1
        processDefinitionId:
          type: string
          minLength: 1
        processDefinitionName:
          type: string
          minLength: 1
        processDefinitionVersion:
          type: number
        startTime:
          type: number
        startEventId:
          type: string
          minLength: 1
        startEventType:
          type: string
          minLength: 1
        tenantId:
          type: string
          minLength: 1
        state:
          type: string
          minLength: 1
      required:
        - id
        - processDefinitionId
        - processDefinitionName
        - processDefinitionVersion
        - startTime
        - startEventId
        - startEventType
        - tenantId
        - state
