Checking policy validity
- Print
- PDF
Checking policy validity
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
This checks the validity of the policy JSON.
API
- POST /policy/validation
Requests
Body
{
"policyName": "string",
"description": "string",
"permissions": [
{
"effect": "string",
"targets": [
{
"product": "string",
"actions": [
"string"
],
"resourceNrns": [
"string"
]
}
]
}
]
}
Parameter | Requirement status | Type | Restrictions | Description |
---|---|---|---|---|
policyName | Y | string | Policy name | |
description | Y | string | Policy description | |
permissions | Y | array | Permission list | |
permissions.effect | Y | string | Permission status (currently only supports Allow) | |
permissions.targets | Y | array | Permission target | |
permissions.targets.product | Y | string | Target product code | |
permissions.targets.actions | Y | array | Target action | |
permissions.targets.resourceNrns | Y | array | Target resource nrns |
Responses
- Response
{
"success": true,
"details": [
{
"code": "string",
"location": "string",
"message": "string",
"type": "string"
}
]
}
Parameter name | Requirement status | Type | Description |
---|---|---|---|
success | Y | boolean | Validity check success status |
details | N | array | Validity check result details |
details.code | N | string | Validity check detailed code |
details.location | N | string | Validity check location |
details.message | N | string | Validity check detailed message |
details.type | N | string | Validity check result type (INFO, WARN, ERROR), validity check failure when ERROR is included |
- Response example - Success
{
"success": true
}
- Response example - Failure
{
"success": false,
"details": [
{
"type": "ERROR",
"code": "iam.policy.invalidName.length.max",
"location": "policyName",
"message": "Policy name should be shorter than 30 characters."
},
{
"type": "ERROR",
"code": "iam.error.requiredFieldIsMissing",
"location": "permissions",
"message": "Reguired input value is missing."
}
]
}
Was this article helpful?