Remediation Update Action
This API is used for updating a remediation action. Update API expects all parameters retrived via get API. Fields "action_name", "file_type", "created_on" and "last_updated" are read-only and can't be updated. Any missing non mandatory field in update request, will be set to default values.
Unique id, to indentify the action
Show optional properties
{
"action_name": "slack_action",
"file_type": "PYTHON"
}
{
"action_name": "string",
"file_data": "string",
"created_on": "string",
"last_updated": "string"
}
Name of the remediation action
either PYTHON or YAML
file content
action creation timestamp
action last update timestamp
Created
{
"action_name": "slack_action",
"created_on": "21 Nov, 2022, 00:42:45 UTC",
"description": "slack action",
"file_data": "import json\nfrom datetime import datetime\nfrom airflow.models import DAG\nfrom airflow.models import Variable\nfrom airflow.models.param import Param\nfrom airflow.operators.python import PythonOperator\nfrom airflow.providers.slack.operators.slack import SlackAPIPostOperator\nimport logging\nfrom Success import *\nfrom Failure import *\n\nmyParams = {\n \"Acknowledged\": 'false',\n \"Active\": 'true',\n \"AuditTrail\": [\n {\n \"User\": \"\",\n \"ActionType\": \"\",\n \"SerialNumber\": 0,\n \"Text\": \"\",\n \"Timestamp\": 0\n }\n ],\n \"Category\": \"\",\n \"CausedBy\": [],\n \"Causes\": [\n \"\"\n ],\n \"Certainty\": 0.0,\n \"ClassDisplayName\": \"\",\n \"ClassName\": \"\",\n \"ClearOnAcknowledge\": 'false',\n \"ClosedAt\": 0,\n \"ElementClassName\": \"\",\n \"ElementName\": \"\",\n \"EventDisplayName\": \"\",\n \"EventName\": \"\",\n \"EventState\": \"\",\n \"EventText\": \"\",\n \"EventType\": \"\",\n \"FirstNotifiedAt\": 0,\n \"Impact\": 0,\n \"InMaintenance\": 'false',\n \"InstanceDisplayName\": \"\",\n \"InstanceName\": \"66999f1a-9ef1-4840-a427-b18e04998f49\",\n \"IsProblem\": 'true',\n \"IsRoot\": 'true',\n \"LastChangedAt\": 0,\n \"Name\": \"NOTIFICATION-Interface_IF-qa-npmpe5/4_Down\",\n \"OccurrenceCount\": 1,\n \"OpenedAt\": 0,\n \"Owner\": \"\",\n \"PollingID\": 0,\n \"PollingState\": \"\",\n \"ProcessedTimeStamp\": 0,\n \"Severity\": 1,\n \"Source\": \"$Source:INCHARGE-SA-PRES$\",\n \"SourceDomainName\": \"\",\n \"SourceEventType\": \"\",\n \"SourceInfo\": \"\",\n \"SourceSpecific\": \"\",\n \"TroubleTicketID\": \"\",\n \"UserDefined1\": \"\",\n \"UserDefined10\": \"\",\n \"UserDefined11\": \"\",\n \"UserDefined12\": \"\",\n \"UserDefined13\": \"\",\n \"UserDefined14\": \"\",\n \"UserDefined15\": \"\",\n \"UserDefined16\": \"\",\n \"UserDefined17\": \"\",\n \"UserDefined18\": \"\",\n \"UserDefined19\": \"\",\n \"UserDefined2\": \"\",\n \"UserDefined20\": \"\",\n \"UserDefined3\": \"\",\n \"UserDefined4\": \"\",\n \"UserDefined5\": \"\",\n \"UserDefined6\": \"\",\n \"UserDefined7\": \"\",\n \"UserDefined8\": \"\",\n \"UserDefined9\": \"\",\n \"tags\": {\n \"customer\": \"\",\n \"location\": \"\",\n \"latitude\": \"\"\n }\n}\n\nwith DAG(\n\tdag_id='slack_action',\n\tschedule_interval=None,\n\tstart_date=datetime(2022,5,16),\n default_args={'slack_conn_id': 'slack_connection', 'channel': '#airflow-slack-integration'},\n params=myParams,\n\tis_paused_upon_creation=False,\n\tcatchup=False,\n on_success_callback =success,\n on_failure_callback =failure\n) as dag:\n\n # 1. send slack message with JIRA info and summary\n task_post_slack = SlackAPIPostOperator(\n task_id='task_post_slack',\n text='TCSA Notification received\\n {{ params.Name }}\\n {{ params.Source }}',\n channel='#airflow-slack-integration',\n on_success_callback = success,\n on_failure_callback =failure\n )\n\n task_post_slack",
"file_type": "PYTHON",
"last_updated": "21 Nov, 2022, 00:42:45 UTC"
}
Name of the remediation action
either PYTHON or YAML
file content
action creation timestamp
action last update timestamp
Invalid Request sent by the user
resouce not found
Internal server error