...
The command is used to show existing apps in the system. The full list of apps is shown only if the invoking user is a member of the supergroup. Otherwise, a user A user gets the list of his own applications only. Parameters:
...
Code Block | ||||
---|---|---|---|---|
| ||||
show apps
show apps -d |
add app
Used to add a new app to the system. By default a new app belongs to the user who created it. If the user who created the application belongs to the supergroup, he can specify another user as the owner of the app. Parameters:
<app name> the name of the app, required
...
Code Block | ||||
---|---|---|---|---|
| ||||
add app MyApp myNewUniqueKey "http://localhost/my_app" add app -u rest_http_user -p rest_password MyApp2 myNewKey2 "http://localhost/my_app2" add app -o alice MyApp3 myNewKey3 "http://localhost/my_app3" |
...
The command is used to modify an existing app in the system. A user can modify only applications he or she owns. If a user is a member of the supergroup he can change any applications. Only a supergroup member can change the owner of an app. Parameters:
<app name> the name of the app, required
...
Code Block | ||||
---|---|---|---|---|
| ||||
update app -k newAppKey -u new_rest_user -p new_rest_password MyApp update app -o admin MyApp update app -l "http://10.10.10.10/app" MyApp |
...
Used to remove an app. Only the user who own the application or a member of the supergroup can remove it. Parameters:
...
Code Block | ||||
---|---|---|---|---|
| ||||
remove app MyApp |
REST Methods
For each application you can provide methods that will be invoked on the web server via REST/HTTP.
The full list of methods is available with the command:
Code Block | ||||
---|---|---|---|---|
| ||||
show rest-methods |
To include or exclude REST methods to/from the app, use the following commands:
- show app-rest-methods
- remove app-rest-method
- add app-rest-method
If a method is added to the app, it takes part in integration and is invoked every time the WCS server requires that.
For example, if the ConnectionStatusEvent method is added, WCS will invoke the REST URL http://localhost/ConnectionStatusEvent every time a new user connects and pass necessary data to the web server. For more detailed description of REST API operation refer Web Call Server - Call Flow documentation.
If the method is not added to the app, there will be no a REST request to the web server. For example, when a new user connects, the REST URL http://localhost/ConnectionStatusEvent is not queried.
show app-rest-methods
The command is used to show active methods of the app. Parameters:
<app_name> the name of the app, required
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
show app-rest-methods MyApp |
...
Used to add a method to the application. Only the user who owns the app or a member of the supergroup can add methods to the app. Parameters:
<app name> the name of the app, required
<rest method> the name of the method (as displayed by the show app-rest-methods command), required unless -а is provided
[-a | --all] add all available methods to the app
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
add app-rest-method MyApp ConnectionStatusEvent
add app-rest-method -a MyApp |
remove app-rest-method
Used to exclude a method from the app. Only the user who owns the app or a member of the supergroup can remove methods from the app. Parameters:
<app name> the name of the app, required
<rest method> the name of the method (as displayed by the show app-rest-methods command), required unless -а is provided
[-a | --all] exclude all methods added to the app
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
remove app-rest-method MyApp ConnectionStatusEvent
remove app-rest-method -a MyApp |
Examples
Adding the app for the existing user bob
...
1.adding the app
Code Block | ||||
---|---|---|---|---|
| ||||
add app -o bob BobsApp bobAppKey "http://bobs_web_server.example.com/app" |
2. adding methods to the app
Code Block | ||||
---|---|---|---|---|
| ||||
add app-rest-method BobsApp ConnectionStatusEvent
add app-rest-method BobsApp ErrorStatusEvent |
Modify the app and add data for HTTP authentication, change HTTP address
Code Block | ||||
---|---|---|---|---|
| ||||
update app -u bobs_app -p paSsw0rd BobsApp update app -l "https://bobs_new_server.example.com/secureApp" BobsApp |
Transfer the ownership of the app to another user
...
1.change ownership
Code Block | ||||
---|---|---|---|---|
| ||||
update app -o alice BobsApp |
2.remove the method
Code Block | ||||
---|---|---|---|---|
| ||||
remove app-rest-method BobsApp ErrorStatusEvent |
Adding/Removing all methods of the app
1.removing
Code Block | ||||
---|---|---|---|---|
| ||||
remove app-rest-method -a BobsApp |
2.adding
Code Block | ||||
---|---|---|---|---|
| ||||
add app-rest-method -a BobsApp |