Patch Policy API


This topic describes the REST APIs for the policy scans.

The base URL for the Assets API is: https://<serverName>/api/v2

POST/api/v2/policies/path-policies

Creates a new patch policy.

Request body: No parameters

Sample request 

{
   "policy_id": "string",
   "policy_name": "WindowsScanPolicy",
   "os_type": "WINDOWS",
   "is_enabled": true,
   "created_by": "BLAdmin",
   "description": "WindowsScanPolicy",
   "catalog_path": "string",
   "job_group_path": "string",
   "options": {
      "security_patches": true,
      "security_tools": true,
      "non_security_patches": true,
      "exclude_service_packs": true
   },
   "list": {
      "patch": {
         "include": [
            0
         ],
         "exclude": [
            0
         ]
      },
      "patch_group": {
         "include": [
            0
         ],
         "exclude": [
            0
         ]
      }
   },
   "asset_options": {
      "asset_groups": [
         "string"
      ],
      "assets": [
         "string"
      ]
   },
   "schedules": [
      {
         "once": {
            "datetime": "string"
         },
         "daily": {
            "time": "string"
         },
         "weekly": {
            "days": [
               "string"
            ],
            "frequency": 0,
            "time": "string"
         },
         "monthly": {
            "week_day": "string",
            "week_of_month": "string"
         },
         "interval": {
            "days": 0,
            "hours": 0,
            "minutes": 0
         },
         "timezone": "string"
      }
   ],
   "properties": {
      "prop1": "2055",
      "prop2": "windows"
   },
   "connector_type": "bsa"
}


Code

Description

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

Responses

PUT/api/v2/policies/patch-policies/{policy_id}

Updates an existing patch policy.

Request body

Parameter

Description

policy_id

Specifies a patch policy ID.

Sample request 

{
  "policy_id": "string",
  "policy_name": "WindowsScanPolicy",
  "os_type": "WINDOWS",
  "is_enabled": true,
  "created_by": "BLAdmin",
  "description": "WindowsScanPolicy",
  "catalog_path": "string",
  "job_group_path": "string",
  "options": {
    "security_patches": true,
    "security_tools": true,
    "non_security_patches": true,
    "exclude_service_packs": true
  },
  "list": {
    "patch": {
      "include": [
        0
      ],
      "exclude": [
        0
      ]
    },
    "patch_group": {
      "include": [
        0
      ],
      "exclude": [
        0
      ]
    }
  },
  "asset_options": {
    "asset_groups": [
      "string"
    ],
    "assets": [
      "string"
    ]
  },
  "schedules": [
    {
      "once": {
        "datetime": "string"
      },
      "daily": {
        "time": "string"
      },
      "weekly": {
        "days": [
          "string"
        ],
        "frequency": 0,
        "time": "string"
      },
      "monthly": {
        "week_day": "string",
        "week_of_month": "string"
      },
      "interval": {
        "days": 0,
        "hours": 0,
        "minutes": 0
      },
      "timezone": "string"
    }
  ],
  "properties": {
    "prop1": "2055",
    "prop2": "windows"
  },
  "connector_type": "bsa"
}


Responses

Code

Description

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

DELETE/api/v2/policies/patch-policies/{policy_id}

Deletes a specific patch policy.

Request body

Parameter

Description

policy_id

Specifies a patch policy ID.

 Responses

Code

Description

200

OK

204


401

Unauthorized

403

Forbidden

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Helix Automation Console 19.11