Policies Api Get Policy Pending Changes

Policies Api Get Policy Pending Changes
What a Policy publish would change

Compares the Policy's enabled rules compiled now with its published snapshot. Read-only. Requires the ADMIN or SECURITY_OPERATOR role.

Request
URI
GET
https://{api_host}/api/v1/policies/{id}/pending-changes
COPY
Path Parameters
integer
id
Required  

Policy id

id example
2

Authentication
This operation uses the following authentication methods.
Responses
200

200 OK successful response envelope. The changes pending publication for the Policy

Returns PolicyPendingChangesDto of type(s) application/json
{
    "policyId": 2,
    "policyName": "Production Policy",
    "hasUnpublishedChanges": true,
    "isNeverPublished": false,
    "hasNetChanges": true,
    "publishedVersion": 2,
    "publishedRuleCount": 6,
    "stagedRuleCount": 6,
    "changes": [
        {
            "changeType": "RULE_CHANGED",
            "ruleId": 7,
            "ruleName": "Audit Shell Spawn",
            "ruleType": "PATH_FILE_CMD",
            "action": "AUDIT",
            "isBuiltIn": false,
            "policyId": 2,
            "policyName": "Production Policy",
            "fromRevision": 1,
            "toRevision": 2,
            "fromPosition": 2,
            "toPosition": 2,
            "changedAspects": [
                "ACTION"
            ],
            "fromAction": "BLOCK",
            "toAction": "AUDIT"
        }
    ]
}
integer As int64 As int64
policyId
Required  

Identifier of the Policy

string
policyName
Required  

Current name of the Policy

boolean
hasUnpublishedChanges
Required  

The Policy's stored flag: a Rule or attachment change not yet published. It can be true while hasNetChanges is false

boolean
isNeverPublished
Required  

publishedVersion is 0 and changes is empty

boolean
hasNetChanges
Required  

True when changes is not empty. For a Policy that was never published, true when it stages at least one rule

integer As int64 As int64
publishedVersion
Required  

The Policy's published version; 0 when never published

integer As int32 As int32
publishedRuleCount
Required  

Number of rules in the Policy's published snapshot; 0 when never published

integer As int32 As int32
stagedRuleCount
Required  

Number of rules publishing the Policy would store now

array of object
changes
Required  

Differences between the Policy's published snapshot and the rules it stages now, ordered as in the Group's changes. Empty when the Policy was never published


400

400 Bad Request: INVALID_ARGUMENT when the id path variable is not a number

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


403

403 Forbidden: FORBIDDEN

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


404

404 Not Found: POLICY_NOT_FOUND

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/api/v1/policies/{id}/pending-changes