Create Policy

Ops Center Protector REST API User Guide

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

A Policy is used to define the data classification and the operation to apply to it. Here the “Path” classification is used to specify the path “C:\testdata” which using the Backup operation will be backed up with an RPO of eight hours.

Policy creation is done immediately and the response contains the created policy details.

Create Policy
curl --insecure --cookie demosession
"https://demomaster/API/7.1/master/PolicyHandler/objects/Policies" --data
@createpolicy.json --header "Content-Type: application/json"
Create 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:02Z",
            "name": "demopolicy",
            "nextClassificationId": 2,
            "nextOperationId": 2,
            "operationChains": [
              {
                  "items": [
                     {
                        "backup": {
                            "label": "Backup",
                            "recoveryPointObjective": {
                                "period": 8,
                                "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
               }
Contents of 'createpolicy.json'
{
            "classificationChains": [
            {
                "items": [
                    {
                        "category": "Data",
                        "displayName": "Path",
                        "normalizedTypeName": "path",
                        "path": {
                            "exclude": "",
                            "include": "C:\\testdata",
                            "options": {
                                "fastIncremental": true,
                                "fineChangeDetection": false
                              }
                          },
                          "propertyName": "path",
                          "typeName": "path"
                        }
                      ]
                    }
                  ],
                  "description": "",
                  "name": "demopolicy",
                  "operationChains": [
                     {
                        "items": [
                          {
                              "backup": {
                                  "label": "Backup",
                                  "recoveryPointObjective": {
                                       "period": 8,
                                        "units": "eRPO_HOURS"
                                   },
                                   "recoveryTimeObjective": {
                                       "incrementalTapeBackup": false
                                    },
                                    "retention": {
                                        "period": 6,
                                        "units": "eRETENTION_MONTHS"
                                    },
                                    "run": {
                                        "mode": "eRUN_ANYTIME",
                                         "scheduleName": ""
                                     },
                                     "sourceOption": {
                                          "postScriptEnabled": false,
                                          "preScriptEnabled": false,
                                          "quiesceApplications": true
                                     },
                                      "type": {
                                          "mode": "eTRANSFER_ASYNCHRONOUS_JOURNALED"
                                      }
                                    },
                                    "category": "Standard",
                                    "displayName": "Backup",
                                    "normalizedTypeName": "backup",
                                    "propertyName": "backup",
                                    "typeName": "Backup"
                                  }
                                ]
                              }
                          ]
                     }