Run a Standard Policy

For a primer on how to Create a Policy, visit this link:

https://resources.promevo.com/knowledgebase/gpanel/tools/create-a-policy


For information on how to run a Policy via the gPanel user interface, see here:

https://resources.promevo.com/knowledgebase/gpanel/tools/run-a-policy


With the policy API endpoint, we now have the ability to run a policy via an API call.

The definitive documentation for this API endpoint is in the developer portal.  This is where you will find the technical details, such as which HTTP verb to use, and what parameters you need to provide.

https://developer.promevo.com/docs/policy-invoker/1/overview

Form your API Request

The gPanel Application can help us form our API request.  Locate the Standard policy you wish to invoke, and view the policy details by clicking the double arrows.

The Policy Details view will show two relevant pieces of information that will help you form your API call.

gPanel API 6

Visiting the docs in the developer portal shows me that this API request takes one parameter via a POST body:

gPanel API 7

Using all of this information, we can now form our request.  Be sure to plugin your own values for policyId and apikey.

Here is a sample curl command:

gPanel API 5-1

Response

A successful response (HTTP response code 2xx) means that your request was received and gPanel will run your policy.  Note, however, that a successful response from your API call does not mean that your policy ran successfully to completion.  

Your policy is being run asynchronously as a background task in gPanel.  To gain insight into the outcome of the policy execution, visit the gPanel application.