Table of Contents |
---|
Applications store the REST URL of the web server they interact. Also, apps store other settings and data.App
Apps
Field | Description |
---|---|
name | Application name |
appKey | Unique identifier that is used on the client side to connect to this app |
url | REST URL for web server integration via WCS RESTful API. |
owner | User who owns the application |
mainClass | Main class for direct calls. For deep integration and server-side developers. |
callbackClass | Main class for callbacks. For deep integration and server-side developers. |
restUsername | User name for HTTP authentication of REST. |
restPassword | User password for HTTP authentication of REST. |
You can manage apps using the following commands:
- show apps
- add app
- update app
- remove app
show apps
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 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:
...
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" |
update app
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:
...
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 |
remove app
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:
show rest-methods
To include or exclude REST methods to/from the app, use the following commands:
...
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:
...
Code Block | ||||
---|---|---|---|---|
| ||||
show app-rest-methods MyApp |
add app-rest-method
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:
...
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:
...
Code Block | ||||
---|---|---|---|---|
| ||||
remove app-rest-method MyApp ConnectionStatusEvent remove app-rest-method -a MyApp |
Examples
Adding the app for the existing user bob with enabled methods ConnectionStatusEvent, ErrorStatusEvent
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 and remove the ErrorStatusEvent method
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 |