Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 请求路由53OMAINS API有问题_Python_Amazon Web Services_Boto3 - Fatal编程技术网

Python 请求路由53OMAINS API有问题

Python 请求路由53OMAINS API有问题,python,amazon-web-services,boto3,Python,Amazon Web Services,Boto3,访问RoutedDomains模块API时出现问题 代码: 运行结果: [] {'Domains': [], 'ResponseMetadata': {'RequestId': '2aa6e538-66e3-11e8-a89f-273ad6c882c8', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '2aa6e538-66e3-11e8-a89f-273ad6c882c8', 'content-type': 'appl

访问RoutedDomains模块API时出现问题

代码:

运行结果:

[]
{'Domains': [], 'ResponseMetadata': {'RequestId': '2aa6e538-66e3-11e8-a89f-273ad6c882c8', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '2aa6e538-66e3-11e8-a89f-273ad6c882c8', 'content-type': 'application/x-amz-json-1.1', 'content-length': '14', 'date': 'Sun, 03 Jun 2018 04:04:09 GMT'}, 'RetryAttempts': 0}}
我可以确认帐户下有多个域名(key\u id和access\u key)。 并授予足够的权限:

  • AmazonRoute53域完全访问
  • AmazonRoute53完全访问
但响应是空的

请求路由53模块api没有问题:

client = boto3.client(
        'route53',
        region_name = 'us-east-1',
        aws_access_key_id = "xxxxxxxxxxxx",
        aws_secret_access_key = "xxxxxxxxxxxx"
)
client.get_paginator('list_hosted_zones')
我的另一个帐户Route53和Route53域请求工作正常


为什么??有什么问题吗?请帮帮我,谢谢

Route53domains客户端操作列出所有域的实际语法为:

response = client.list_domains(
    Marker='string',
    MaxItems=123
)
如果与当前AWS帐户关联的域数大于为MaxItems指定的值,则可以使用标记返回其他域

有关路由53域,请参阅BOT3。谢谢您的回答

#!/usr/bin/python3.6
#encoding: utf-8
import boto3

key_id='xxxxxxxx'
access_key='xxxxxxxx'
client = boto3.client(
        'route53domains',
        aws_access_key_id = key_id,
        aws_secret_access_key = access_key,
        region_name = 'us-east-1'
)
all_domains= client.list_domains(MaxItems=123)
print(all_domains)
运行结果:

[]
{'Domains': [], 'ResponseMetadata': {'RequestId': '2aa6e538-66e3-11e8-a89f-273ad6c882c8', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '2aa6e538-66e3-11e8-a89f-273ad6c882c8', 'content-type': 'application/x-amz-json-1.1', 'content-length': '14', 'date': 'Sun, 03 Jun 2018 04:04:09 GMT'}, 'RetryAttempts': 0}}
域名为[]

对不起,我本来想问get_domain_detail()函数:

Client.get_domain_detail(DomainName="mytest.com")
但是发现使用列表_域甚至没有域名

所以,写错误

而我使用的CMD API工具仍然是相同的结果:

./aws route53domains list-domains  --max-items 123
{
    "Domains": []
}

这可能是aws帐户或背景问题。我不知道为什么。

对不起,我写错了代码,但是client.list\u域(Marker='string',MaxItems=123)不正常