setLocalConsolePassword method
Sets the password for your VM local console. When you log in to the local console for the first time, you log in to the VM with the default credentials. We recommend that you set a new password. You don't need to know the default password to set a new password.
May throw InvalidGatewayRequestException. May throw InternalServerError.
Parameter localConsolePassword
:
The password you want to set for your VM local console.
Implementation
Future<SetLocalConsolePasswordOutput> setLocalConsolePassword({
required String gatewayARN,
required String localConsolePassword,
}) async {
ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
_s.validateStringLength(
'gatewayARN',
gatewayARN,
50,
500,
isRequired: true,
);
ArgumentError.checkNotNull(localConsolePassword, 'localConsolePassword');
_s.validateStringLength(
'localConsolePassword',
localConsolePassword,
6,
512,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.SetLocalConsolePassword'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'GatewayARN': gatewayARN,
'LocalConsolePassword': localConsolePassword,
},
);
return SetLocalConsolePasswordOutput.fromJson(jsonResponse.body);
}