AMI Web Framework API > Namespace > amiCommand
amiCommand
The AMI command subsystem
Methods
initHttpClient(endpoint)
Initializes the HTTP client
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| endpoint | string | the HTTP endpoint |
initMqttClient(endpoint)
Initializes the MQTT client
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| endpoint | string | the MQTT endpoint |
getHttpEndpoint() ->{string}
Gets the HTTP endpoint
Returns:
Type: string
getMqttEndpoint() ->{string}
Gets the MQTT endpoint
Returns:
Type: string
execute(command, options) ->{$.Promise}
Executes an AMI command
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| command | string | the command | |||
| options | Object.<string, *> | dictionary of optional parameters (mqtt, endpoint, serverName, converter, extras, params, context, timeout) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
mqttSignInByToken(token, serverName) ->{$.Promise}
Signs in by JWT token (MQTT client)
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| token | string | the password | |||
| serverName | string | the server name |
Returns:
A JQuery promise object
Type: $.Promise
mqttSignOut(options) ->{$.Promise}
Signs out (MQTT client)
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
signInByToken(token, options) ->{$.Promise}
Signs in by token (HTTP client)
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| token | string | the token | |||
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
signInByPassword(username, password, options) ->{$.Promise}
Signs in by login/password (HTTP client)
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| username | string | the username | |||
| password | string | the password | |||
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
signInByCertificate(options) ->{$.Promise}
Signs in by certificate (HTTP client)
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
signOut(options) ->{$.Promise}
Signs out (HTTP client)
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
attachCertificate(options) ->{$.Promise}
Attaches a certificate
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
detachCertificate(options) ->{$.Promise}
Detaches a certificate
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
addUser(username, password, firstName, lastName, email, captchaHash, captchaText, attachCert, agree, options) ->{$.Promise}
Adds a new username
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| username | string | the username | |||
| password | string | the password | |||
| firstName | string | the first name | |||
| lastName | string | the last name | |||
| string | the email | ||||
| captchaHash | string | the captcha hash generated by AMI | |||
| captchaText | string | the captcha text entered by the username | |||
| attachCert | boolean | attach the current certificate | |||
| agree | boolean | agree with the terms and conditions | |||
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
changeInfo(firstName, lastName, email, options) ->{$.Promise}
Changes the account information
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| firstName | string | the first name | |||
| lastName | string | the last name | |||
| string | the email | ||||
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
changePassword(username, oldPassword, newPassword, options) ->{$.Promise}
Changes the account password
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| username | string | the username | |||
| oldPassword | string | the old password | |||
| newPassword | string | the new password | |||
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise
resetPassword(username, captchaHash, captchaText, options) ->{$.Promise}
Resets the account password
Parameters:
| Name | Type | Description | Default | Optional | Nullable |
|---|---|---|---|---|---|
| username | string | the username | |||
| captchaHash | string | the captcha hash generated by AMI | |||
| captchaText | string | the captcha text entered by the username | |||
| options | Object.<string, *> | dictionary of optional parameters (context) | {} | ✓ |
Returns:
A JQuery promise object
Type: $.Promise