def get_kinesis_shards(stream_name=None, stream_details=None, env=None): if not stream_details: out = cmd_kinesis('describe-stream --stream-name %s' % stream_name, env) stream_details = json.loads(out) shards = stream_details['StreamDescription']['Shards'] result = [] for s in shards: shard = KinesisShard(s['ShardId']) shard.start_key = s['HashKeyRange']['StartingHashKey'] shard.end_key = s['HashKeyRange']['EndingHashKey'] result.append(shard) return result
def get_kinesis_shards(stream_name=None, stream_details=None, env=None, region=None): if not stream_details: kinesis_client = _connect("kinesis", env=env, region=region) stream_details = kinesis_client.describe_stream(StreamName=stream_name) shards = stream_details["StreamDescription"]["Shards"] result = [] for s in shards: shard = KinesisShard(s["ShardId"]) shard.start_key = s["HashKeyRange"]["StartingHashKey"] shard.end_key = s["HashKeyRange"]["EndingHashKey"] result.append(shard) return result
def get_kinesis_shards(stream_name=None, stream_details=None, env=None): if not stream_details: kinesis_client = aws_stack.connect_to_service('kinesis') out = kinesis_client.describe_stream(StreamArn=stream_name) shards = out['StreamDescription']['Shards'] result = [] for s in shards: shard = KinesisShard(s['ShardId']) shard.start_key = s['HashKeyRange']['StartingHashKey'] shard.end_key = s['HashKeyRange']['EndingHashKey'] result.append(shard) return result
def get_kinesis_shards(stream_name=None, stream_details=None, env=None, region=None): if not stream_details: kinesis_client = _connect('kinesis', env=env, region=region) stream_details = kinesis_client.describe_stream(StreamName=stream_name) shards = stream_details['StreamDescription']['Shards'] result = [] for s in shards: shard = KinesisShard(s['ShardId']) shard.start_key = s['HashKeyRange']['StartingHashKey'] shard.end_key = s['HashKeyRange']['EndingHashKey'] result.append(shard) return result