[{"label":"Latest (2.0.1)","version":"latest"}]
telco-cloud-service-assurance

Remediation Update Action

Description

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.

Request

Request

URL

URL


put
https://{api_host}tcsa.host.com/actions/{action_name}
Copy

Path Parameters

Path Parameters

string
action_name Required

Unique id, to indentify the action


Request Body

Request Body

RemediationAction of mimetype application/json Required
{
    "action_name": "slack_action",
    "file_type": "PYTHON"
}
string
action_name Required

Name of the remediation action


string
file_type Required

either PYTHON or YAML

Possible values are: PYTHONYAML


string
created_on Optional

action creation timestamp


string
file_data Optional

file content


string
last_updated Optional

action last update timestamp

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

201 Created

Returns RemediationAction of type application/json
{
    "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"
}
string
action_name Required

Name of the remediation action


string
file_type Required

either PYTHON or YAML

Possible values are: PYTHONYAML


string
created_on Optional

action creation timestamp


string
file_data Optional

file content


string
last_updated Optional

action last update timestamp

Errors

Errors

400

Invalid Request sent by the user


404

resouce not found


500

Internal server error

Code Samples

Code Samples

cURL Command

curl -X PUT -H "Content-Type: application/json" -d '{"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"}' https://{api_host}tcsa.host.com/actions/{action_name}


Feedback

Was this page helpful?