【问题标题】:Creating a Cluster using boto in AWS Reshift在 AWS Redshift 中使用 boto 创建集群
【发布时间】:2013-09-30 06:03:59
【问题描述】:
obj = boto.redshift.layer1.RedshiftConnection()
obj.create_cluster(
    cluster_identifier='bototest',
    node_type='dw.hsl.xlarge',
    master_username='suresh',
    master_user_password='Suresh123',
    db_name='dev',
    cluster_type='single-node',
    cluster_security_groups='None',
    vpc_security_group_ids='None',
    cluster_subnet_group_name='None',
    availability_zone='us-east-1',
    preferred_maintenance_window='None',
    cluster_parameter_group_name='None',
    automated_snapshot_retention_period='None',
    port=5439,
    cluster_version='None',
    allow_version_upgrade='None',
    number_of_nodes=1,
    publicly_accessible='None',
    encrypted='None')

为什么会出现这个错误?

File "/usr/local/lib/python2.7/dist-packages/boto-2.13.3-py2.7.egg/boto/redshift/layer1.py", line 577, in create_cluster
    path='/', params=params)
File "/usr/local/lib/python2.7/dist-packages/boto-2.13.3-py2.7.egg/boto/redshift/layer1.py", line 2189, in _make_request
    body=json_body)
**boto.exception.JSONResponseError: JSONResponseError: 400 Bad Request**
{u'RequestId': u'76d9f16d-2994-11e3-85df-a5bac8eed36b', u'Error': {u'Message': u'boolean must follow xsd1.1 definition', u'Code': u'MalformedInput', u'Type': u'Sender'}}

【问题讨论】:

    标签: python amazon-web-services boto amazon-redshift


    【解决方案1】:

    参数allow_version_upgradepublicly_accessibleencrypted 期望bool 值,TrueFalse。您正在传递一个包含值 None 的字符串。此外,对于cluster_version,您还传递了一个包含值 None 而不是特殊常量 None 的字符串。

    create_cluster 方法的在线文档非常完整。你可以在这里找到它们:http://docs.pythonboto.org/en/latest/ref/redshift.html#boto.redshift.layer1.RedshiftConnection.create_cluster

    【讨论】:

      猜你喜欢
      • 2018-11-04
      • 2013-03-21
      • 2020-08-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-02
      • 2020-01-19
      • 2021-07-08
      • 1970-01-01
      相关资源
      最近更新 更多