This API provides an easy way to get information about a single or all staging projects like state, requests and checks. Note: To use this API, you first need to setup a staging workflow for a project.
This endpoint provides an overview of all staging projects for a certain project.
geeko > osc
api '/staging/openSUSE:Factory:Staging/staging_projects/'
Which will return the following XML:
<staging_projects>
<staging_project name="home:Admin:Staging:A" state="empty">
<staged_requests count="0"/>
<untracked_requests count="0"/>
<requests_to_review count="0"/>
<obsolete_requests count="0"/>
<missing_reviews count="0"/>
<broken_packages count="0"/>
<checks count="0"/>
<missing_checks count="0"/>
</staging_project>
<staging_project name="home:Admin:Staging:B" state="empty">
<staged_requests count="0"/>
<untracked_requests count="0"/>
<requests_to_review count="0"/>
<obsolete_requests count="0"/>
<missing_reviews count="0"/>
<broken_packages count="0"/>
<checks count="0"/>
<missing_checks count="0"/>
</staging_project>
</staging_projects>
This endpoint provides an overview of a single staging project.
geeko > osc
api '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A'
Which will return the following XML:
<staging_project name="home:Admin:Staging:A" state="empty">
<staged_requests count="0"/>
<untracked_requests count="0"/>
<requests_to_review count="0"/>
<obsolete_requests count="0"/>
<missing_reviews count="0"/>
<broken_packages count="0"/>
<checks count="0"/>
<missing_checks count="0"/>
</staging_project>
This endpoint creates a copy of a staging project. It will queue a job which is going to copy the project configuration, repositories, groups and users.
geeko > osc
api -X POST '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/copy/openSUSE:Factory:Staging:A-copy'
One of the main features of the staging workflow is assigning incoming requests to different staging projects.
Our main project openSUSE:Factory received requests with number 1 and 2. We would like to group these two requests together and move them into the staging project openSUSE:Factory:Staging:A. This can be done with the following command which will create a link to the package in openSUSE:Factory:Staging:A.
geeko > osc
api -X POST '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/staged_requests' -d '<requests><number>1</number><number>2</number></requests>'
When we are done with testing the staging project openSUSE:Factory:Staging:A, we need to remove the requests 1 and 2 again. The following command will remove the package links from openSUSE:Factory:Staging:A.
geeko > osc
api -X DELETE '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/staged_requests' -d '<requests><number>1</number><number>2</number></requests>'
Listing all requests which are currently assigned to openSUSE:Factory:Staging:A can be done with the following command.
geeko > osc
api '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/staged_requests'
Which will return the following XML:
<staged_requests>
<request id="6" creator="user_1" state="review" package="ctris"/>
</staged_requests>
Our main project openSUSE:Factory received requests with number 3 and 4. We would like to exclude these two requests for the staging workflow project openSUSE:Factory.
geeko > osc
api -X POST '/staging/openSUSE:Factory/excluded_requests' -d '<excluded_requests><request number="3" description="Reason description for request number 3."></request><request number="4" description="Reason description for request number 4."></request></requests>'
The following command will stop excluding requests with number 3 and 4 for the staging workflow project openSUSE:Factory.
geeko > osc
api -X DELETE '/staging/openSUSE:Factory/excluded_requests' -d '<requests><number>3</number><number>4</number></requests>'