Updates the configuration of the specified server.
Parameters:
Raises:
Source code in docs_src/capo_migrationhubstrategy/_services/migration_hub_strategy.py
| def update_server_config(
self,
server_id: "capo_migrationhubstrategy.types.server_id.ServerId",
*,
config_overrides: Optional[MigrationHubStrategyClientConfig] = None,
strategy_option: Optional[
"capo_migrationhubstrategy.types.strategy_option.StrategyOption"
] = None,
) -> "capo_migrationhubstrategy.types.update_server_config_response.UpdateServerConfigResponse":
"""<p> Updates the configuration of the specified server. </p>
Args:
server_id: <p> The ID of the server. </p>
strategy_option: <p> The preferred strategy options for the application component. See the response from <a>GetServerStrategies</a>.</p>
Raises:
capo_migrationhubstrategy.errors.internal_server_exception.InternalServerException: <p> The server experienced an internal error. Try again. </p>
capo_migrationhubstrategy.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified ID in the request is not found. </p>
capo_migrationhubstrategy.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
capo_migrationhubstrategy.errors.validation_exception.ValidationException: <p> The request body isn't valid. </p>
capo_migrationhubstrategy.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_migrationhubstrategy.types.update_server_config_request.UpdateServerConfigRequest]",
) -> OperationResponse[
"capo_migrationhubstrategy.types.update_server_config_response.UpdateServerConfigResponse"
]:
import capo_migrationhubstrategy._operations.aws_migration_hub_strategy_recommendation.update_server_config
output, http_response = (
capo_migrationhubstrategy._operations.aws_migration_hub_strategy_recommendation.update_server_config.update_server_config(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateServerConfig")
)
input_: capo_migrationhubstrategy.types.update_server_config_request.UpdateServerConfigRequest = {
"server_id": server_id
}
if strategy_option is not None:
input_["strategy_option"] = strategy_option
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|