Creating an Access Preview
Function
This API is used to create an access preview.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
AccessAnalyzer:analyzer:createPreview |
Write |
analyzer * |
g:ResourceTag/<tag-key> |
- |
- |
URI
POST /v5/analyzers/{analyzer_id}/access-previews
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
analyzer_id |
Yes |
String |
Unique identifier of an analyzer Minimum: 1 Maximum: 36 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
configurations |
Yes |
Configuration object |
Preview access settings. |
|
resource_urn |
Yes |
String |
Unique identifier of a resource. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
iam_agency |
No |
IAMAgency object |
IAM trust agency. |
|
obs_bucket |
No |
OBSBucket object |
OBS bucket. |
|
kms_cmk |
No |
KMSCmk object |
KMS key. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
trust_policy |
Yes |
String |
JSON policy document. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
access_preview_id |
String |
Unique identifier of an access preview. |
Example Requests
Creating an access preview
POST https://{hostname}/v5/analyzers/{analyzer_id}/access-previews
{
"resource_urn" : "iam::{domain_id}:agency:{agency_name}",
"configurations" : {
"iam_agency" : {
"trust_policy" : "{\"Version\":\"5.0\",\"Statement\":[{\"Condition\":{\"StringMatch\":{\"g:PrincipalOrgId\":[\"org_id\"]}},\"Action\":[\"sts:agencies:assume\",\"sts::tagSession\",\"sts::setSourceIdentity\"],\"Effect\":\"Allow\",\"Principal\":{\"IAM\":[\"dd...\"]}}]}"
}
}
}
Example Responses
Status code: 201
Created
{
"access_preview_id" : "{access_preview_id}"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot