restman command
2
gateway83
2
Purpose and Usage |
|
Example: Replicating a RESTman query
Consider the following RESTman query:
GET /restman/1.0/folders?name=find
You can reproduce this RESTman query using the
restman
command with the following parameters:- --method GET
- --path 1.0/folders
- --query name=find
- --restman restman
The "--restman" parameter specifies the path to the REST Management interface. When this interface is installed as intended, the assumed path is the default "restman", so this parameter is technically not required but is included here for illustrative purposes.
Example: Basic GET
Displays the root folder dependencies on the console.
$ ./GatewayMigrationUtility.sh restman --argFile commonarguments.properties --method GET --path '1.0/folders/0000000000000000ffffffffffffec76/dependencies'
Example: GET with query
Gets information about service "myService" and places it in the response.xml file.
$ ./GatewayMigrationUtility.sh restman --argFile commonarguments.properties --method GET --path '1.0/services' --query 'name=myService' --response response.xml
Example: Save response to file
Saves the root folder dependencies to the response.xml file.
$ ./GatewayMigrationUtility.sh restman --argFile commonarguments.properties --method GET --path '1.0/folders/0000000000000000ffffffffffffec76/dependencies' --response response.xml
Example: POST
Create a folder described in the myfolder.xml payload file.
$ ./GatewayMigrationUtility.sh restman --argFile commonarguments.properties --method POST --path '1.0/folders' --request myfolder.xml
In this example,
myfolder.xml
contains the actual folder description in XML code. Its contents should be something similar to this:<l7:Folder folderId="0000000000000000ffffffffffffec76" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management"> <l7:Name>Folder Name</l7:Name></l7:Folder>