Skip to content

describe_maintenance_window_targets async

describe_maintenance_window_targets(
    window_id: MaintenanceWindowId,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[MaintenanceWindowFilterList] = None,
    max_results: Optional[MaintenanceWindowMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeMaintenanceWindowTargetsResult

Lists the targets registered with the maintenance window.

Parameters:

  • window_id (MaintenanceWindowId) –

    The ID of the maintenance window whose targets should be retrieved.

  • filters (Optional[MaintenanceWindowFilterList], default: None ) –

    Optional filters that can be used to narrow down the scope of the returned window targets. The supported filter keys are Type, WindowTargetId, and OwnerInformation.

  • max_results (Optional[MaintenanceWindowMaxResults], default: None ) –

    The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next set of items to return. (You received this token from a previous call.)

Raises:

  • DoesNotExistException –

    Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.

    For information about resource quotas in Amazon Web Services Systems Manager, see Systems Manager service quotas in the Amazon Web Services General Reference.

  • InternalServerError –

    An error occurred on the server side.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def describe_maintenance_window_targets(
    self,
    window_id: "capo_ssm.types.maintenance_window_id.MaintenanceWindowId",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[
        "capo_ssm.types.maintenance_window_filter_list.MaintenanceWindowFilterList"
    ] = None,
    max_results: Optional[
        "capo_ssm.types.maintenance_window_max_results.MaintenanceWindowMaxResults"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.describe_maintenance_window_targets_result.DescribeMaintenanceWindowTargetsResult":
    """<p>Lists the targets registered with the maintenance window.</p>

    Args:
        window_id: <p>The ID of the maintenance window whose targets should be retrieved.</p>
        filters: <p>Optional filters that can be used to narrow down the scope of the returned window targets. The supported filter keys are <code>Type</code>, <code>WindowTargetId</code>, and <code>OwnerInformation</code>.</p>
        max_results: <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>

    Raises:
        capo_ssm.errors.does_not_exist_exception.DoesNotExistException: <p>Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.</p> <p>For information about resource quotas in Amazon Web Services Systems Manager, see <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm">Systems Manager service quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.describe_maintenance_window_targets_request.DescribeMaintenanceWindowTargetsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.describe_maintenance_window_targets_result.DescribeMaintenanceWindowTargetsResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_maintenance_window_targets

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.describe_maintenance_window_targets.async_describe_maintenance_window_targets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ssm.types.describe_maintenance_window_targets_result.DescribeMaintenanceWindowTargetsResult",
    ) -> dict[str, Any]:
        import capo_ssm.types.describe_maintenance_window_targets_result

        return capo_ssm.types.describe_maintenance_window_targets_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeMaintenanceWindowTargets", redact_output=_redact_output
        ),
    )
    input_: capo_ssm.types.describe_maintenance_window_targets_request.DescribeMaintenanceWindowTargetsRequest = {
        "window_id": window_id
    }
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output