def index_bucket(bucket_name, project): """ Associates a bucket with a project. Args: bucket_name: A string containing the bucket name. project: A string containing the project ID. """ bucket = riak_connection.bucket(config['METADATA_BUCKET']) obj = RiakObject(riak_connection, bucket, bucket_name) obj.content_type = 'application/json' obj.data = '{}' obj.add_index('project_bin', project) obj.store()
def index_bucket(bucket_name, project): """ Associates a bucket with a project. """ bucket = riak_connection.bucket(metadata_bucket) obj = RiakObject(riak_connection, bucket, bucket_name) obj.add_index('project', project) obj.store()