Plan directory information REST API

 

An upcoming Bamboo release will make changes to the on-disk directory structure for BAMBOO_HOME.  The changes are required for the improvement of the robustness of some Bamboo features.  

As the use cases for this endpoint are somewhat different to the typical usage of Bamboo REST API functionality and the information disclosed is relatively low-risk, we have decided to make the access control strategy configurable using a system property.

For more information about system properties, see Starting Bamboo.

Plan directory information property details

The bamboo.plan.directory.info.rest is a system property with the following settings:

 

disabled (default) 

The plan directory information REST API is disabled and all requests will be rejected

local

The plan directory information REST API is available without authentication to any request originating from localhost 

anonymous

The plan directory information REST API is accessible anonymously

authenticated

The plan directory information REST API is accessible to any authenticated request

authenticated-admin

The plan directory information REST API is accessible to any request authenticated as an administrator

API Usage

The API is available at /rest/api/latest/planDirectoryInfo/{planKey}.  For example:

GET /rest/api/latest/planDirectoryInfo/PROJ-PLAN

{"results":
  [{
    "planName": "Plan name",
    "isBranchBuild": false,
    "artifact_plan_roots": ["/opt/bamboo-home/artifacts/PROJ-PLAN"],
    "build_log_job_roots": {
      "PROJ-PLAN-JOB1":["/opt/bamboo-home/xml-data/builds/PROJ-PLAN-JOB1"],
      "PROJ-PLAN-JOB2":["/opt/bamboo-home/xml-data/builds/PROJ-PLAN-JOB2"]
    }
  }]
}

If no build exists that matches the provided key, an empty list is returned for the results.

artifact_plan_roots contains a list of directories that contain artifacts for the plan.

build_log_job_roots returns a map of job keys to the directory arrays. That is, each job in the plan is mapped to a list of directories that contain logs and build results for that build.

Bamboo 5.9 will only ever return single-item lists, but future versions of Bamboo will make changes to the on-disk directory layout and may return lists with multiple entries.

Last modified on Jun 28, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.