Defining Jenkins Observer jobs

Using the Jenkins Observer, you can define listen jobs that receive build information generated by the Agile Service Manager plugin for Jenkins.

Before you begin

Ensure you have the Jenkins details to hand.

Remember: Swagger documentation for the observer is available at the following default location: https://<your host>/1.0/jenkins-observer/swagger

About this task

You define and start the following job.
Listen job
The standalone listen job receives Jenkins build notification data for a specified namespace and processes it as a topology.
The listen job is long-running, and runs until it is explicitly stopped or until the observer is stopped.

Procedure

To start the Listen job

  1. To start the Jenkins Observer Listen job, use the following examples:
    curl -u PROXY_USER[:PROXY_PASSWORD] -X POST
    --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-TenantID: cfd95b7e-3bc7-4006-a4a8-a73a79c71255' --header 'Authorization: Basic YXNtOmFzbQ==' -d '{
      "unique_id": "my job",
      "type": "listen",
      "description": "job description",
      "parameters": {
        "jenkins_observation_namespace": "default"
      }
    }' 'https://localhost/1.0/jenkins-observer/jobs/listen'
    
  2. Verify that the job is running.
    curl -u PROXY_USER[:PROXY_PASSWORD] -X GET --header 'Accept: application/json' --header 'X-TenantID: cfd95b7e-3bc7-4006-a4a8-a73a79c71255' 'https://localhost/1.0/jenkins-observer/jobs/my%20job'

What to do next

Remember: In addition to being configurable from the Observer Configuration UI, all on-prem observer jobs also have scripts to start and stop all available jobs, to list the status of a current job, and to set its logging levels. Scripts can be run with -h or --help to display help information, and with -v or --verbose to print out the details of the actions performed by the script, including the full cURL command. For the on-prem version of Agile Service Manager, observer scripts are configured for specific jobs by editing the script configuration files.