Policy Group
General Information
Policy Type
policy-group
Description
Policy Group is a container policy that groups multiple policies together. It allows organizing and managing related policies as a single unit. This policy type is currently in development and may have limited functionality.
Note: This policy type is currently under development. The implementation may be incomplete or subject to change.
Endpoints
List Policies
GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/
Add Policy
POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Update Policy
PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Delete Policy
DELETE /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
List Policies
Endpoint
GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"resultList": [
{
"apiProxy": {
"name": "MyAPI",
"requestPolicyList": [
{
"type": "policy-group",
"name": "policy-group-1",
"description": "Group of related policies",
"active": true
}
],
"responsePolicyList": [],
"errorPolicyList": []
}
}
],
"resultCount": 1
}
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/policies/" \
-H "Authorization: Bearer YOUR_TOKEN"
Add Policy
Endpoint
POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name (must match name in body) |
Request Body
Full JSON Body Example - Basic Policy Group
{
"operationMetadata": {
"targetScope": "API_PROXY",
"targetPipeline": "REQUEST",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-group",
"name": "policy-group-1",
"description": "Group of related policies",
"active": true,
"policyCondition": {
"criteria": "ALWAYS",
"rules": []
}
}
}
Request Body Fields
operationMetadata
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| targetScope | string | Yes | - | Policy scope: API_PROXY or ENDPOINT |
| targetEndpoint | string | No* | - | Endpoint path (required if targetScope=ENDPOINT) |
| targetEndpointHTTPMethod | string | No* | - | HTTP method (required if targetScope=ENDPOINT) |
| targetPipeline | string | Yes | - | Pipeline: REQUEST, RESPONSE, or ERROR |
| deploy | boolean | No | true | Whether to deploy after adding policy |
| deployTargetEnvironmentNameList | array | No | [] | List of environment names to deploy to |
| order | integer | No | null | Policy execution order (starts from 1) |
policy
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | - | Policy type: policy-group |
| name | string | Yes | - | Policy name (must match path parameter) |
| description | string | No | - | Policy description |
| active | boolean | No | true | Whether policy is active |
| policyCondition | object | No | null | Policy condition. See PolicyConditionDTO |
PolicyOperationMetadataDTO (operationMetadata)
| Field | Type | Required | Description |
|---|---|---|---|
| targetScope | string | Yes | Target scope. See EnumPolicyTargetScope |
| targetEndpoint | string | No | Target endpoint path (if targetScope is ENDPOINT) |
| targetEndpointHTTPMethod | string | No | Target endpoint HTTP method (if targetScope is ENDPOINT) |
| targetPipeline | string | Yes | Target pipeline. See EnumPolicyTargetPipeline |
| deploy | boolean | No | true |
| deployTargetEnvironmentNameList | array | No | [] |
| order | integer | No | - |
EnumPolicyTargetScope (operationMetadata.targetScope)
API_PROXY- Apply to entire API ProxyENDPOINT- Apply to specific endpointGLOBAL- Apply globally
EnumPolicyTargetPipeline (operationMetadata.targetPipeline)
REQUEST- Request pipelineRESPONSE- Response pipelineERROR- Error pipeline
PolicyConditionDTO (policyCondition)
| Field | Type | Required | Description |
|---|---|---|---|
| criteria | string | Yes | Condition criteria. See EnumConditionCriteria |
| rules | array | Yes | List of condition rules. See ConditionRuleDTO |
EnumConditionCriteria (policyCondition.criteria)
ALWAYS- Always execute policyIF_ALL_MATCH- Execute if all rules matchIF_ANY_MATCH- Execute if any rule matchesIF_NONE_MATCH- Execute if no rules match
ConditionRuleDTO (policyCondition.rules item)
See Add Policy for detailed documentation. The structure matches the ConditionRuleDTO defined in the Add Policy documentation.
Notes
- This policy type is currently under development.
- Policy Group specific fields may be added in future versions.
- Currently, Policy Group acts as a container for organizing policies.
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"resultList": null,
"resultCount": null,
"deploymentResult": {
"envName": "production",
"podName": "",
"podIp": "",
"success": true,
"detail": "",
"responseTime": 123,
"detailList": []
}
}
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/policies/policy-group-1/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationMetadata": {
"targetScope": "API_PROXY",
"targetPipeline": "REQUEST",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-group",
"name": "policy-group-1",
"description": "Group of related policies",
"active": true,
"policyCondition": {
"criteria": "ALWAYS",
"rules": []
}
}
}'
Update Policy
Endpoint
PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name (must match name in body) |
Request Body
Note: Request body structure is the same as Add Policy. All fields should be provided for update.
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"resultList": null,
"resultCount": null,
"deploymentResult": {
"envName": "production",
"podName": "",
"podIp": "",
"success": true,
"detail": "",
"responseTime": 123,
"detailList": []
}
}
Delete Policy
Endpoint
DELETE /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"resultList": null,
"resultCount": null,
"deploymentResult": {
"envName": "production",
"podName": "",
"podIp": "",
"success": true,
"detail": "",
"responseTime": 123,
"detailList": []
}
}
Notes and Warnings
-
Development Status:
- This policy type is currently under development
- Implementation may be incomplete
- Functionality may change in future versions
-
Purpose:
- Policy Group is intended to group multiple policies together
- Allows organizing and managing related policies as a single unit
- May provide additional functionality in future versions
-
Usage:
- Currently acts as a container for organizing policies
- Specific group functionality may be added later
- Check latest documentation for updates
-
Deployment: Policy changes require deployment to take effect. Set
deploy: trueinoperationMetadataor deploy manually.
Related Documentation
- List Policies - List all policies
- Add Policy - General policy addition guide
- Update Policy - General policy update guide
- Delete Policy - General policy deletion guide