Creating an Access Preview
Function
This API is used to create an access preview.
Authorization Information
Each account root user 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 | Definition: Unique identifier of an analyzer. You can call the ListAnalyzers API to obtain the analyzer ID. The response parameters of this API return an analyzer list. The id field of each analyzer object is the analyzer ID. Range: 1 to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| configurations | Yes | Configuration object | Definition: Preview access settings. Constraints: N/A Range: N/A Default Value: N/A |
| resource_urn | Yes | String | Definition: Unique identifier of a resource. Constraints: N/A Range: The value can contain up to 1,500 characters. Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| iam_agency | No | IAMAgency object | Definition: IAM trust agency. Constraints: N/A Range: N/A Default Value: N/A |
| obs_bucket | No | OBSBucket object | Definition: OBS bucket. Constraints: N/A Range: N/A Default Value: N/A |
| kms_cmk | No | KMSCmk object | Definition: KMS key. Constraints: N/A Range: N/A Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| trust_policy | Yes | String | Definition: JSON policy document. Constraints: N/A Range: The value contains 0 to 131,072 characters. Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| bucket_acl | No | String | Definition: String format of the bucket ACL XML file. Constraints: N/A Range: N/A Default Value: N/A |
| bucket_policy | No | String | Definition: JSON policy document. Constraints: N/A Range: The value contains 0 to 131,072 characters. Default Value: N/A |
Response Parameters
Status code: 201
| Parameter | Type | Description |
|---|---|---|
| access_preview_id | String | Definition: Unique identifier of an access preview. Range: 1 to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
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