Get job's configuration
/v1/yaml/jobs/{jobName}
Request
-
jobName: string
job name
Response
- text/plain
200 Response
400 Response
401 Response
Examples
- The job name must be changed or it will conflict with the existing job in the project.
- Password values, shown in the example as "********", must be replaced.
vm-template
may not be available in the new project, and must be replaced.
Two examples are shown. Both return YAML definitions of named jobs. Ordinarily, job attributes are not shown unless they are different than the defaults, but an exception is made for the versions version-map, which displays all settable values.
The first example shows how to get the YAML definition for job AppExtVBDemo-Deploy, by submitting an implicit GET request on the REST resource using curl.
~$ curl -u alex.admin https://myinstance.mycompany.com/myorg/rest/myorg_bobtest_1/cibuild/v1/yaml/jobs/AppExtVBDemo-Deploy Enter host password for user 'alex.admin': job: name: AppExtVBDemo-Deploy description: "Hand-configured YAML job for deploying an app extension" vm-template: free params: - string: name: VERSION value: 3.3.1 description: App Extension Version before: - copy-artifacts: from-job: AppExtVBDemoYAML-Package steps: - oracle-deployment: environment-name: NathanEnv service-name: FA Resource ADFCDR03 user-name: mary.jane password: "********" build-artifact: extension.vx settings: - versions: version-map: Java: 8 nodejs: 10 python3: 3.6 soa: 12.2.1.1
The second example shows how to get the YAML definitions for two related jobs, CopyArtifactsIn and CopyArtifactsOut, by submitting implicit GET requests on the REST resources using two curl commands. In some cases, like this one, the YAML versions of job declarations may be easier to understand than their GUI counterparts, because you can see all of the details of the configuration at once, instead of looking through multiple tabs in more than one job.
~$ curl -u alex.admin https://myinstance.mycompany.com/myorg/rest/myorg_bobtest_1/cibuild/v1/yaml/jobs/CopyArtifactsOut Enter host password for user 'alex.admin': job: name: CopyArtifactsOut vm-template: free steps: - shell: script: "echo \"Hello, World!\" > file.txt" after: - artifacts: include: "*.txt" settings: - versions: version-map: Java: 8 nodejs: 10 python3: 3.6 soa: 12.2.1.1 ~$ curl -u alex.admin https://myinstance.mycompany.com/myorg/rest/myorg_bobtest_1/cibuild/v1/yaml/jobs/CopyArtifactsIn Enter host password for user 'alex.admin': job: name: CopyArtifactsIn vm-template: free before: - copy-artifacts: from-job: CopyArtifactsOut which-build: UPSTREAM_BUILD last-successful-fallback: false steps: - shell: script: "cat file.txt # copied from previous job" settings: - versions: version-map: Java: 8 nodejs: 10 python3: 3.6 soa: 12.2.1.1