Skip to content

describe_maintenance_windows_for_target

describe_maintenance_windows_for_target(
    targets: Targets,
    resource_type: MaintenanceWindowResourceType,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    max_results: Optional[MaintenanceWindowSearchMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeMaintenanceWindowsForTargetResult

Retrieves information about the maintenance window targets or tasks that a managed node is associated with.

Parameters:

  • targets (Targets) –

    The managed node ID or key-value pair to retrieve information about.

  • resource_type (MaintenanceWindowResourceType) –

    The type of resource you want to retrieve information about. For example, INSTANCE.

  • max_results (Optional[MaintenanceWindowSearchMaxResults], 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:

Source code in docs_src/capo_ssm/_services/ssm.py
def describe_maintenance_windows_for_target(
    self,
    targets: "capo_ssm.types.targets.Targets",
    resource_type: "capo_ssm.types.maintenance_window_resource_type.MaintenanceWindowResourceType",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    max_results: Optional[
        "capo_ssm.types.maintenance_window_search_max_results.MaintenanceWindowSearchMaxResults"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.describe_maintenance_windows_for_target_result.DescribeMaintenanceWindowsForTargetResult":
    """<p>Retrieves information about the maintenance window targets or tasks that a managed node is associated with.</p>

    Args:
        targets: <p>The managed node ID or key-value pair to retrieve information about.</p>
        resource_type: <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.describe_maintenance_windows_for_target_request.DescribeMaintenanceWindowsForTargetRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.describe_maintenance_windows_for_target_result.DescribeMaintenanceWindowsForTargetResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_maintenance_windows_for_target

        output, http_response = (
            capo_ssm._operations.amazon_ssm.describe_maintenance_windows_for_target.describe_maintenance_windows_for_target(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeMaintenanceWindowsForTarget")
    )
    input_: capo_ssm.types.describe_maintenance_windows_for_target_request.DescribeMaintenanceWindowsForTargetRequest = {
        "targets": targets,
        "resource_type": resource_type,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output