Skip to content

get_ops_item

get_ops_item(
    ops_item_id: OpsItemId,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    ops_item_arn: Optional[OpsItemArn] = None,
) -> GetOpsItemResponse

Get information about an OpsItem by using the ID. You must have permission in Identity and Access Management (IAM) to view information about an OpsItem. For more information, see Set up OpsCenter in the Amazon Web Services Systems Manager User Guide.

Operations engineers and IT professionals use Amazon Web Services Systems Manager OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their Amazon Web Services resources. For more information, see Amazon Web Services Systems Manager OpsCenter in the Amazon Web Services Systems Manager User Guide.

Parameters:

  • ops_item_id (OpsItemId) –

    The ID of the OpsItem that you want to get.

  • ops_item_arn (Optional[OpsItemArn], default: None ) –

    The OpsItem Amazon Resource Name (ARN).

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • OpsItemAccessDeniedException –

    You don't have permission to view OpsItems in the specified account. Verify that your account is configured either as a Systems Manager delegated administrator or that you are logged into the Organizations management account.

  • OpsItemNotFoundException –

    The specified OpsItem ID doesn't exist. Verify the ID and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_ssm/_services/ssm.py
def get_ops_item(
    self,
    ops_item_id: "capo_ssm.types.ops_item_id.OpsItemId",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    ops_item_arn: Optional["capo_ssm.types.ops_item_arn.OpsItemArn"] = None,
) -> "capo_ssm.types.get_ops_item_response.GetOpsItemResponse":
    """<p>Get information about an OpsItem by using the ID. You must have permission in Identity and Access Management (IAM) to view information about an OpsItem. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html">Set up OpsCenter</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p> <p>Operations engineers and IT professionals use Amazon Web Services Systems Manager OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their Amazon Web Services resources. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html">Amazon Web Services Systems Manager OpsCenter</a> in the <i>Amazon Web Services Systems Manager User Guide</i>. </p>

    Args:
        ops_item_id: <p>The ID of the OpsItem that you want to get.</p>
        ops_item_arn: <p>The OpsItem Amazon Resource Name (ARN).</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.ops_item_access_denied_exception.OpsItemAccessDeniedException: <p>You don't have permission to view OpsItems in the specified account. Verify that your account is configured either as a Systems Manager delegated administrator or that you are logged into the Organizations management account.</p>
        capo_ssm.errors.ops_item_not_found_exception.OpsItemNotFoundException: <p>The specified OpsItem ID doesn't exist. Verify the ID and try again.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.get_ops_item_request.GetOpsItemRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.get_ops_item_response.GetOpsItemResponse"
    ]:
        import capo_ssm._operations.amazon_ssm.get_ops_item

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetOpsItem")
    )
    input_: capo_ssm.types.get_ops_item_request.GetOpsItemRequest = {
        "ops_item_id": ops_item_id
    }
    if ops_item_arn is not None:
        input_["ops_item_arn"] = ops_item_arn

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