

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Quick Sight 处理 Quick Sight 主题 APIs
<a name="topic-cli-examples"></a>

以下示例创建了一个新主题。

```
aws quicksight create-topic
--aws-account-id AWSACCOUNTID
--topic-id TOPICID
--topic TOPIC
```

您也可以使用带有以下命令的 CLI 框架文件来创建新主题。有关 CLI 框架文件的更多信息，请参阅 *Amazon Quick Sight 开发人员指南*中的[使用 CLI 框架文件](https://docs.aws.amazon.com/quicksight/latest/developerguide/cli-skeletons.html)。

```
aws quicksight create-topic
--cli-input-json file://createtopic.json
```

创建新主题时，数据集刷新配置不会复制到该主题中。要为新主题设置主题刷新计划，您可以调用 `create-topic-refresh-schedule` API。有关使用 CLI 配置主题刷新计划的更多信息，请参阅 [使用 Quick Sight CLI 配置 Quick Sight 主题刷新计划](topic-refresh-apis.md)。

创建第一个主题后，您可以更新、删除、列出或请求主题摘要。

以下示例更新了主题。

```
aws quicksight update-topic
--aws-account-id AWSACCOUNTID
--topic-id TOPICID
--topic TOPIC
```

您也可以使用带有以下命令的 CLI 框架文件来更新主题。有关 CLI 框架文件的更多信息，请参阅 *Amazon Quick Sight 开发人员指南*中的[使用 CLI 框架文件](https://docs.aws.amazon.com/quicksight/latest/developerguide/cli-skeletons.html)。

```
aws quicksight update-topic
--cli-input-json file://updatetopic.json
```

以下示例提供了 Quick 账户中所有主题的列表。

```
aws quicksight list-topics 
--aws-account-id AWSACCOUNTID
```

以下示例删除了一个主题。

```
aws quicksight delete-topic 
--aws-account-id AWSACCOUNTID 
--topic-id TOPICID
```

以下示例提供了有关如何配置主题的信息。

```
aws quicksight describe-topic 
--aws-account-id AWSACCOUNTID 
--topic-id TOPICID
```

以下命令更新主题的权限。

```
aws quicksight update-topic-permissions
--aws-account-id AWSACCOUNTID
--topic-id TOPICID
--grant-permissions Principal=arn:aws:quicksight:us-east-1:AWSACCOUNTID:user/default/USERNAME,Actions=quicksight:DescribeTopic
--revoke-permissions Principal=arn:aws:quicksight:us-east-1:AWSACCOUNTID:user/default/USERNAME,Actions=quicksight:DescribeTopic
```

使用`grant-permissions`参数向 Quick 账户用户授予读取和作者权限。要向账户用户授予读取权限，请输入以下值：`"quicksight:DescribeTopic"`。要向账户用户授予权限，请输入以下值：
+ `"quicksight:DescribeTopic"`
+ `"quicksight:DescribeTopicRefresh"`
+ `"quicksight:ListTopicRefreshSchedules"`
+ `"quicksight:DescribeTopicRefreshSchedule"`
+ `"quicksight:DeleteTopic"`
+ `"quicksight:UpdateTopic"`
+ `"quicksight:CreateTopicRefreshSchedule"`
+ `"quicksight:DeleteTopicRefreshSchedule"`
+ `"quicksight:UpdateTopicRefreshSchedule"`
+ `"quicksight:DescribeTopicPermissions"`
+ `"quicksight:UpdateTopicPermissions"`

`RevokePermissions` 参数撤销授予账户用户的所有权限。

以下命令描述了来自主题的所有权限。

```
aws quicksight describe-topic-permissions 
--aws-account-id AWSACCOUNTID
--topic-id TOPICID
```

创建 Quick Sight 主题后，您可以使用 Amazon Quick Sight APIs [配置主题刷新计划](https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-refresh-apis)、在账户[内或账户之间迁移 Quick Sight 主题](https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-walkthroughs)以及[创建已审核的答案](https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-reviewed-answer-apis)。