cancel
Showing results for 
Search instead for 
Did you mean: 

icontrol - import policy create new policy instead overwriting of old one

JustJozef
Altocumulus
Altocumulus

Hello,

 

I trying to import and update of policy via icontrol but instead update of current policy new policie with suffix _number is created.

Steps what I have done:

Files has been uploaded (policy definition + swagger file) to the endpoint /mgmt/tm/asm/file-transfer/uploads/

Policy is created with:

/mgmt/tm/asm/tasks/import-policy/", '{"filename": "sp_test_api.json", "name":"sp_test_api_baseline"}'

When I changed something in swagger file and try to update policy with same steps then new policy sp_test_api_baseline_1 is created.

 

Tested with simple policy

 

{
   "policy" : {
      "applicationLanguage" : "utf-8",
      "caseInsensitive" : true,
      "description" : "",
      "enablePassiveMode" : false,
      "enforcementMode" : "transparent",
      "protocolIndependent" : false,
      "fullPath" : "/Common/sp_test_api_baseline",
      "name" : "sp_test_api_baseline",
      "softwareVersion" : "16.1.2",
      "open-api-files": [
        {
          "filename": "file://swagger.json"
        }
        ],
      "template" : {
         "name" : "POLICY_TEMPLATE_API_SECURITY"
      },
      "type" : "security"
   }
}

 

Any idea why new policy is always created?

1 ACCEPTED SOLUTION

Juergen_Mang
Cirrus
Cirrus

Try this (untested):

{
  "fileName": "sp_test_api.json",
  "policy":{
    "fullPath": "/Common/sp_test_api_baseline",
   }
}

I personally do not upload the policy, but use file references:

{
  "fileReference":{
    "link": http://webserver/policy.json
  },
  "policy":{
    "fullPath": "/Common/sp_test_api_baseline",
  }
}

 

View solution in original post

1 REPLY 1

Juergen_Mang
Cirrus
Cirrus

Try this (untested):

{
  "fileName": "sp_test_api.json",
  "policy":{
    "fullPath": "/Common/sp_test_api_baseline",
   }
}

I personally do not upload the policy, but use file references:

{
  "fileReference":{
    "link": http://webserver/policy.json
  },
  "policy":{
    "fullPath": "/Common/sp_test_api_baseline",
  }
}