Skip to content

describe_instance_patches async

describe_instance_patches(
    instance_id: InstanceId,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[PatchOrchestratorFilterList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[PatchComplianceMaxResults] = None,
) -> DescribeInstancePatchesResult

Retrieves information about the patches on the specified managed node and their state relative to the patch baseline being used for the node.

Parameters:

  • instance_id (InstanceId) –

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

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

    Each element in the array is a structure containing a key-value pair.

    Supported keys for DescribeInstancePatchesinclude the following:

    • Classification

      Sample values: Security | SecurityUpdates

    • KBId

      Sample values: KB4480056 | java-1.7.0-openjdk.x86_64

    • Severity

      Sample values: Important | Medium | Low

    • State

      Sample values: Installed | InstalledOther | InstalledPendingReboot

      For lists of all State values, see Patch compliance state values in the Amazon Web Services Systems Manager User Guide.

  • 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 patches to return (per page).

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • InvalidFilter –

    The filter name isn't valid. Verify that you entered the correct name and try again.

  • InvalidInstanceId –

    The following problems can cause this exception:

    • You don't have permission to access the managed node.

    • Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.

    • SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.

    • The managed node isn't in a valid state. Valid states are: Running, Pending, Stopped, and Stopping. Invalid states are: Shutting-down and Terminated.

  • InvalidNextToken –

    The specified token isn't valid.

  • 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_instance_patches(
    self,
    instance_id: "capo_ssm.types.instance_id.InstanceId",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[
        "capo_ssm.types.patch_orchestrator_filter_list.PatchOrchestratorFilterList"
    ] = 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_patches_result.DescribeInstancePatchesResult"
):
    """<p>Retrieves information about the patches on the specified managed node and their state relative to the patch baseline being used for the node.</p>

    Args:
        instance_id: <p>The ID of the managed node whose patch state information should be retrieved.</p>
        filters: <p>Each element in the array is a structure containing a key-value pair.</p> <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p> <ul> <li> <p> <b> <code>Classification</code> </b> </p> <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code> </p> </li> <li> <p> <b> <code>KBId</code> </b> </p> <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code> </p> </li> <li> <p> <b> <code>Severity</code> </b> </p> <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code> </p> </li> <li> <p> <b> <code>State</code> </b> </p> <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code> </p> <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p> </li> </ul>
        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 patches 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_filter.InvalidFilter: <p>The filter name isn't valid. Verify that you entered the correct name and try again.</p>
        capo_ssm.errors.invalid_instance_id.InvalidInstanceId: <p>The following problems can cause this exception:</p> <ul> <li> <p>You don't have permission to access the managed node.</p> </li> <li> <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p> </li> <li> <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p> </li> <li> <p>The managed node isn't in a valid state. Valid states are: <code>Running</code>, <code>Pending</code>, <code>Stopped</code>, and <code>Stopping</code>. Invalid states are: <code>Shutting-down</code> and <code>Terminated</code>.</p> </li> </ul>
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.describe_instance_patches_request.DescribeInstancePatchesRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.describe_instance_patches_result.DescribeInstancePatchesResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_instance_patches

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstancePatches")
    )
    input_: capo_ssm.types.describe_instance_patches_request.DescribeInstancePatchesRequest = {
        "instance_id": instance_id
    }
    if filters is not None:
        input_["filters"] = filters
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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