REST routes
GET /v1/routes
Returns all the routes (unarchived by default).
Filters
- name — String for route name
- app_id – Integer for application ID
- route_type — String for route type (can be one of the follow values ‘open’, ‘mixed’ or ‘strict’)
- archived — Boolean value for showing archived (can be combined with unarchived to show both)
- unarchived — Boolean value for showing unarchived (on by default, can be combined with archived to show both)
- 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 |
---|---|
routes | app, route_gates, |
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 — When the token is invalid
- ERROR 404 Not Found — 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:
Examples of filters:
GET /v1/routes/[id]
Returns an route by the ID.
Common attributes
- id — Numerical unique ID for the route
- 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 |
---|---|
routes | app, route_gates, |
Errors caused
- ERROR 403 Forbidden — When the token is invalid
- ERROR 404 Not found — When the record 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/routes
Creates a new route from the posted data.
Required attributes
- name — String name of the route (required)
- app_id — Integer ID of application
Optional attributes
- description — String description of the route
- route_type — String for route type (can be one of the follow values ‘open’, ‘mixed’ or ‘strict’. Default value is ‘open’)
- route_gate_ids — Array of integer IDs for related route gates
- plan_route_ids — Array of integer IDs for related plan routes
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 |
---|---|
routes | app, route_gates, |
Errors caused
- ERROR 403 Forbidden — When the token is invalid
- ERROR 422 Unprocessable entity — When validation fails and objects and errors are returned
- ERROR 500 Internal Server Error — When server error occurred 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:
Filter example:
PUT /v1/routes/[id]
Updates an existing route with values from the posted document.
Editable attributes
- name — String name of the route
- app_id — Integer id of application
- description — String description of the route
- route_type — String for route type (can be one of the follow values ‘open’, ‘mixed’ or ‘strict’. Default value is ‘open’)
- route_gate_ids — Array of integer IDs for related route gates
- plan_route_ids — Array of integer IDs for related plan routes
Toggle archival status
- toggle_archive — Boolean value that toggles the archive status of an object.
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 |
---|---|
routes | app, route_gates, |
Errors caused
- ERROR 403 Forbidden — When the token is invalid
- ERROR 404 Not found — When record to update is not found
- ERROR 422 Unprocessable entity — When validation fails and objects and errors are returned
- ERROR 500 Internal Server Error — When server error occurred 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:
An example toggling the archive status of an object:
Filter example:
DELETE /v1/routes/[id]
Deletes a route.
Common attributes
- id — numerical unique id for record
- 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 — When the token is invalid
- ERROR 404 Not found — 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:
Sample output
The following JSON is a sample output from GET /v1/routes:
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "ec0515eb2dbde516221f5c3f81d46c85"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3722c80dd7ed40cd1058611833e659a4
X-Runtime: 1.575000
Content-Type: application/json;charset=utf-8
Content-Length: 678
Date: Tue, 27 Aug 2013 14:53:55 GMT
[{
"archive_number":null,
"archived_at":null,
"created_at":"2013-08-23T10:44:52-04:00",
"description":"This is production route",
"id":2,
"name":"Production Route",
"route_type":"open",
"updated_at":"2013-08-23T10:44:52-04:00",
"app": {
"id":1,
"name":"SmartRelease"
},
"route_gates": [{
"different_level_from_previous":true,
"id":2,
"position":1,
"environment": {
"id":1,
"name":"aws_cloud"
}
}, {
"different_level_from_previous":true,
"id":3,
"position":2,
"environment": {
"id":2,
"name":"production"
}
}],
"plan_routes": [{
"id":1,
"plan": {
"id":1,
"name":"Plan #1"
}
}]
}]
The following XML is a sample output from GET /v1/routes/1:
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "eb842d55db10e464f6a376694e667d25"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 4d5ced5e5d6b65e930529eb8e86cc9fc
X-Runtime: 0.882000
Content-Type: application/xml;charset=utf-8
Content-Length: 1427
Date: Tue, 27 Aug 2013 14:57:05 GMT
<?xml version="1.0" encoding="UTF-8"?>
<route>
<archive-number nil="true"></archive-number>
<archived-at type="datetime" nil="true"></archived-at>
<created-at type="datetime">2013-08-23T10:44:52-04:00</created-at>
<description>This is production route</description>
<id type="integer">2</id>
<name>Production Route</name>
<route-type>open</route-type>
<updated-at type="datetime">2013-08-23T10:44:52-04:00</updated-at>
<app>
<id type="integer">1</id>
<name>SmartRelease</name>
</app>
<route-gates type="array">
<route-gate>
<different-level-from-previous type="boolean">true</different-level-from-previous>
<id type="integer">2</id>
<position type="integer">1</position>
<environment>
<id type="integer">1</id>
<name>aws_cloud</name>
</environment>
</route-gate>
<route-gate>
<different-level-from-previous type="boolean">true</different-level-from-previous>
<id type="integer">3</id>
<position type="integer">2</position>
<environment>
<id type="integer">2</id>
<name>production</name>
</environment>
</route-gate>
</route-gates>
<plan-routes type="array">
<plan-route>
<id type="integer">1</id>
<plan>
<id type="integer">1</id>
<name>Plan #1</name>
</plan>
</plan-route>
</plan-routes>
</route>
Related topic