REST v.2 requests
Requests are the primary process model of BMC Release Process Management (BRPM). They can belong to plans and projects and typically have one or more steps that do manual or automated work to complete the release.
You can use the aasm_event parameter in REST PUT requests for requests to manage request status, including planning, starting, holding, blocking, reopening, and changing a request to the problem state and resolving the problem state. For more information, see State machine events.
GET /v2/requests/[id]
Returns a request by request ID.
Common attributes
- id—Numerical unique ID for record
- format—An accept header or JSON added to the last path element.
- token—Your API Token for authentication
Errors caused
- ERROR 403 Forbidden—Occurs when the token is invalid
- ERROR 404 Not found—Occurs when record to show is not found
Examples
To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like Wget or cURL.
To get the required request by ID, run the following REST call:
To export a request in the PDF format
To export a request in the XML format
To export a request in the HTML format
POST /v2/requests
Creates a new request in a release from the posted data.
Required attributes
- release_plan_id—Integer ID of a release
- plan_stage_id—Integer ID of a plan stage to which you want to deploy a request
- environment_id—Integer ID of an environment where you want to deploy a request
Optional attributes
To schedule a request for the specific date and time, you can specify either the scheduled_at attribute, or the scheduled_at_date, scheduled_at_hour, scheduled_at_minute, and scheduled_at_meridian attributes.
- scheduled_at—Date and time to start a request
- scheduled_at_date—Date when a scheduled step should start
- scheduled_at_hour—Hour when a scheduled step should start
- scheduled_at_minute—Minute when a scheduled step should start
- scheduled_at_meridian—AM or PM of the scheduled step time
- start_now—Boolean value to start a request automatically after the creation scheduled_at sets the planned date and time at which the request should start. If you want the request to be started automatically at the scheduled date and time, use scheduled_at_date, scheduled_at_hour, scheduled_at_minute, scheduled_at_meridian, and start_now.
For examples, see To create a scheduled request. - continue_on_failure—Boolean value to determine the execution condition of a request. If the value is true, the Continue On Failure function for this request is activated.
Common attributes
- format—An accept header or JSON added to the last path element
- token—Your API Token for authentication
Errors caused
- ERROR 403 Forbidden—Occurs when the token is invalid
- ERROR 422 Unprocessable entity—Occurs when validation fails and objects and errors are returned
Examples
To test this method, insert the URL or your valid API key and application host into a browser or HTTP client like Wget or cURL.
To create a request without a schedule:
To create a scheduled request:
To create and start a request at once after creation:
PUT /v2/requests/[id]/update_status
Updates the status of an existing request.
State machine events
aasm_event—Moves a request to another state. Supported events are the following:
- plan_it—Moves the request to the Planned state
- start—Starts the request that is in the Planned state
- put_on_hold—Puts the request on hold.
- problem—Moves the request to the Problem state
- resolve—Resolves the request with the Problem state and restarts the request. Status of the request changes to In Process.
- finish—When all the steps are complete, the request moves to the Complete state.
- reopen—Reopens a completed request.
- cancel—Cancels a request which is in In Progress state.
Common attributes
- format—Ensure to include an accept header or add .xml or .json to the last path element
- token—Your API token for authentication
Errors caused
- ERROR 403 Forbidden—Occurs when the token is invalid
- ERROR 404 Not found—Occurs when record to update is not found
- ERROR 422 Unprocessable entity—Occurs when validation fails and objects and errors are returned
Examples
To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:
Related topic