The purpose of this RESTful Web service documentation is to provide a clear and concise library of the available Web services that can be used with tools such as curl.
Format
Each Web service page has the following sections:
Description
A short description of the Web service.
Request
- Details about the request including:
- URL
- Method
- Parameters
- Headers
- Request body
- Examples
Response
- Details about each response code including:
- Headers
- Response body
- Examples
GET
The information provided in the request section of each Web service can be used to construct a curl command. For example, to fetch a list of the available Reverse Proxy instances, the documentation gives an example of:
GET https://{appliance_hostname}/wga/reverseproxy
and lists the accepted headers as:
Authorization Accept:application/json
The corresponding curl command would be formatted as follows:
curl -H 'Accept:application/json' --user admin:admin -X GET https://{appliance_hostname}/wga/reverseproxy
POST/PUT
The curl command for POST and PUT requests is slightly more complicated. The documentation about most Web services gives an example of how to format the required JSON. For example, to create a HTTP Transformation Rule file, an example is:
POST https://{appliance_hostname}/wga/http_transformation_rules
POST_DATA: {
"name":"new_file_name",
"template":"template_name"
}
the accepted headers are:
Authorization Accept:application/json
and the request body can have the "name", "template" or "content" JSON keys. The corresponding curl command would be:
curl -H 'Accept:application/json' --user admin:admin --data-binary '{"name":"my_new_file","template":"request"}' -X POST https://{appliance_hostname}/wga/http_transformation_rules
Forms
The curl command for Forms requests is again more complicated. The documentation about most Web services lists the required form-field in the Request Body section. For example, to import a HTTP Transformation Rule file, the request body is:
Request Body
| Name |
Type |
Optional |
Description |
| file |
String |
No |
The HTTP Transformation Rule file as application or octet-stream. It contains both the file name and data content of the HTTP Transformation Rule file to be imported. |
the request example is:
POST https://{appliance_hostname}/wga/http_transformation_rules
POST_DATA: { "file":"http_transformation_rules_file" }
and the accepted headers are:
Authorization Accept:application/json
The corresponding curl command would be:
curl -H 'Accept:application/json' --user admin:admin -F file=@my_new_file;type=application/octet-stream https://{appliance_hostname}/http_transformation_rules
The -F flag sets curl to emulate a filled-in form. To force the "content" to be a file, prefix the file name with an "@" symbol, as in the example above. To instead send the contents of a file, prefix the file name with the symbol "<". The "<" symbol would be used for other import Web services where JSON can be sent, rather than form fields. In those cases, the request body would require the JSON key "contents".