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

Remediation Create Policy

Description

This API is used for creating a new remediation rule. Fields “created_on” and “last_updated” are read-only and can’t be updated. Any missing non mandatory field in udpate request, will be set to default values.

Request

Request

URL

URL


post
https://{api_host}tcsa.host.com/policy/{policy_name}
Copy

Path Parameters

Path Parameters

string
policy_name Required

policy name.


Request Body

Request Body

RemediationPolicy of mimetype application/json Required
{
    "action_name": "slack_action",
    "events": [
        {
            "class": "KubernetesPod",
            "name": "Failed",
            "type": "event"
        }
    ],
    "policy_name": "CheckManualFilterPolicy1",
    "policy_type": "manual"
}
string
action_name Required

Name of the remediation action


string
policy_type Required

either manual or automated


array of object
events Required

JSON list of dicts containing class, name and type fields.


string
policy_name Required

remediation rule name


array of object
conditions Optional

JSON list of dicts containing propName, operation and propValue fields.


string
created_on Optional

rule creation timestamp


string
last_updated Optional

rule last update timestamp


string
action_params Optional

optional field for multi event rules

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

201 Created

Returns RemediationPolicy of type application/json
{
    "action_name": "slack_action",
    "action_params": "",
    "conditions": [
        {
            "operation": "equals",
            "propName": "Active",
            "propValue": "true"
        }
    ],
    "created_on": "21 Nov, 2022, 00:42:45 UTC",
    "description": "check servertools filterset",
    "events": [
        {
            "class": "KubernetesPod",
            "name": "Failed",
            "type": "event"
        }
    ],
    "last_updated": "21 Nov, 2022, 00:42:45 UTC",
    "policy_name": "CheckManualFilterPolicy1",
    "policy_type": "manual"
}
string
action_name Required

Name of the remediation action


string
policy_type Required

either manual or automated


array of object
events Required

JSON list of dicts containing class, name and type fields.


string
policy_name Required

remediation rule name


array of object
conditions Optional

JSON list of dicts containing propName, operation and propValue fields.


string
created_on Optional

rule creation timestamp


string
last_updated Optional

rule last update timestamp


string
action_params Optional

optional field for multi event rules

Errors

Errors

400

Invalid Request sent by the user


500

Internal server error

Code Samples

Code Samples

cURL Command

curl -X POST -H "Content-Type: application/json" -d '{"action_name":"slack_action","action_params":"","conditions":[{"operation":"equals","propName":"Active","propValue":"true"}],"created_on":"21 Nov, 2022, 00:42:45 UTC","description":"check servertools filterset","events":[{"class":"KubernetesPod","name":"Failed","type":"event"}],"last_updated":"21 Nov, 2022, 00:42:45 UTC","policy_name":"CheckManualFilterPolicy1","policy_type":"manual"}' https://{api_host}tcsa.host.com/policy/{policy_name}


Feedback

Was this page helpful?