Skip to content

describe_instance_patch_states

describe_instance_patch_states(
    instance_ids: InstanceIdList,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[PatchComplianceMaxResults] = None,
) -> DescribeInstancePatchStatesResult

Retrieves the high-level patch state of one or more managed nodes.

Parameters:

  • instance_ids (InstanceIdList) –

    The ID of the managed node for which patch state information should be retrieved.

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

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

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

    The maximum number of managed nodes to return (per page).

Raises:

Source code in docs_src/capo_ssm/_services/ssm.py
def describe_instance_patch_states(
    self,
    instance_ids: "capo_ssm.types.instance_id_list.InstanceIdList",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_ssm.types.patch_compliance_max_results.PatchComplianceMaxResults"
    ] = None,
) -> "capo_ssm.types.describe_instance_patch_states_result.DescribeInstancePatchStatesResult":
    """<p>Retrieves the high-level patch state of one or more managed nodes.</p>

    Args:
        instance_ids: <p>The ID of the managed node for which patch state information should be retrieved.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
        max_results: <p>The maximum number of managed nodes to return (per page).</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token isn't valid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.describe_instance_patch_states_request.DescribeInstancePatchStatesRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.describe_instance_patch_states_result.DescribeInstancePatchStatesResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_instance_patch_states

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

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

        return (
            capo_ssm.types.describe_instance_patch_states_result.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeInstancePatchStates", redact_output=_redact_output
        ),
    )
    input_: capo_ssm.types.describe_instance_patch_states_request.DescribeInstancePatchStatesRequest = {
        "instance_ids": instance_ids
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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