AMI Web Framework API > Namespace > amiCommand


amiCommand

The AMI command subsystem

Methods


initHttpClient(endpoint)
Initializes the HTTP client

Parameters:
NameTypeDescriptionDefaultOptionalNullable
endpointstringthe HTTP endpoint

initMqttClient(endpoint)
Initializes the MQTT client

Parameters:
NameTypeDescriptionDefaultOptionalNullable
endpointstringthe 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:
NameTypeDescriptionDefaultOptionalNullable
commandstringthe command
optionsObject.<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:
NameTypeDescriptionDefaultOptionalNullable
tokenstringthe password
serverNamestringthe server name
Returns:
A JQuery promise object
Type: $.Promise

mqttSignOut(options) ->{$.Promise}
Signs out (MQTT client)

Parameters:
NameTypeDescriptionDefaultOptionalNullable
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

signInByToken(token, options) ->{$.Promise}
Signs in by token (HTTP client)

Parameters:
NameTypeDescriptionDefaultOptionalNullable
tokenstringthe token
optionsObject.<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:
NameTypeDescriptionDefaultOptionalNullable
usernamestringthe username
passwordstringthe password
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

signInByCertificate(options) ->{$.Promise}
Signs in by certificate (HTTP client)

Parameters:
NameTypeDescriptionDefaultOptionalNullable
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

signOut(options) ->{$.Promise}
Signs out (HTTP client)

Parameters:
NameTypeDescriptionDefaultOptionalNullable
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

attachCertificate(options) ->{$.Promise}
Attaches a certificate

Parameters:
NameTypeDescriptionDefaultOptionalNullable
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

detachCertificate(options) ->{$.Promise}
Detaches a certificate

Parameters:
NameTypeDescriptionDefaultOptionalNullable
optionsObject.<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:
NameTypeDescriptionDefaultOptionalNullable
usernamestringthe username
passwordstringthe password
firstNamestringthe first name
lastNamestringthe last name
emailstringthe email
captchaHashstringthe captcha hash generated by AMI
captchaTextstringthe captcha text entered by the username
attachCertbooleanattach the current certificate
agreebooleanagree with the terms and conditions
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

changeInfo(firstName, lastName, email, options) ->{$.Promise}
Changes the account information

Parameters:
NameTypeDescriptionDefaultOptionalNullable
firstNamestringthe first name
lastNamestringthe last name
emailstringthe email
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

changePassword(username, oldPassword, newPassword, options) ->{$.Promise}
Changes the account password

Parameters:
NameTypeDescriptionDefaultOptionalNullable
usernamestringthe username
oldPasswordstringthe old password
newPasswordstringthe new password
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise

resetPassword(username, captchaHash, captchaText, options) ->{$.Promise}
Resets the account password

Parameters:
NameTypeDescriptionDefaultOptionalNullable
usernamestringthe username
captchaHashstringthe captcha hash generated by AMI
captchaTextstringthe captcha text entered by the username
optionsObject.<string, *>dictionary of optional parameters (context){}
Returns:
A JQuery promise object
Type: $.Promise