Promotes a data replication replica broker to the primary broker role.
Parameters:
-
broker_id
(__string)
–
The unique ID that Amazon MQ generates for the broker.
-
mode
(Optional[PromoteMode], default:
None
)
–
The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.
Raises:
Source code in docs_src/capo_mq/_services/mq.py
| def promote(
self,
broker_id: "capo_mq.types.__string.__string",
*,
config_overrides: Optional[mqClientConfig] = None,
mode: Optional["capo_mq.types.promote_mode.PromoteMode"] = None,
) -> "capo_mq.types.promote_response.PromoteResponse":
"""<p>Promotes a data replication replica broker to the primary broker role.</p>
Args:
broker_id: <p>The unique ID that Amazon MQ generates for the broker.</p>
mode: <p>The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.</p>
Raises:
capo_mq.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
capo_mq.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
capo_mq.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
capo_mq.errors.not_found_exception.NotFoundException: <p>Returns information about an error.</p>
capo_mq.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_mq.types.promote_request.PromoteRequest]",
) -> OperationResponse["capo_mq.types.promote_response.PromoteResponse"]:
import capo_mq._operations.mq.promote
output, http_response = capo_mq._operations.mq.promote.promote(
req.options, req.input
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("Promote")
)
input_: capo_mq.types.promote_request.PromoteRequest = {"broker_id": broker_id}
if mode is not None:
input_["mode"] = mode
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|