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()
Beispiel #2
0
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()
Beispiel #3
0
 def put(self, key, data):
     obj = RiakObject(self.client, self.bucket, key=key)
     obj.data = data
     obj.store()