MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / delete

Method delete

python/example_code/ssm/ops_item.py:74–91  ·  view source on GitHub ↗

Delete the OpsItem.

(self)

Source from the content-addressed store, hash-verified

72
73 # snippet-start:[python.example_code.ssm.DeleteOpsItem]
74 def delete(self):
75 """
76 Delete the OpsItem.
77 """
78 if self.id is None:
79 return
80 try:
81 self.ssm_client.delete_ops_item(OpsItemId=self.id)
82 print(f"Deleted ops item with id {self.id}")
83 self.id = None
84 except ClientError as err:
85 logger.error(
86 "Couldn't delete ops item %s. Here's why: %s: %s",
87 self.id,
88 err.response["Error"]["Code"],
89 err.response["Error"]["Message"],
90 )
91 raise
92
93 # snippet-end:[python.example_code.ssm.DeleteOpsItem]
94

Callers 14

test_delete_ops_itemFunction · 0.95
usage_demoFunction · 0.45
delete_topicMethod · 0.45
delete_subscriptionMethod · 0.45
delete_queueMethod · 0.45
delete_messageFunction · 0.45
usage_demoFunction · 0.45
remove_queueFunction · 0.45
test_delete_messagesFunction · 0.45

Calls

no outgoing calls

Tested by 4

test_delete_ops_itemFunction · 0.76
test_delete_messagesFunction · 0.36
finFunction · 0.36