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

  • aasm_state  String name of a valid status of object state 

    Note

    Valid status of object states are draft, pending, released, retired, and archived. By default, the aasm_state is Draft.

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

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

The following example shows filters:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X GET -d '{"filters": { "behavior":"allow", "name":"%_1"}}' http://[rails_host]/v1/deployment_window/series?token=[api_token]

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

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:

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

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 object state

    Note

    For a POST operation, only the Draft state is allowed. By default, the aasm_state is Draft.

  • duration_in_days — Integer value for the duration of the deployment window series in days.

    Note

    Enter a value for this attribute if you set the recurrent attribute to true.

  • frequency — Hash value for the recurrent deployment window series that includes the following attributes:

    Note

    Enter values for this attribute if you set the recurrent attribute to true.

    • 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>].

        Note

        For week days, Monday is the first day of the week.

        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

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 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: text/xml" -H "Content-type: text/xml" -X POST -d "<deployment_window_series><name>API DWS</name><behavior>allow</behavior><start_at>1rd Jun 2020 17:00</start_at><finish_at>3rd Jul 2020 19:00</finish_at><environment_ids><environment_id>1</environment_id><environment_id>10</environment_id></environment_ids><recurrent>false</recurrent></deployment_window_series>" http://[rails_host]/v1/deployment_window/series/?token=[api_token]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X POST -d '{ "deployment_window_series": { "name" : "API DWS", "behavior" : "allow", "start_at" : "1rd Jun 2020 17:00", "finish_at" : "3rd Jul 2020 19:00","environment_ids": [1,10], "recurrent" : false }}' http://[rails_host]/v1/deployment_window/series?token=[api_token]

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

    Note

    Valid status of object states are draft, pending, released, retired, and archived. The aasm_state Archived can only be reached if the current aasm_state is Retired. If the current aasm_state is Archived, the only available state is Retired. By default, the aasm_state is Draft.

  • 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

    Note

    Enter a value for this attribute if you set the recurrent attribute to true.

  • toggle_archive — Boolean value to toggle the archive status for the selected deployment window

    Note

    You can only toggle the archive status when the state is Archived or Retired.

  • frequency — Hash value for recurrent deployment window series that includes the following attributes:

    Note

    Enter values for this attribute if you set the recurrent attribute to true.

    • 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>].

        Note

        For week days, Monday is the first day of the week.

        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

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

curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{"deployment_window_series":{"environments":[10002,10003],"recurrent" : true, "duration_in_days": 2, "frequency": { "rule_type":"IceCube::DailyRule","interval":4}}}' http://http://[rails_host]:8080/brpm/v1/deployment_window/series/[id]?token=[api_token]
curl -i -H "accept: text/xml" -H "Content-type: text/xml" -X PUT -d '<deployment_window_series><environments><environments_id>10002</environment_id><environment_id>10003</environment_id></environments><recurrent>true</recurrent><duration_in_days>2</duration_in_days><frequency><rule_type>IceCube::DailyRule</rule_type><interval>4</interval></frequency></deployment_window_series>' http://[rails_host]:8080/brpm/v1/deployment_window/series/[id]/?token=[api_token]

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:

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

Sample output

The following JSON is sample output from GET /v1/deployment_windows/series/3:

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

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

REST-API-commands

Managing-deployment-windows

 

 

 

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