REST plan routes
GET /v1/plan_routes
Returns all the plan routes.
Filters
- plan_id — Integer for plan ID
- route_id — Integer for route ID
- app_id — Integer for application ID
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 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:
An example of filters:
GET /v1/plan_routes/[id]
Returns a plan route by the ID.
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 - 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:
POST /v1/plan_routes
Creates a new plan route from the posted data.
Required attributes
- plan_id – Integer for plan_id
- route_id – Integer for route id
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 422 Unprocessable entity — Occurs when validation fails and objects and errors are returned
- ERROR 500 Internal Server Error — Occurs when server error(s) 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:
PUT /v1/ plan_routes/[id]
This method is not allowed for the plan routes.
Errors caused
- ERROR 403 Forbidden — Occurs when the token is invalid
- ERROR 405 Method not allowed — Occurs when the method is not allowed
DELETE /v1/plan_routes/[id]
Deletes a plan 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/plan_routes:
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "e12d69a32321c0ee192b2167a7cf5c35"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 608c06b24ba5ff4127ca86b7da6647c5
X-Runtime: 1.575000
Content-Type: application/json;charset=utf-8
Content-Length: 409
Date: Wed, 28 Aug 2013 10:23:25 GMT
[{
"created_at":"2013-08-23T12:26:52-04:00",
"id":1,
"updated_at":"2013-08-23T12:26:52-04:00",
"plan": {
"id":1,
"name":"Plan #1",
"plan_template": {
"id":1,
"name":"Plan Template #1 (CI)"
}
},
"route": {
"description":"This is production route",
"id":2,
"name":"Production Route",
"route_type":"open",
"app": {
"id":1,
"name":"SmartRelease"
}
}
}]
The following XML is a sample output from GET /v1/plan_routes/1:
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "77deefc8e8767bb6b7c635bbab0bdab2"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 397d5f0810e1408e5dd8c17240c8fd36
X-Runtime: 0.882000
Content-Type: application/xml;charset=utf-8
Content-Length: 704
Date: Wed, 28 Aug 2013 10:25:08 GMT
<?xml version="1.0" encoding="UTF-8"?>
<plan-route>
<created-at type="datetime">2013-08-23T12:26:52-04:00</created-at>
<id type="integer">1</id>
<updated-at type="datetime">2013-08-23T12:26:52-04:00</updated-at>
<plan>
<id type="integer">1</id>
<name>Plan #1</name>
<plan-template>
<id type="integer">1</id>
<name>Plan Template #1 (CI)</name>
</plan-template>
</plan>
<route>
<description>This is production route</description>
<id type="integer">2</id>
<name>Production Route</name>
<route-type>open</route-type>
<app>
<id type="integer">1</id>
<name>SmartRelease</name>
</app>
</route>
</plan-route>
Related topic