Exemple #1
0
def unsubscribe(username, table, uid):
    hbase_op.delete_row(table="Subscriptions", rowKey=username+"#"+table+"#"+uid)
    hbase_op.delete_column(table='Elements', rowKey=uid, column="subscriber:"+username)
Exemple #2
0
          object_id: the complete UID of the environment (deletes the complete data set)

          data: file identifier to delete only the corresponding file
      """

      try:
         api_key = api_keys.objects.get(key__exact=api_key)
         if not User.objects.get(username__exact=api_key.username).is_active:
            raise         
      except Exception, e:
         return rc.BAD_REQUEST


      object_ = transaction.get(query=object_id, format="json", exact=True)
      if not object_:
         return rc.NOT_HERE
      if User.objects.get(username__exact=api_key.username).username != object_[0]['author']:
         return rc.BAD_REQUEST

      try:
         if data:
            file_type = data
            hdfs_op.rm_file(object_[0]["files"][file_type]["url"].replace(roboearth.BINARY_ROOT, roboearth.UPLOAD_DIR))
            hbase_op.delete_column("Elements", object_id, 'file:'+file_type)
         else:
            hbase_op.delete_row("Elements", object_id)
      except Exception, e:
         return rc.NOT_HERE

      return rc.DELETED
Exemple #3
0
def unsubscribe(username, table, uid):
    hbase_op.delete_row(table="Subscriptions",
                        rowKey=username + "#" + table + "#" + uid)
    hbase_op.delete_column(table='Elements',
                           rowKey=uid,
                           column="subscriber:" + username)