Edit Policy

Ops Center Protector REST API User Guide

Version
7.8.x
Audience
anonymous
Part Number
MK-99PRT005-08

Editing a resource, in this case a Policy, is very similar to creation. However the HTTP PUT method is used and the URL must point to a specific resource, rather than the resource list.

This example changes the Backup operation RPO from eight hours to one hour.

Edit Policy
curl --insecure --cookie demosession
"https://demomaster/API/7.1/master/PolicyHandler/objects/Policies/141eb140
3015408aa3e6a77e2ae1ab22" --data @editpolicy.json --header "Content-Type:
application/json" --request PUT
Edit Policy Response
{
              "classificationChains": [
                  {
                    "items": [
                      {
                        "id": 1,
                        "path": {
                          "exclude": "",
                          "include": "C:\\testdata",
                          "options": {
                              "fastIncremental": true,
                               "fineChangeDetection": false
                           }
                        },
                        "propertyName": "path",
                        "typeName": "path"
                      }
                    ]
                  }
                ],
                "createdDate": "2020-05-11T15:20:02Z",
                "description": "",
                "id": "141eb1403015408aa3e6a77e2ae1ab22",
                "modifiedDate": "2020-05-11T15:20:03Z",
                "name": "demopolicy",
                "nextClassificationId": 2,
                "nextOperationId": 2,
                "operationChains": [
                  {
                    "items": [
                      {
                        "backup": {
                          "label": "Backup",
                          "recoveryPointObjective": {
                              "period": 1,
                              "units": "eRPO_HOURS"
                           },
                            "recoveryTimeObjective": {
                                "incrementalTapeBackup": false
                            },
                            "retention": {
                                "period": 6,
                                "units": "eRETENTION_MONTHS"
                             },
                             "run": {
                                "mode": "eRUN_ANYTIME"
                              },
                              "sourceOption": {
                                  "postScriptEnabled": false,
                                  "preScriptEnabled": false,
                                  "quiesceApplications": true
                              },
                              "type": {
                                  "mode": "eTRANSFER_ASYNCHRONOUS_JOURNALED"
                              }
                            },
                            "id": 1,
                            "propertyName": "backup",
                            "typeName": "Backup",
                             "userTags": [
                             ]
                          }
                        ]
                      }
                    ],
                    "permissions": [
                       {
                          "access": "eA_READWRITE",
                          "propertyType": "pt_user",
                          "pt_user": {
                              "upn": "Administrator@master"
                           }
                        }
                      ],
                      "userTags": [
                      ],
                      "version": 2
            }
Contents of 'editpolicy.json'
{
            "classificationChains": [
              {
                  "items": [
                    {
                        "id": 1,
                        "path": {
                            "exclude": "",
                            "include": "C:\\testdata",
                            "options": {
                                "fastIncremental": true,
                                "fineChangeDetection": false
                              }
                            },
                            "propertyName": "path",
                            "typeName": "path"
                          }
                        ]
                      }
                    ],
                    "createdDate": "2020-05-11T15:20:02Z",
                    "description": "",
                    "id": "141eb1403015408aa3e6a77e2ae1ab22",
                    "modifiedDate": "2020-05-11T15:20:02Z",
                    "name": "demopolicy",
                    "nextClassificationId": 2,
                    "nextOperationId": 2,
                    "operationChains": [
                      {
                          "items": [
                              {
                                  "backup": {
                                      "label": "Backup",
                                      "recoveryPointObjective": {
                                          "period": 1,
                                          "units": "eRPO_HOURS"
                                        },
                                        "recoveryTimeObjective": {
                                            "incrementalTapeBackup": false
                                        },
                                        "retention": {
                                            "period": 6,
                                            "units": "eRETENTION_MONTHS"
                                        },
                                        "run": {
                                            "mode": "eRUN_ANYTIME"
                                        },
                                        "sourceOption": {
                                            "postScriptEnabled": false,
                                            "preScriptEnabled": false,
                                            "quiesceApplications": true
                                        },
                                        "type": {
                                            "mode": "eTRANSFER_ASYNCHRONOUS_JOURNALED"
                                         }
                                      },
                                      "id": 1,
                                      "propertyName": "backup",
                                      "typeName": "Backup",
                                      "userTags": []
                                    }
                                  ]
                                }
                             ],
                              "permissions": [
                                  {
                                      "access": "eA_READWRITE",
                                      "propertyType": "pt_user",
                                      "pt_user": {
                                          "upn": "Administrator@master"
                                  }
                              }
                            ],
                            "userTags": [],
                            "version": 1
              }