• AWS Systems Manager Change Manager는 더 이상 신규 고객에게 공개되지 않습니다. 기존 고객은 정상적으로 서비스를 계속 이용할 수 있습니다. 자세한 내용은 AWS Systems Manager Change Manager 가용성 변경을 참조하세요.
• AWS Systems Manager CloudWatch 대시보드는 2026년 4월 30일 이후에는 더 이상 사용할 수 없습니다. 고객은 Amazon CloudWatch 콘솔을 계속 사용하여 현재와 마찬가지로 Amazon CloudWatch 대시보드를 보고, 생성하고, 관리할 수 있습니다. 자세한 내용은 Amazon CloudWatch 대시보드 설명서를 참조하세요.
AWS SDK와 함께 DeleteOpsItem 사용
다음 코드 예시는 DeleteOpsItem의 사용 방법을 보여 줍니다.
- Python
-
- SDK for Python(Boto3)
-
class OpsItemWrapper:
"""Encapsulates AWS Systems Manager OpsItem actions."""
def __init__(self, ssm_client):
"""
:param ssm_client: A Boto3 Systems Manager client.
"""
self.ssm_client = ssm_client
self.id = None
@classmethod
def from_client(cls):
"""
:return: A OpsItemWrapper instance.
"""
ssm_client = boto3.client("ssm")
return cls(ssm_client)
def delete(self):
"""
Delete the OpsItem.
"""
if self.id is None:
return
try:
self.ssm_client.delete_ops_item(OpsItemId=self.id)
print(f"Deleted ops item with id {self.id}")
self.id = None
except ClientError as err:
logger.error(
"Couldn't delete ops item %s. Here's why: %s: %s",
self.id,
err.response["Error"]["Code"],
err.response["Error"]["Message"],
)
raise
- SAP ABAP
-
- SDK for SAP ABAP
-
GitHub에 더 많은 내용이 있습니다. AWS코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.
TRY.
lo_ssm->deleteopsitem( iv_opsitemid = iv_ops_item_id ).
MESSAGE 'OpsItem deleted.' TYPE 'I'.
CATCH /aws1/cx_ssmopsiteminvparamex.
MESSAGE 'Invalid OpsItem parameter.' TYPE 'I'.
ENDTRY.
AWS SDK 개발자 가이드 및 코드 예제의 전체 목록은 AWS SDK와 함께 이 서비스 사용을 참조하세요. 이 주제에는 시작하기에 대한 정보와 이전 SDK 버전에 대한 세부 정보도 포함되어 있습니다.