All Products
Search
Document Center

Resource Access Management:DecodeDiagnosticMessage

Last Updated:Mar 11, 2024

Decodes the diagnostic information in the response that contains an access denied error. The error is caused by no RAM permissions.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ram:DecodeDiagnosticMessageRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EncodedDiagnosticMessagestringNo

The encoded diagnostic information in the response that contains an access denied error. The error is caused by no RAM permissions.

AQEAAAAAZBgxr0U1MjA1NTM1LUM4BBktMzE5RS1CODgxLUU1QTI0RDNFQTM1****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

D2331703-AADF-5564-BA9B-26CD51A33BA0
DecodedDiagnosticMessageobject

The decoded diagnostic information.

ExplicitDenyboolean

Indicates whether the access denied error is caused by an explicit deny.

Valid values:

  • true

  • false

true
NoPermissionPolicyTypestring

The type of the policy that causes the access denied error.

Valid values:

  • AssumeRolePolicy: role-specific trust policy
  • ControlPolicy: control policy
  • AccountLevelIdentityBasedPolicy: identity-based policy at the account level
  • ResourceGroupLevelIdentityBasedPolicy: identity-based policy at the resource group level
  • SessionPolicy: session policy
AccountLevelIdentityBasedPolicy
AuthActionstring

The operation that is used for authentication in the request.

ram:DecodeDiagnosticMessage
AuthResourcestring

The resource that is used for authentication in the request.

*
AuthPrincipalobject

The operator that is used for authentication in the request.

AuthPrincipalTypestring

The identity type that is used for authentication in the request.

Valid values:

  • SubUser: RAM user
  • AssumedRoleUser: RAM role
  • Federated: SSO federated identity
SubUser
AuthPrincipalOwnerIdstring

The ID of the Alibaba Cloud account to which the identity belongs.

196813200012****
AuthPrincipalDisplayNamestring

The identity.

  • If the operator is a RAM user, the ID of the user is displayed.
  • If the operator is a RAM role, the name and session name of the role are displayed. Example: RoleName:RoleSessionName.
  • If the operator is an SSO federated identity, the type and name of the identity provider (IdP) are displayed. Example: saml-provider/AzureAD.
28877424437521****
AuthConditionsobject []

The conditions that are used for authentication in the request.

ConditionKeystring

The key of the condition.

acs:SourceIp
ConditionValuesarray

The values that correspond to the key.

string

The value that corresponds to the key.

172.16.215.218
MatchedPoliciesobject []

The policies that are matched.

Effectstring

The effect of the policy.

Valid values:

  • Deny

  • Allow

Deny
PolicyIdentifierstring

The identifier of the policy.

  • Control policy: the ID of the control policy
  • RAM policy: the name of the policy
MyPolicyName
PolicyTypestring

The type of the policy.

Valid values:

  • Custom: custom policy
  • System: system policy
Custom
PolicyVersionstring

The version number of the policy.

Note Only custom policies have version numbers.
v1
AttachedEntityTypestring

The type of the entity to which the policy is attached.

Valid values:

  • RamUser: RAM user
  • RamRole: RAM role
  • ResourceDirectoryTarget: entity in a resource directory
  • RamGroup: RAM user group
RamUser
AttachedScopestring

The authorization scope of the policy.

Valid values:

  • Account: Alibaba Cloud account
  • Folder: folder in the resource directory
  • ResourceGroup: resource group
Account

Examples

Sample success responses

JSONformat

{
  "RequestId": "D2331703-AADF-5564-BA9B-26CD51A33BA0",
  "DecodedDiagnosticMessage": {
    "ExplicitDeny": true,
    "NoPermissionPolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthAction": "ram:DecodeDiagnosticMessage",
    "AuthResource": "*",
    "AuthPrincipal": {
      "AuthPrincipalType": "SubUser",
      "AuthPrincipalOwnerId": "196813200012****",
      "AuthPrincipalDisplayName": "28877424437521****"
    },
    "AuthConditions": [
      {
        "ConditionKey": "acs:SourceIp",
        "ConditionValues": [
          "172.16.215.218"
        ]
      }
    ],
    "MatchedPolicies": [
      {
        "Effect": "Deny",
        "PolicyIdentifier": "MyPolicyName",
        "PolicyType": "Custom",
        "PolicyVersion": "v1",
        "AttachedEntityType": "RamUser",
        "AttachedScope": "Account"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError message
400NotSupportThis method can only be invoked by customer, sub user and assumed role user.
400EncodedMessageExpireThe EncodedDiagnosticMessage is expired.
403NoPermissionYou do not have the required permissions.
404SearchInaccurateThe search result is inaccurate, please retry later.
404EntityNotExistThe specific DecodedDiagnosticMessage cannot be found.
429TooManyRequestsToo many search requests at same time, please retry later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-06-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 429