REST route gates


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/route_gates

Returns all the route gates.

Filters

  • environment_id — Integer for environment ID
  • route_id — Integer for route ID
  • 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

route_gates

environment,
route, constraints

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

Raises

  • 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: text/xml" -X GET http://[rails_host]/v1/route_gates?token=[api_token]

An example of filters:

curl -i -H "accept: application/json" -X GET http://[rails_host]/v1/route_gates?token=[api_token]

An example of filters:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X GET -d '{ "filters": { "route_id":1 } }' http://[rails_host]/v1/route_gates?token=[api_token]

An example of filters:

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

GET /v1/route_gates/[id]

Returns a route gate 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

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

route_gates

environment,
route, constraints

Raises

  • 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: text/xml" -X GET HTTP://[rails_host]/v1/route_gates/[id]?token=[api_token]
curl -i -H "accept: application/json" -X GET http://[rails_host]/v1/route_gates/[id]?token=[api_token]

Filter example:

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

POST /v1/route_gates

Creates a new route gate from the posted data.

Required Attributes

  • environment_id — Integer ID of environment
  • route_id — Integer ID of route

Optional Attributes

  • description — String description of the route gate
  • insertion_point — Integer of the position order of the route gate
  • different_level_from_previous — ???

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

route_gates

environment,
route, constraints

Raises

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

curl i -H "accept: text/xml" -H "Content-type: text/xml" -X POST -d '<route_gate><environment_id>1</environment_id><route_id>1</route_id></route_gate>' http://[rails_host]/v1/route_gates?token=[api_token]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X POST -d '{"route_gate": {"environment_it":1,
"route_id":1 }}'
 http://[rails_host]/v1/route_gates/?token=[api_token]

Filter example:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X POST -d '{ "route_gate": {"environment_id":1, "route_id":1 }, "filters": {"include_except" : "environment,route,constraints"}}' https://[rails_host]/v1/route_gates/?token=[api_token]

PUT /v1/route_gates/[id]

Updates an existing route gate with the values from the posted document.

Editable Attributes

  • environment_id — integer ID of environment
  • route_id — Integer ID of route
  • description — String description of the route gate
  • insertion_point — Integer of the position order of the route gate
  • different_level_from_previous — ???

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

route_gates

environment,
route, constraints

Raises

  • 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 and objects and errors are returned
  • ERROR 500 Internal Server Error — Occurs 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:

curl -i -H "accept: text/xml" -H "Content-type: text/xml" -X PUT -d '<route-gate><description>This is sample Route
Gate</description></route-gate>'
 http://[rails_host]/v1/route_gates/[id]?token=[api_token]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{ "route_gate": { "description" : "This is sample Route Gate"}}'  http://[rails_host]/v1/route_gates/[id]?token=[api_token]

Filter example:

curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{ "route_gate": { "environment_id":1, "route_id":1, "description": "Rest Route Gate" }, "filters": { "include_except":"environment,constraints" }}' https://[rails_host]/v1/route_gates/[id]?token=[api_token]

DELETE /v1/route_gates/[id]

Deletes a route gate.

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

Raises

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

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

Sample output

The following JSON is a sample output from GET /v1/route_gates:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
ETag: "e8702e918abca1263dfd39b447a98139"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 9970f18e6741eb90152c87edabd6589f
X-Runtime: 1.575000
Content-Type: application/json;charset=utf-8
Content-Length: 478
Date: Tue, 27 Aug 2013 18:15:15 GMT


[{
"created_at":"2013-08-23T10:45:03-04:00",
"description":null,
"different_level_from_previous":true,
"id":3,
"position":2,
"updated_at":"2013-08-23T10:45:03-04:00",
"environment": {
"id":2,
"name":"production"
},
"route": {
"id":2,
"name":"Production Route"
},
"constraints": [{
"governable_id":2,
"governable_type":"PlanStageInstance",
"id":3
}, {
"governable_id":3,
"governable_type":"PlanStageInstance",
"id":1
}]
}]

The following XML is a sample output from GET /v1/route_gates/1:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=Edge
Etag: "01c52d69ff2187f430729625eed0a359"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 345d93e477af005c52bfbc11d7f0c069
X-Runtime: 0.882000
Content-Type: application/xml;charset=utf-8
Content-Length: 1009
Date: Tue, 27 Aug 2013 18:17:24 GMT

<?xml version="1.0" encoding="UTF-8"?>
<route-gate>
 <created-at type="datetime">2013-08-23T10:45:03-04:00</created-at>
 <description nil="true"></description>
 <different-level-from-previous type="boolean">true</different-level-from-previous>
 <id type="integer">3</id>
 <position type="integer">2</position>
 <updated-at type="datetime">2013-08-23T10:45:03-04:00</updated-at>
 <environment>
   <id type="integer">2</id>
   <name>production</name>
 </environment>
 <route>
   <id type="integer">2</id>
   <name>Production Route</name>
 </route>
 <constraints type="array">
   <constraint>
     <governable-id type="integer">2</governable-id>
     <governable-type>PlanStageInstance</governable-type>
     <id type="integer">3</id>
   </constraint>
   <constraint>
     <governable-id type="integer">3</governable-id>
     <governable-type>PlanStageInstance</governable-type>
     <id type="integer">1</id>
   </constraint>
 </constraints>
</route-gate>

Related topic

 

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

BMC Release Process Management 5.0.06