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.
Parameters:
-
local_console_password
(LocalConsolePassword)
–
The password you want to set for your VM local console.
Raises:
-
InternalServerError
–
An internal server error has occurred during the request. For more information, see the error and message fields.
-
InvalidGatewayRequestException
–
An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To set a password for your VM
Sets the password for your VM local console.
>>> client.set_local_console_password(gateway_arn='arn:aws:storagegateway:us-east-1:999999999999:gateway/sgw-12A3456B', local_console_password='PassWordMustBeAtLeast6Chars.')
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
| def set_local_console_password(
self,
gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
local_console_password: "capo_storage_gateway.types.local_console_password.LocalConsolePassword",
*,
config_overrides: Optional[StorageGatewayClientConfig] = None,
) -> "capo_storage_gateway.types.set_local_console_password_output.SetLocalConsolePasswordOutput":
"""<p>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.</p>
Args:
local_console_password: <p>The password you want to set for your VM local console.</p>
Raises:
capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To set a password for your VM
Sets the password for your VM local console.
>>> client.set_local_console_password(gateway_arn='arn:aws:storagegateway:us-east-1:999999999999:gateway/sgw-12A3456B', local_console_password='PassWordMustBeAtLeast6Chars.')
"""
def _handler(
req: "OperationRequest[capo_storage_gateway.types.set_local_console_password_input.SetLocalConsolePasswordInput]",
) -> OperationResponse[
"capo_storage_gateway.types.set_local_console_password_output.SetLocalConsolePasswordOutput"
]:
import capo_storage_gateway._operations.storage_gateway_20130630.set_local_console_password
output, http_response = (
capo_storage_gateway._operations.storage_gateway_20130630.set_local_console_password.set_local_console_password(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_storage_gateway.types.set_local_console_password_input.SetLocalConsolePasswordInput",
) -> dict[str, Any]:
import capo_storage_gateway.types.set_local_console_password_input
return capo_storage_gateway.types.set_local_console_password_input.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("SetLocalConsolePassword", redact_input=_redact_input),
)
input_: capo_storage_gateway.types.set_local_console_password_input.SetLocalConsolePasswordInput = {
"gateway_arn": gateway_arn,
"local_console_password": local_console_password,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|