REST deployment window series
A deployment window series is a series of special calendar events for allowing or preventing access to the specific environments.
GET /v1/deployment_window/series
Returns all deployment window series.
Filters
object_states—String name of a valid status of the object state
- name—String value for the deployment window series name
- behavior—String value for the deployment window series behavior (allow or prevent values)
- start_before—String value in the date and time format
- start_after—String value in the date and time format
- finish_before—String value in the date and time format
- finish_after—String value in the date and time format
- environments—Array of environment IDs associated with the deployment window series
- unarchived—Boolean value for filtering deployment window series by the unarchived status
- archived—Boolean value for filtering deployment window series by the archived status
Common attributes
- format—Be sure 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 no records are 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:
The following example shows filters:
GET /v1/deployment_window/series/[id]
Returns the deployment window series by ID.
Common attributes
- id—Unique numerical ID for a deployment window series
- format—Be sure 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 |
---|---|
series | environments, requests, events |
Errors caused
- ERROR 403 Forbidden—Occurs when the token is invalid
- ERROR 404 Not found—Occurs when the 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:
Filter example:
POST /v1/deployment_window/series
Creates a deployment window series from the posted data.
Required attributes
- name—String name of the environment (must be unique)
- behavior—String value for the deployment window series behavior (allow or prevent values).
- start_at—String value in the date and time format
- finish_at—String value in the date and format
- recurrent—Boolean value to set recurrence for the deployment window series
Optional attributes
- environments—Array of environment IDs to associate with the deployment window series
aasm_state—String name of a valid status of the object state
duration_in_days—Integer value for the duration of the deployment window series in days.
frequency — Hash value for the recurrent deployment window series that includes the following attributes:
- validations—Hash value for weekly and monthly recurrence type. Enter one of the following data:
For weekly recurrence type, enter week days in the following pattern: "day":[<day_of_week_1>, <day_of_week_2>].
For example, to set recurrence for every Monday and Thursday, enter the following data:
"validations":{"day":[1,4]}For monthly recurrence type, to set recurrence for dates of the month, enter dates of the month in the following pattern: "day_of_month":[<date_1>, <date_2>]
For example, to set recurrence 1st ,10th and 20th of the month, enter the following data:"validations":{"day_of_month":[1,10,20]}For monthly recurrence type, to set recurrence for days of the week, enter dates of the month in the following pattern: "day_of_week":{<day_of_week_1>":[<week_1>,<week2>],<day_of_week_2>":[<week_1>,<week2>]}
For example, to set recurrence for Mondays of the first and third weeks and for Tuesdays of the second and fourth week, enter the following data:
"day_of_week":{"1":[1,3],"2":[2,4]}}
- rule_type—String value for daily, weekly, and monthly deployment window recurrence rules. Depending on the rule type, enter the following values:
- IceCube::DailyRule
- IceCube::WeeklyRule
- IceCube::MonthlyRule
- interval—Integer value for the deployment window event recurrence
- validations—Hash value for weekly and monthly recurrence type. Enter one of the following data:
Common attributes
- format—Be sure 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 |
---|---|
series | environments, requests, events |
Errors caused
- ERROR 403 Forbidden—Occurs when the token is invalid
- 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:
Filter example:
PUT /v1/deployment_window/series/[id]
Updates an existing deployment window series with values from the posted data.
Editable attributes
aasm_state—String name of a valid status of object state
- name—String name of the environment (must be unique)
- behavior—String value for the deployment window behavior (allow or prevent values)
- start_at—String value in the date and time format
- finish_at—String value in the date and format
- recurrent—Boolean value to set recurrence for the deployment window
- environments—Array of environment IDs to associate with the deployment window
duration_in_days—Integer value for the duration of the deployment window in days
toggle_archive—Boolean value to toggle the archive status for the selected deployment window
frequency—Hash value for recurrent deployment window series that includes the following attributes:
- validations—Hash value for weekly and monthly recurrence type. Enter one of the following data:
For weekly recurrence type, enter week days in the following pattern: "day":[<day_of_week_1>, <day_of_week_2>].
For example, to set recurrence for every Monday and Thursday, enter the following data:
"validations":{"day":[1,4]}For monthly recurrence type, to set recurrence for dates of the month,enter dates of the month in the following pattern: "day_of_month":[<date_1>, <date_2>]
For example, to set recurrence 1st ,10th and 20th of the month, enter the following data:"validations":{"day_of_month":[1,10,20]}For monthly recurrence type, to set recurrence for days of the week, enter dates of the month in the following pattern: "day_of_week":{<day_of_week_1>":[<week_1>,<week2>],<day_of_week_2>":[<week_1>,<week2>]}
For example, to set recurrence for Mondays of the first and third weeks and for Tuesdays of the second and fourth week, enter the following data:
"day_of_week":{"1":[1,3],"2":[2,4]}}
- rule_type—String value for daily, weekly, and monthly deployment window recurrence rules. Depending on the rule type, enter the following values:
- IceCube::DailyRule
- IceCube::WeeklyRule
- IceCube::MonthlyRule
- interval—Integer value for the deployment window event recurrence
- validations—Hash value for weekly and monthly recurrence type. Enter one of the following data:
Common attributes
- format—Be sure 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 |
---|---|
series | environments, requests, events |
Errors caused
- ERROR 403 Forbidden—Occurs when the token is invalid
- ERROR 404 Not found—Occurs when the 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:
Filter example:
DELETE /v1/deployment_window/series/[id]
Deletes the deployment window series.
Common attributes
- id—Unique numerical ID for record
- format—Be sure 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 no records to update are found
- ERROR 422 Unprocessable entity—Occurs when validation fails; objects and errors return
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:
Sample output
The following JSON is sample output from GET /v1/deployment_windows/series/3:
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, 23 Mar 2014 14:45:59 GMT
{
"archive_number": null,
"archived_at": null,
"behavior": "allow",
"duration_in_days": 0,
"finish_at": "2014-03-31T12:40:00-04:00",
"id": 3,
"name": "allow DW series",
"recurrent": true,
"start_at": "2014-03-26T11:30:00-04:00",
"environments": [
{
"deployment_policy": "closed",
"id": 3,
"name": "dev closed"
},
{
"deployment_policy": "closed",
"id": 7,
"name": "production closed"
},
{
"deployment_policy": "closed",
"id": 9,
"name": "new env closed"
},
{
"deployment_policy": "closed",
"id": 5,
"name": "qa closed"
}
],
"requests": [
{
"id": 1
}
],
"events": [
{
"finish_at": "2014-03-26T12:00:00-04:00",
"id": 8,
"start_at": "2014-03-26T11:30:00-04:00"
},
{
"finish_at": "2014-03-26T12:00:00-04:00",
"id": 9,
"start_at": "2014-03-26T11:30:00-04:00"
},
{
"finish_at": "2014-03-26T14:00:00-04:00",
"id": 7,
"start_at": "2014-03-26T13:30:00-04:00"
},
{
"finish_at": "2014-03-26T12:00:00-04:00",
"id": 25,
"start_at": "2014-03-26T11:30:00-04:00"
},
{
"finish_at": "2014-03-31T12:40:00-04:00",
"id": 32,
"start_at": "2014-03-31T11:30:00-04:00"
},
{
"finish_at": "2014-03-31T12:40:00-04:00",
"id": 33,
"start_at": "2014-03-31T11:30:00-04:00"
},
{
"finish_at": "2014-03-31T12:40:00-04:00",
"id": 34,
"start_at": "2014-03-31T11:30:00-04:00"
},
{
"finish_at": "2014-03-31T12:40:00-04:00",
"id": 35,
"start_at": "2014-03-31T11:30:00-04:00"
}
]
}
The following XML is sample output from {{code language="none"}}
GET /v1/deployment_windows/series/3
{{/code}}:
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, 23 Mar 2014 14:50:09 GMT
<?xml version="1.0" encoding="UTF-8"?>
<series-item>
<archive-number nil="true"/>
<archived-at type="datetime" nil="true"/>
<behavior>allow</behavior>
<duration-in-days type="integer">0</duration-in-days>
<finish-at type="datetime">2014-03-31T12:40:00-04:00</finish-at>
<id type="integer">3</id>
<name>allow DW series</name>
<recurrent type="boolean">true</recurrent>
<start-at type="datetime">2014-03-26T11:30:00-04:00</start-at>
<environments type="array">
<environment>
<deployment-policy>closed</deployment-policy>
<id type="integer">3</id>
<name>dev closed</name>
</environment>
<environment>
<deployment-policy>closed</deployment-policy>
<id type="integer">7</id>
<name>production closed</name>
</environment>
<environment>
<deployment-policy>closed</deployment-policy>
<id type="integer">9</id>
<name>new env closed</name>
</environment>
<environment>
<deployment-policy>closed</deployment-policy>
<id type="integer">5</id>
<name>qa closed</name>
</environment>
</environments>
<requests type="array">
<request>
<id type="integer">1</id>
</request>
</requests>
<events type="array">
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-26T12:00:00-04:00</finish-at>
<id type="integer">8</id>
<start-at type="datetime">2014-03-26T11:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-26T12:00:00-04:00</finish-at>
<id type="integer">9</id>
<start-at type="datetime">2014-03-26T11:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-26T14:00:00-04:00</finish-at>
<id type="integer">7</id>
<start-at type="datetime">2014-03-26T13:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-26T12:00:00-04:00</finish-at>
<id type="integer">25</id>
<start-at type="datetime">2014-03-26T11:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-31T12:40:00-04:00</finish-at>
<id type="integer">32</id>
<start-at type="datetime">2014-03-31T11:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-31T12:40:00-04:00</finish-at>
<id type="integer">33</id>
<start-at type="datetime">2014-03-31T11:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-31T12:40:00-04:00</finish-at>
<id type="integer">34</id>
<start-at type="datetime">2014-03-31T11:30:00-04:00</start-at>
</event>
<event type="DeploymentWindow::Event">
<finish-at type="datetime">2014-03-31T12:40:00-04:00</finish-at>
<id type="integer">35</id>
<start-at type="datetime">2014-03-31T11:30:00-04:00</start-at>
</event>
</events>
</series-item>
Related topics