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

Method update

python/example_code/ssm/ops_item.py:127–152  ·  view source on GitHub ↗

Update an OpsItem. :param title: The new OpsItem title. :param description: The new OpsItem description. :param status: The new OpsItem status. :return:

(self, title=None, description=None, status=None)

Source from the content-addressed store, hash-verified

125
126 # snippet-start:[python.example_code.ssm.UpdateOpsItem]
127 def update(self, title=None, description=None, status=None):
128 """
129 Update an OpsItem.
130
131 :param title: The new OpsItem title.
132 :param description: The new OpsItem description.
133 :param status: The new OpsItem status.
134 :return:
135 """
136 args = dict(OpsItemId=self.id)
137 if title is not None:
138 args["Title"] = title
139 if description is not None:
140 args["Description"] = description
141 if status is not None:
142 args["Status"] = status
143 try:
144 self.ssm_client.update_ops_item(**args)
145 except ClientError as err:
146 logger.error(
147 "Couldn't update ops item %s. Here's why: %s: %s",
148 self.id,
149 err.response["Error"]["Code"],
150 err.response["Error"]["Message"],
151 )
152 raise
153
154 # snippet-end:[python.example_code.ssm.UpdateOpsItem]
155

Callers 12

test_update_ops_itemFunction · 0.95
_face_to_dictMethod · 0.45
stub_get_apisMethod · 0.45
_make_facesFunction · 0.45
replicateFunction · 0.45
usage_demoFunction · 0.45
run_scenarioFunction · 0.45
update_userFunction · 0.45
runMethod · 0.45
animate_lipsMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_update_ops_itemFunction · 0.76
_make_facesFunction · 0.36