Check the validity of the policy JSON
  • PDF

Check the validity of the policy JSON

  • PDF

  • Check the validity of the policy JSON.

API

  • POST /policy/validation

Request

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

Response

  • 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 field must be less than 30 characters."
    },
    {
      "type": "ERROR",
      "code": "iam.error.requiredFieldIsMissing",
      "location": "permissions",
      "message": "The required value is missing."
    }
  ]
}

Was this article helpful?

What's Next