2016-12-29 10 views
0

AWS Kinesisで動的シャーディングを実装しようとしています。私は、PythonとAWS Kinesisを接続するためにBoto3ライブラリを使用してkinesisストリームの断片数を更新するためのサンプルPythonスクリプトを作成しました。 しかし、update_shard_countメソッドを使用すると、キネシスオブジェクト属性no update_shard_countエラーが発生します。AWS Kinesisオブジェクトには属性がありません:update_shard_count

import boto3 

client = boto3.client('kinesis',region_name='us-east-1') 
response = client.update_shard_count(
    StreamName='xyzstream', 
    TargetShardCount=2, 
    ScalingType='UNIFORM_SCALING') 

Traceback (most recent call last): File "", line 1, in AttributeError: 'Kinesis' object has no attribute 'update_shard_count'

次に、どのように私は、APIを使用してキネシスシャード数を更新することができますか?

+0

私はちょうどboto3のバージョン1.4.2でこれを試してみましたが、キネシスクライアントオブジェクトは間違い '' update_shard_count''方法があります。どのバージョンを使用していますか? – garnaat

答えて

0

あなたのBoto3をアップグレードする必要があります。私はBoto3 1.4.3を持っており、キネシスモジュールではupdate_shard_countメソッドを参照しています。次に、古いバージョンをチェックインし、そのメソッドが表示されないようにします。

>>> import boto3 
    >>> boto3.__version__ 
    '1.4.3' 
    >>> client = boto3.client('kinesis') 
    >>> client.update_shard_count 
<bound method Kinesis.update_shard_count of <botocore.client.Kinesis object at 0x7fbfb7445b90>> 

旧バージョン

>>> import boto3 
>>> boto3.__version__ 
'1.4.0' 
>>> client = boto3.client('kinesis') 
>>> client.update_shard_count 

Traceback (most recent call last): File "", line 1, in AttributeError: 'Kinesis' object has no attribute 'update_shard_count'

関連する問題