Remediation Get Action

Remediation Get Action

action name.

Request
URI
GET
https://{api_host}/tcsa.host.com/remediation-rest/actions/{action_name}
COPY
Path Parameters
string
action_name
Required

action name.


Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns RemediationAction of type(s) application/json
{
    "action_name": "slack_action",
    "category": "messaging",
    "description": "send slack message for TCSA Notification",
    "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    \"notification_obj\": {}\n}\n\ndef extract_action_params(**context) -> None:\n    return context[\"params\"][\"notification_obj\"][\"Name\"] + \" Source: \" + context[\"params\"][\"notification_obj\"][\"Source\"]\n\nwith DAG(\n\tdag_id='{{tcsa.dag_name}}',\n\tschedule_interval=None,\n\tstart_date=datetime(2023,8,16),\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. extract action params into a dict\n    extract_action_params = PythonOperator(task_id='extract_action_params',\n        python_callable=extract_action_params,\n        dag=dag,\n        on_success_callback = success,\n        on_failure_callback =failure\n    )\n\n    # 2. send slack message with JIRA info and summary\n    task_post_slack = SlackAPIPostOperator(\n        task_id='task_post_slack',\n        slack_conn_id='{{tcsa.task_post_slack_conn_id}}',\n        text='{{ tcsa.slack_message }}' + ' ' + '[[ ti.xcom_pull(task_ids=[\"extract_action_params\"][0]) ]]',\n        channel='{{ tcsa.slack_channel }}',\n        on_success_callback = success,\n        on_failure_callback =failure\n    )\n\n    extract_action_params >> task_post_slack\n",
    "file_type": "PYTHON",
    "is_default": true,
    "last_updated": "27 Sep, 2023, 17:13:56 UTC",
    "parameterized": true,
    "params": [
        {
            "parameterName": "slack_message",
            "option": "mandatory"
        },
        {
            "parameterName": "slack_channel",
            "option": "mandatory"
        }
    ]
}
string
action_name
Required

Name of the remediation action

file_type
Required

either PYTHON or YAML

Possible values are : PYTHON, YAML,
string
file_data
Optional

file content

string
created_on
Optional

action creation timestamp

string
last_updated
Optional

action last update timestamp

array of object
params
Required

list of string parameterName and option, option can be mandatory or optional


400

Invalid Request sent by the user

Returns ErrorDetails of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "detailedMessage": "string"
}
string
errorCode
Required

Error code for the failed request

string
message
Required

Short summary of the error occurred

string
detailedMessage
Optional

Detailed message with probable solution


404

Cannot find requested resource

Returns ErrorDetails of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "detailedMessage": "string"
}
string
errorCode
Required

Error code for the failed request

string
message
Required

Short summary of the error occurred

string
detailedMessage
Optional

Detailed message with probable solution


500

Internal server error

Returns ErrorDetails of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "detailedMessage": "string"
}
string
errorCode
Required

Error code for the failed request

string
message
Required

Short summary of the error occurred

string
detailedMessage
Optional

Detailed message with probable solution