本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Gremlin 查询取消
要获取 Gremlin 查询的状态,请使用 HTTP GET 或 POST 来向 https://your-neptune-endpoint:port/gremlin/status 终端节点提出请求。
Gremlin 查询取消请求参数
Gremlin 查询取消示例
以下是取消查询的示例。
- AWS CLI
-
aws neptunedata cancel-gremlin-query \
--endpoint-url https://your-neptune-endpoint:port \
--query-id "fb34cd3e-f37c-4d12-9cf2-03bb741bf54f"
有关更多信息,请参阅《命令参考》中的 cancel-gremlin- query。 AWS 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 等)的 AWS SDK 示例,请参阅AWS 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"
此示例假设您的 AWS 证书是在您的环境中配置的。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。