Applications store the REST URL of the web server they interact. Also, apps store other settings and data.
App
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:
[-d | --detail] enable detailed output
Example:
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
<app key> the unique key of the app, required
<app url> REST URL for integration with the Web server via WCS RESTful API, required
[-m | --m-class] main class for direct calls, optional
[-c | --c-class] main class for callbacks, optional
[-u | --u-rest] user name for HTTP authentication, optional
[-p | --p-rest] user password for HTTP authentication, optional
[-o | --owner] the user who should own the app, optional
Example:
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:
<app name> the name of the app, required
[-k | --key] the unique key of the app, required
[-l | --url] REST URL for integration with the Web server via WCS RESTful API, required
[-m | --m-class] main class for direct calls, optional
[-c | --c-class] main class for callbacks, optional
[-u | --u-rest] user name for HTTP authentication, optional
[-p | --p-rest] user password for HTTP authentication, optional
[-o | --owner] the user who should own the app, optional
Example:
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:
<app name> the name of the app, required
Example:
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:
- 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:
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:
<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:
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:
remove app-rest-method MyApp ConnectionStatusEvent remove app-rest-method -a MyApp