

# 从 S3 Storage Lens 存储统计管理工具控制面板中删除 Amazon 资源标签
<a name="storage-lens-dashboard-delete-tags"></a>

以下示例演示如何从现有 Storage Lens 存储统计管理工具控制面板中删除 Amazon 资源标签。您可以使用 Amazon S3 控制台、Amazon Command Line Interface (Amazon CLI) 和 适用于 Java 的 Amazon SDK 删除标签。

## 使用 S3 控制台
<a name="storage-lens-groups-delete-tags-console"></a>

**从现有 Storage Lens 存储统计管理工具控制面板中删除 Amazon 资源标签**

1. 登录到 Amazon Web Services 管理控制台，然后通过以下网址打开 Amazon S3 控制台：[https://console.aws.amazon.com/s3/](https://console.amazonaws.cn/s3/)。

1. 在左侧导航窗格中，导航到 **Storage Lens 存储统计管理工具**。

1. 选择**控制面板**。

1. 选择您要查看的 Storage Lens 存储统计管理工具控制面板配置的单选按钮。然后，选择**查看控制面板配置**。

1. 在**标签**下，查看与控制面板关联的标签。

1. 选择要移除的标签旁边的**移除**。

1. 选择**保存更改**。

## 使用 Amazon CLI
<a name="storage-lens-dashboard-delete-tags-cli"></a>

以下 Amazon CLI 命令从现有的 Storage Lens 存储统计管理工具控制面板中删除 Amazon 资源标签。要使用此示例命令，请将 `user input placeholders` 替换为您自己的信息。

**Example**  

```
aws s3control delete-storage-lens-configuration-tagging --account-id=222222222222 --config-id=your-configuration-id --region=us-east-1
```

## 使用适用于 Java 的 Amazon SDK
<a name="storage-lens-dashboard-delete-tags-sdk-java"></a>

以下适用于 Java 的 Amazon SDK 示例使用您在账户 `111122223333` 中指定的 Amazon 资源名称（ARN），从 Storage Lens 存储统计管理工具控制面板中删除 Amazon 资源标签。要使用此示例，请将 `user input placeholders` 替换为您自己的信息。

**Example – 删除 S3 Storage Lens 存储统计管理工具控制面板配置的标签**  

```
package aws.example.s3control;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.s3control.AWSS3Control;
import com.amazonaws.services.s3control.AWSS3ControlClient;
import com.amazonaws.services.s3control.model.DeleteStorageLensConfigurationTaggingRequest;

import static com.amazonaws.regions.Regions.US_WEST_2;

public class DeleteDashboardTagging {

    public static void main(String[] args) {
        String configurationId = "ConfigurationId";
        String sourceAccountId = "111122223333";
        try {
            AWSS3Control s3ControlClient = AWSS3ControlClient.builder()
                    .withCredentials(new ProfileCredentialsProvider())
                    .withRegion(US_WEST_2)
                    .build();

            s3ControlClient.deleteStorageLensConfigurationTagging(new DeleteStorageLensConfigurationTaggingRequest()
                    .withAccountId(sourceAccountId)
                    .withConfigId(configurationId)
            );
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 couldn't process
            // it and returned an error response.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3.
            e.printStackTrace();
        }
    }
}
```