Esempio n. 1
0
def get_kinesis_streams(filter=".*", pool={}, env=None, region=None):
    if MOCK_OBJ:
        return []
    result = []
    try:
        kinesis_client = _connect("kinesis", region=region)
        out = kinesis_client.list_streams()
        for name in out["StreamNames"]:
            if re.match(filter, name):
                details = kinesis_client.describe_stream(StreamName=name)
                arn = details["StreamDescription"]["StreamARN"]
                stream = KinesisStream(arn)
                pool[arn] = stream
                stream.shards = get_kinesis_shards(stream_details=details, env=env, region=region)
                result.append(stream)
    except Exception:
        pass
    return result
def get_kinesis_streams(filter='.*', pool={}, env=None):
    if MOCK_OBJ:
        return []
    result = []
    try:
        out = cmd_kinesis('list-streams', env)
        out = json.loads(out)
        for name in out['StreamNames']:
            if re.match(filter, name):
                details = cmd_kinesis('describe-stream --stream-name %s' % name, env=env)
                details = json.loads(details)
                arn = details['StreamDescription']['StreamARN']
                stream = KinesisStream(arn)
                pool[arn] = stream
                stream.shards = get_kinesis_shards(stream_details=details, env=env)
                result.append(stream)
    except socket.error:
        pass
    return result
Esempio n. 3
0
def get_kinesis_streams(filter='.*', pool={}, env=None):
    if MOCK_OBJ:
        return []
    result = []
    try:
        out = cmd_kinesis('list-streams', env)
        out = json.loads(out)
        for name in out['StreamNames']:
            if re.match(filter, name):
                details = cmd_kinesis('describe-stream --stream-name %s' % name, env=env)
                details = json.loads(details)
                arn = details['StreamDescription']['StreamARN']
                stream = KinesisStream(arn)
                pool[arn] = stream
                stream.shards = get_kinesis_shards(stream_details=details, env=env)
                result.append(stream)
    except socket.error:
        pass
    return result
Esempio n. 4
0
def get_kinesis_streams(filter='.*', pool={}, env=None):
    if MOCK_OBJ:
        return []
    result = []
    try:
        kinesis_client = aws_stack.connect_to_service('kinesis')
        out = kinesis_client.list_streams()
        for name in out['StreamNames']:
            if re.match(filter, name):
                details = kinesis_client.describe_stream(StreamArn=name)
                arn = details['StreamDescription']['StreamARN']
                stream = KinesisStream(arn)
                pool[arn] = stream
                stream.shards = get_kinesis_shards(stream_details=details,
                                                   env=env)
                result.append(stream)
    except Exception:
        pass
    return result