REST deployment window events


Deployment window events are individual occurrences of the deployment window series for a specific environment.

Warning

Note

The include_except and alone filters are available in only 5.0.03.004 and later versions of RPM. Use these filters to limit the data in API response and hence, reduce the API response time.

GET /v1/deployment_window/events/[id]

Returns the deployment window event by ID.

Common attributes

  • id — Numerical unique ID for a deployment window event
  • format — Ensure to include an accept header or add .xml or .json  to the last path element
  • token — Your API Token for authentication

Filters

  • include_except—Comma-separated strings of the top-level associated items to exclude from the response. You can remove only top-level associated items from the response and these associated items should be a collection (zero to many) of other objects (not a simple property—string, numeric, boolean, and so on). For example, you can remove components from an application but you cannot remove route gates (it is not a top-level associated item) or app_version (it is a simple property). If you provide an incorrect associated item name (for example, the associated item does not exist, is not at the top level, or is a property), the name is ignored. See the table below for the items and their associated items.
  • alone—Boolean value to return only the item or the associated items as well along with the item. If set to false (default), item and associated item details are returned; if set to true, only item details are returned. See the table below for the items and their associated items. See the table below for the items and their associated items.

Item

Associated items

events

environment, occurrence, series

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. For example:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X GET http://[rails_host]/v1/deployment_window/events/[id]?token=[api_token]
curl -i -H "accept: text/xml" -H "Content-type: text/xml" -X GET http://[rails_host]/v1/deployment_window/events/[id]?token=[api_token]

Filter example:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X GET -d '{ "filters": { "include_except":"environment,series" }}' https://[rails_host]/v1/deployment_window/events/[id]?token=[api_token]

PUT /v1/deployment_window/events/[id]

Updates an existing deployment window with values from the posted data.

Editable attributes

  • state — String value for the current state of the deployment window event. When you change the state attribute, the reason attribute is required. The following values are allowed for the state attribute:
    • created — The default  state for the created deployment window event
    • suspended — The deployment window event state for used for suspending the deployment window event
    • resumed — The deployment window event state for used for resuming the the deployment window event after the suspension
    • moved — The deployment window event state for used moving the deployment window event
  • reason  — String value for the reason of the status change. This attribute is required if you change the state attribute
  • start_at — String value in the date and time format for the deployment window event start. If you can change the start_at value, change the state attribute to moved and enter a value for the reason attribute
  • finish_at — String value in the date and time format for the deployment window event finish. If you can change the start_at value, change the state attribute to moved and enter a value for the reason attribute
Warning

Note

To move the deployment window event, ensure the following:

  • The event start_at date and time is after the current date and time
  • The event start_at date and time is after the occurrence start_at date and time
  • The event start_at date and time is before the event finish_at date and time
  • The event {{code language="none"}}
    finish_at
    {{/code}}
    date and time is before the occurrence finish_at date and time

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

Filters

  • include_except—Comma-separated strings of the top-level associated items to exclude from the response. You can remove only top-level associated items from the response and these associated items should be a collection (zero to many) of other objects (not a simple property—string, numeric, boolean, and so on). For example, you can remove components from an application but you cannot remove route gates (it is not a top-level associated item) or app_version (it is a simple property). If you provide an incorrect associated item name (for example, the associated item does not exist, is not at the top level, or is a property), the name is ignored. See the table below for the items and their associated items.
  • alone—Boolean value to return only the item or the associated items as well along with the item. If set to false (default), item and associated item details are returned; if set to true, only item details are returned. See the table below for the items and their associated items. See the table below for the items and their associated items.

Item

Associated items

events

environment, occurrence, series

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, 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:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{ "deployment_window_event": { "state" : "moved", "reason" : "Urgent reason to move DW event", "start_at" : "11th Apr 2014 05:00", "finish_at" : "15th Apr 2014 00:30"}}' http://[rails_host]/v1/deployment_window/events/[id]?token=[api_token]
curl -i -H "accept: text/xml" -H "Content-type: text/xml" -X PUT -d '<deployment_window_event> <state>moved</state> <reason>Urgent reason to move DW event</reason> <start_at>11th Apr 2014 05:00</start_at> <finish_at>15th Apr 2014 00:30</finish_at> </deployment_window_event>' http://[rails_host]/v1/deployment_window/events/[id]?token=[api_token]

Filter example:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{ "deployment_window_event": {"state" : "moved", "reason" : "Urgent reason to move DW event", "start_at" : "24th Feb 2020 05:00", "finish_at" : "27nd Feb 2020 00:30"}, "filters": { "include_except":"environment,occurrence" }}' https://[rails_host]/v1/deployment_window/events/[id]?token=[api_token]

Sample output

The following JSON is a sample output from GET /v1/deployment_windows/events/12:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "3ce446175438137b6a914c322e17dac8"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: bec5332ee6968fab5e2cc8f9d7e79fb6
X-Runtime: 1.154000
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 15 Apr 2014 14:50:09 GMT

{
   "created_at": "2014-04-11T07:44:33-04:00",
    "
finish_at": "2014-04-24T10:30:00-04:00",
    "
id": 12,
    "
reason": null,
    "
start_at": "2014-04-24T08:00:00-04:00",
    "
state": "created",
    "
updated_at": "2014-04-11T07:44:33-04:00",
    "
environment": {
        "
id": 3,
        "
name": "QA environment closed"
    },
    "
occurrence": {
        "
finish_at": "2014-04-24T10:30:00-04:00",
        "
id": 12,
        "
position": 10,
        "
start_at": "2014-04-24T08:00:00-04:00"
    },
    "
series": {
        "
behavior": "allow",
        "
id": 3,
        "
name": "Allow DW Test series"
    }
}

The following XML is a sample output from {{code language="none"}}
GET /v1/deployment_windows/events/12
{{/code}}
:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "1ddc103bdbdda86ce3c3112058221a08"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 093ddc6f62581546d3051bedb0251426
X-Runtime: 0.427000
Content-Type: application/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 15 Apr 2014 14:50:09 GMT

<?xml version="1.0" encoding="UTF-8"?>
<event>
 <created-at type="datetime">2014-04-11T07:44:33-04:00</created-at>
 <finish-at type="datetime">2014-04-24T10:30:00-04:00</finish-at>
 <id type="integer">12</id>
 <reason nil="true"/>
 <start-at type="datetime">2014-04-24T08:00:00-04:00</start-at>
 <state>created</state>
 <updated-at type="datetime">2014-04-11T07:44:33-04:00</updated-at>
 <environment>
   <id type="integer">3</id>
   <name>QA environment closed</name>
 </environment>
 <occurrence>
   <finish-at type="datetime">2014-04-24T10:30:00-04:00</finish-at>
   <id type="integer">12</id>
   <position type="integer">10</position>
   <start-at type="datetime">2014-04-24T08:00:00-04:00</start-at>
 </occurrence>
 <series>
   <behavior>allow</behavior>
   <id type="integer">3</id>
   <name>Allow DW Test series</name>
 </series>
</event>
     
  

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Release Process Management 5.0.06