Swagger Policies examples
A PowerSC policy represents a unique collection of attributes that are collectively managed and added to the endpoints in a group. PowerSC policies reduce the administrative overhead that is required to manage security profiles in a system.
Swagger GET /policies example
- Expand the Policies section.
- Click GET /policies.
- Click Try it Out.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Click Execute.Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
Response body { "policyList": [] }
Swagger GET /policies/{policyName} example
- Expand the Policies section.
- Click GET /policies{policyName}.
- Click Try it Out.
- Enter the policy name in the policyName field.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Click Execute.Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
Response body { "compliance": { "operation": "simulate", "profileName": "Linux_CISv1.xml", "report": { "subject": "", "toList": [ "" ] }, "reportEnabled": false, "schedule": { "dayOffset": 0, "hour": 0, "minute": 0, "scheduleType": "daily", "year": 2024 }, "scheduleEnabled": true }, "complianceEnabled": true, "created": 1722612444299, "groupName": "PolTest", "owner": "user", "policyName": "test4", "updated": 1722612444299 }
Swagger POST /policies/{policyName} example
- Expand the Policies section.
- Click POST /policies{policyName}.
- Click Try it Out.
- Enter the policy name in the policyName field.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Supply the request body in the following format. The example uses an example policy
for demonstration purposes only.
{ "policyName": "test4", "groupName": "PolTest", "complianceEnabled": true, "compliance": { "operation": "simulate", "profileName": "Linux_CISv1.xml", "reportEnabled": false, "scheduleEnabled": true, "schedule": { "dayOffset": 216, "hour": 0, "minute": 0, "year": 2024, "scheduleType": "daily" } } } - Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
- Use Swagger GET /policies/{policyName} example to verify the policy.
Swagger PUT /policies/{policyName} example
- Expand the Policies section.
- Click PUT /policies{policyName}.
- Click Try it Out.
- Enter the policy name you want to edit in the policyName field.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Supply the request body in the following format.
{ "policyName": "string", "groupName": "string", "complianceEnabled": true, "compliance": { "operation": "check", "profileName": "string", "reportEnabled": true, "report": { "subject": "string", "toList": [ "string" ] }, "scheduleEnabled": true, "schedule": { "dayOffset": 0, "hour": 0, "minute": 0, "year": 0, "scheduleType": "oneTime" } } } - Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
- Use Swagger GET /policies/{policyName} example to verify the policy edits.
Swagger DELETE /policies/{policyName} example
- Expand the Policies section.
- Click DELETE /policies{policyName}.
- Click Try it Out.
- Enter the policy name you want to delete in the policyName field.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
- Use Swagger GET /policies example to verify that the policy was deleted.
Swagger POST /policies/{policyName}/associate example
- Expand the Policies section.
- Click POST /policies{policyName}/associate.
- Click Try it Out.
- Enter the policy name you want to associate with systems in the policyName field.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Specify a UID or hostname to associate with the policy in the text box. Click Add item to specify additional systems.
- Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
{ "groups": [ { "1722610444332": 1722610444332 } ] } - Use Swagger GET /policies/{policyName} example to verify the association.
Swagger POST /policies/{policyName}/disassociate example
- Expand the Policies section.
- Click POST /policies{policyName}/disassociate.
- Click Try it Out.
- Enter the policy name from which you want to exclude systems in the policyName field.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Specify a UID or hostname to exclude from the policy in the text box. Click Add item to specify additional systems.
- Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
{ "groups": [ { "1722610444334": 1722610444334 } ] } - Use Swagger GET /policies/{policyName} example to verify the exclusion.