REST v.2 steps
A step is an important subprocess model of BMC Release Process Management that belongs to requests. Steps can be grouped into procedures for reuse and represent manual or automated work to be completed for a release.
You can use the aasm_event parameter in REST PUT requests for steps to manage step status, including starting, holding, blocking, resetting, changing a step to the problem state and resolving the problem state. For more information, see State machine events.
GET v2/steps/[step_ID]
Returns the details of the specified step.
Common attributes
- format — Ensure to include an accept header or add .json to the last path element
- token — Your API Token for authentication
Errors caused
- ERROR 403 Forbidden — When the token is invalid
- ERROR 404 Not Found — When no records are found
Example
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:
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge,chrome=1
ETag: "6a922830200cac5a22215b9d1846f72f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f2b9018dff27e7b3ef6f08a3c68f04c8
X-Runtime: 0.047000
Date: Fri, 08 Dec 2017 13:56:38 GMT
X-Rack-Cache: miss
Vary: Origin
Referrer-Policy: origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
{
"data": {
"aasm_state": "locked",
"complete_by": null,
"component_id": 1,
"component_version": null,
"default_tab": "general",
"description": "",
"different_level_from_previous": true,
"estimate": 5,
"execute_anytime": false,
"name": "2",
"owner_id": 1,
"owner_type": "User",
"package_id": null,
"package_instance_id": 0,
"phase_id": null,
"priority": null,
"runtime_phase_id": null,
"start_at_scheduled_time": false,
"start_by": null,
"version_tag_id": null,
"work_task_id": 1,
"app": {
"a_sorting_comps": false,
"a_sorting_envs": false,
"active": true,
"app_version": "2.0.4",
"created_at": "2011-04-28T23:12:12-05:00",
"default": false,
"id": 1,
"name": "SmartRelease",
"strict_plan_control": false,
"updated_at": "2011-04-28T23:12:12-05:00"
},
"component": {
"active": true,
"created_at": "2011-04-28T23:13:14-05:00",
"id": 1,
"name": "AppContainer",
"updated_at": "2011-04-28T23:13:14-05:00"
},
"environment": {
"active": true,
"created_at": "2011-04-28T23:12:28-05:00",
"default": false,
"default_server_group_id": null,
"deployment_policy": "opened",
"environment_type_id": 2,
"id": 1,
"name": "aws_cloud",
"updated_at": "2017-12-07T13:09:25-06:00"
},
"allow_update_properties": true,
"owner": {
"first_name": "John",
"id": 1,
"last_name": "Administrator"
}
},
"total_records": 1
}
new in 5.0.03 PUT v2/steps/[step_ID]
Updates an existing step with values from a posted document.
Editable attributes
- owner_id—Integer ID of the owner (User) (required unless a procedure)
- owner_type—String value of the owner type (User, Group)
- request_id— Integer ID of the request (required if not a member of a procedure)
- procedure_id—Integer ID of the procedure (required if a member of a procedure)
- name—String name of the step
- manual—Boolean value if manual step (not automation step) (defaults to true, if set to false script_id must be set)
- procedure—Boolean value if the step is a procedure container (procedure_id required if this is true)
- installed_component_id—Integer ID of the installed component for the step (required if component_id is set)
- component_id—Integer ID of the component for the step (required if installed_component_id is set)
- description—Text description of the step
- version_tag_id—Integer ID of a version tag if using integration server for version control
- own_version—Boolean value for whether installed component version should be updated to this step's version value upon completion (defaults to false)
- component_version—String for version of the assigned installed component (see also "own_version" Boolean value to commit that value on step completion)
- package_template_id—Integer ID for a package template
- package_template_properties—String for package template properties
- phase_id—Integer ID for a phase
- runtime_phase_id—Integer ID for a runtime phase
- should_execute—Boolean value for inclusion in request execution plan (defaults to true)
- execute_anytime—Boolean value for anytime execution (defaults to false)
- start_by—Time stamp for starting date and time
- category_id—Integer ID for related category
- estimate—Integer for estimated time in minutes
- different_level_from_previous—Boolean for serial (true) or parallel (false) step execution behavior (defaults to true)
start_at_scheduled_time—Boolean value that shows if a step starts at the scheduled time (defaults to false)
If the start_at_scheduled_time attribute is set to true, the start_by_date/hour/minute/meridianattributes are required.
- start_by_date—Date when a scheduled step should start
- start_by_hour—Hour when a scheduled step should start
- start_by_minute— Minute when a scheduled step should start
- start_by_meridian—A.M. or P.M. of the scheduled step time
- start_automatically—Boolean value that shows if a step must start automatically (defaults to false)
- server_name—String value for one server name or array of strings for many server names used in the step
server_id—Integer value for one server ID or array of integers for many server IDs used in the step
- property_id—Integer ID for the property to be updated. Also specify installed_component_id for updating properties for a step.
- server_property_id—Integer value for one or more server properties to be updated for a step. Specify server_id and server_property_id if you are updating properties for a server or server group only.
- server_id—Integer value for the server to be updated. Specify server_id to update properties for server and server groups.
server_aspect_id—Integer value for one or more server properties to be udpated for a step. Specify server_aspect_id and server_property_id if you are updating properties for a server level or server level group.
Example for updating server properties and properties for a step"property_values": {
// Installed component is used to update the property values.
"installed_component": {
"installed_component_id": {
"property_id": "Property Value"
},
},
// Server and server_aspect is used to update the server properties values.
"server": {
"server_id": {
"server_property_id": "Server & Server Group Property Value"
},
},
"server_aspect": {
"server_aspect_id": {
"server_property_id": "Server Level & Server Level group property Value"
},
},
}- deployment_dependency—Boolean value that indicates whether the execution of this step is dependent on a request or step (defaults to false)
- dependent_request_id—ID of the request on which the execution of the current step is dependent. This attribute is required if you have set the deployment_dependency attribute to true.
- dependent_step_id—ID of the step on which the execution of the current step is dependent. This attribute is optional if you have set the deployment_dependency attribute to true and set the value of the deployment_dependency attribute.
- continue_on_failure—Boolean value to determine the execution condition of a step within a request. If the value is true, the request continues running when the step fails. If the value is false, the request stops running when the step fails.
Common attributes
- format — Ensure to include an accept header or add .json to the last path element
- token — Your API Token for authentication
Errors caused
- ERROR 403 Forbidden — When the token is invalid
- ERROR 404 Not Found — When no records are found
Example
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:
The following example demonstrates that execution of the step, API Step is dependent on the step with ID, 1036.
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge,chrome=1
ETag: "3aac0d8aa9ebb7545a869ae09eabf319"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: dc516b75782995ed538aa61aeb494713
X-Runtime: 0.265000
Date: Fri, 08 Dec 2017 16:56:48 GMT
X-Rack-Cache: invalidate, pass
Vary: Origin
Referrer-Policy: origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
{
"data": {
"aasm_state": "locked",
"complete_by": null,
"created_at": "2017-12-08T07:44:43-06:00",
"description": "",
"different_level_from_previous": true,
"estimate": 5,
"id": 17,
"manual": true,
"name": "Step 3",
"owner_type": "User",
"parent_id": null,
"position": 2,
"procedure": false,
"ready_at": null,
"should_execute": true,
"start_by": null,
"updated_at": "2017-12-08T10:56:48-06:00",
"work_finished_at": null,
"work_started_at": null,
"number": "2",
"number_real": 2,
"permissible_aasm_events": [
"disable"
],
"condition_result": null,
"version_name": null,
"formatted_duration": "",
"assigned_to": "User Administrator, John",
"formatted_estimate": "0:05:00",
"component_name": "AppContainer",
"task_name": "Create a new app",
"server_name_list": "Server 1, Server a, and server2",
"owner": {
"email": "john_admin@bmc.com",
"first_name": "John",
"id": 1,
"last_name": "Administrator",
"login": "admin"
},
"request": {
"aasm_state": "created",
"id": 3,
"name": "Property request",
"number": 1003
}
},
"total_records": 0
}
PUT /v2/steps/[Id]/update_status
Updates the status of an existing step.
State machine events
aasm_event—Moves a step to another state. Supported events are the following:
- ready—Moves a step to the Ready state
- start—Starts the step that is in the Ready state
- block—Moves a step from the Ready or In Process state to the Blocked state
- done—Moves a step from In Process state to the Completed state
- reset—Resets the step from the Completed state to the Locked state. Before using the reset event, ensure that the request that the step is assigned to is in the planned state.
- problem—Moves the step and the request that the step is assigned to the Problem state
- resolve—Resolves the step with the Problem state and restarts the step. Statuses of the step and the request that the step is assigned to changes to In Process. If the automation script fails, the step is resolved without again running the script and you can move the step into other states, such as block and done.
- resolve_with_rerun—Used only for an automated step. Resolves the step with the Problem state and restarts the step. Only the status of the step changes to In Process. If the automation script fails, the step is resolved and the script runs again. If the script still has issues, step is moved to the Problem state.
- unblock_ready—Moves a step from the Blocked to the Ready state
- unblock_in_process—Moves a step from the Blocked to the In Process state
- enable—Enables a step if a step is disabled
- disable—Disables a step. A disabled step is bypassed and the system moves to next step.
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
Related topic