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)
| 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 |
no outgoing calls