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

Remediation Update Policy

Description

This API is used for updating a remediation rule or policy. Update API expects all parameters retrived via get API. Fields “policy_name”, “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


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

Path Parameters

Path Parameters

string
policy_name Required

Unique id, to indentify the user-preference


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
{
    "RemediationPolicy": {
        "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"
    },
    "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


404

resouce not found


500

Internal server error

Code Samples

Code Samples

cURL Command

curl -X PUT -H "Content-Type: application/json" -d '{"RemediationPolicy":{"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"},"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?