Table of Contents |
---|
Apps
Applications store the REST URL of the web server they interact. Also, apps store other settings and data.
...
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. |
Application descriptions are stored in database.yml file.
You can manage apps using the following commands:
...
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 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 |
Application REST
...
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
...
methods
You can manage application REST methods with the following commands:
- show add app-rest-methodsmethodremove
- show app-rest-methodmethodsadd
- appremove 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 appshow app-rest-methods
The command is used to show active all the REST methods of the appapplication.
Parameters:
<app
...
key> the unique key of the app, required
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
show app-rest-methods MyAppdefaultApp |
add app-rest-method
Used The command is used to add a REST 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
...
key> the unique key of the app, required
<rest method>
...
REST method to be added, required
[-a | --all] add all
...
the REST methods, optional, in this case <rest method> is not required
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
add app-rest-method MyAppMyAppKey ConnectionStatusEventconnect add app-rest-method -a MyAppMyAppKey |
remove app-rest-method
Used to exclude a The command is used to remove REST method from the app. Only the user who owns the app or a member of the supergroup can remove methods from the app. application.
Parameters:
<app
...
key> the unique key of the app, required
<rest method>
...
REST method to be removed, required
[-a | --all]
...
remove all the REST methods, optional, in this case <rest method> is not required
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
remove app-rest-method MyAppMyAppKey ConnectionStatusEventconnect remove app-rest-method -a MyAppMyAppKey |
Examples
Adding the app for the existing user bob
...
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
...
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 |