REST route gates


GET /v1/route_gates

Returns all the route gates.

Filters

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

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]

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

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]

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

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]

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

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]

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

Managing-routes

 

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

BMC Release Process Management 4.8