Gets the state of a Amazon Web Services Systems Manager change calendar at the current time or a specified time. If you specify a time, GetCalendarState returns the state of the calendar at that specific time, and returns the next time that the change calendar state will transition. If you don't specify a time, GetCalendarState uses the current time. Change Calendar entries have two possible states: OPEN or CLOSED.
If you specify more than one calendar in a request, the command returns the status of OPEN only if all calendars in the request are open. If one or more calendars in the request are closed, the status returned is CLOSED.
For more information about Change Calendar, a tool in Amazon Web Services Systems Manager, see Amazon Web Services Systems Manager Change Calendar in the Amazon Web Services Systems Manager User Guide.
Parameters:
-
calendar_names
(CalendarNameOrARNList)
–
The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.
-
at_time
(Optional[ISO8601String], default:
None
)
–
(Optional) The specific time for which you want to get calendar state information, in ISO 8601 format. If you don't specify a value or AtTime, the current time is used.
Raises:
Source code in docs_src/capo_ssm/_services/async_ssm.py
| async def get_calendar_state(
self,
calendar_names: "capo_ssm.types.calendar_name_or_arn_list.CalendarNameOrARNList",
*,
config_overrides: Optional[AsyncSSMClientConfig] = None,
at_time: Optional["capo_ssm.types.iso8601_string.ISO8601String"] = None,
) -> "capo_ssm.types.get_calendar_state_response.GetCalendarStateResponse":
"""<p>Gets the state of a Amazon Web Services Systems Manager change calendar at the current time or a specified time. If you specify a time, <code>GetCalendarState</code> returns the state of the calendar at that specific time, and returns the next time that the change calendar state will transition. If you don't specify a time, <code>GetCalendarState</code> uses the current time. Change Calendar entries have two possible states: <code>OPEN</code> or <code>CLOSED</code>.</p> <p>If you specify more than one calendar in a request, the command returns the status of <code>OPEN</code> only if all calendars in the request are open. If one or more calendars in the request are closed, the status returned is <code>CLOSED</code>.</p> <p>For more information about Change Calendar, a tool in Amazon Web Services Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar.html">Amazon Web Services Systems Manager Change Calendar</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
Args:
calendar_names: <p>The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.</p>
at_time: <p>(Optional) The specific time for which you want to get calendar state information, in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you don't specify a value or <code>AtTime</code>, the current time is used.</p>
Raises:
capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
capo_ssm.errors.invalid_document.InvalidDocument: <p>The specified SSM document doesn't exist.</p>
capo_ssm.errors.invalid_document_type.InvalidDocumentType: <p>The SSM document type isn't valid. Valid document types are described in the <code>DocumentType</code> property.</p>
capo_ssm.errors.unsupported_calendar_exception.UnsupportedCalendarException: <p>The calendar entry contained in the specified SSM document isn't supported.</p>
capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ssm.types.get_calendar_state_request.GetCalendarStateRequest]",
) -> AsyncOperationResponse[
"capo_ssm.types.get_calendar_state_response.GetCalendarStateResponse"
]:
import capo_ssm._operations.amazon_ssm.get_calendar_state
(
output,
http_response,
) = await capo_ssm._operations.amazon_ssm.get_calendar_state.async_get_calendar_state(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetCalendarState")
)
input_: capo_ssm.types.get_calendar_state_request.GetCalendarStateRequest = {
"calendar_names": calendar_names
}
if at_time is not None:
input_["at_time"] = at_time
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|