View a markdown version of this page

Gremlin 查询取消 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

Gremlin 查询取消

要获取 Gremlin 查询的状态,请使用 HTTP GETPOST 来向 https://your-neptune-endpoint:port/gremlin/status 终端节点提出请求。

Gremlin 查询取消请求参数

  • cancelQuery – 取消时必需。此参数没有相应的值。

  • queryId – 要取消的正在运行的 Gremlin 查询的 ID。

Gremlin 查询取消示例

以下是取消查询的示例。

Amazon CLI
aws neptunedata cancel-gremlin-query \ --endpoint-url https://your-neptune-endpoint:port \ --query-id "fb34cd3e-f37c-4d12-9cf2-03bb741bf54f"

有关更多信息,请参阅《命令参考》中的 cancel-gremlin- query。 Amazon CLI

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.cancel_gremlin_query( queryId='fb34cd3e-f37c-4d12-9cf2-03bb741bf54f' ) print(response)

有关其他语言(如 Java、.NET 等)的 Amazon SDK 示例,请参阅Amazon SDK

awscurl
awscurl https://your-neptune-endpoint:port/gremlin/status \ --region us-east-1 \ --service neptune-db \ --data-urlencode "cancelQuery" \ --data-urlencode "queryId=fb34cd3e-f37c-4d12-9cf2-03bb741bf54f"
注意

此示例假设您的 Amazon 证书是在您的环境中配置的。us-east-1替换为 Neptune 集群的区域。

有关awscurl与 IAM 身份验证配合使用的更多信息,请参阅使用带有临时证书的 awscurl 安全地连接到启用 IAM 身份验证的数据库集群

curl
curl https://your-neptune-endpoint:port/gremlin/status \ --data-urlencode "cancelQuery" \ --data-urlencode "queryId=fb34cd3e-f37c-4d12-9cf2-03bb741bf54f"

成功取消返回 HTTP 200 OK。