Create policy
    • PDF

    Create policy

    • PDF

    Article Summary

    This creates a policy.

    API

    • POST /policies

    Requests

    Body

    {
      "policyName": "string",
      "description": "string",
      "permissions": [
        {
          "effect": "string",
          "targets": [
            {
              "product": "string",
              "actions": [
                "string"
              ],
              "resourceNrns": [
                "string"
              ]
            }
          ]
        }
      ]
    }
    
    ParameterRequirement statusTypeRestrictionsDescription
    policyNameYstringPolicy name
    descriptionYstringPolicy description
    permissionsYarrayPermission list
    permissions.effectYstringPermission status (currently only supports Allow)
    permissions.targetsYarrayPermission target
    permissions.targets.productYstringTarget service code
    permissions.targets.actionsYarray -The following rules need to be applied according to the service-specific authority unit
    - Detailed action unit > Action name or View*, Change*
    - All views unit or All changes unit > All views: View* / All changes: Change*
    - Service units > Full authority: asterisk ( * )
    Target action
    permissions.targets.resourceNrnsYarrayIf nrn is not specified, an asterisk ( * ) must be appliedTarget resource nrns

    Responses

    • Responses
    {
      "policyId": "string",
      "policyName": "string",
      "description": "string",
      "validationResult": {
        "details": [
          {
            "code": "string",
            "location": "string",
            "message": "string",
            "type": "ERROR"
          }
        ],
        "success": true
      }
    }
    
    Parameter nameRequirement statusTypeDescription
    policyIdNstringPolicy ID
    policyNameNstringPolicy name
    descriptionNstringPolicy description
    validationResult.YobjectPolicy creation success status
    validationResult.successYbooleanPolicy creation success status
    validationResult.detailsNarrayValidity check result details
    validationResult.details.codeNstringValidity check detailed code
    validationResult.details.locationNstringValidity check location
    validationResult.details.messageNstringValidity check detailed message
    validationResult.details.typeNstringValidity check result type (INFO, WARN, ERROR), failure when ERROR is included
    • Response examples - Success
    {
      "policyId": "000000000-qwer-asdf-123456789012",
      "policyName": "policy-test",
      "description": "policy test ",
      "validationResult": {
        "success": true
      }
    }
    
    • Response examples - Failure
    {
      "validationResult": {
        "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 field is missing."
          }
        ]
      }
    }
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.