Esempio n. 1
0
def storage_create(account):
    bucket = account.get_bucket(full_path=False)
    project.initialize(_project=CLOUD_PROJECT, _service=CLOUD_SERVICE)
    bucket_create('service', CLOUD_PROJECT, bucket)
    bucket_access('service',
                  CLOUD_PROJECT,
                  bucket,
                  'OWNER',
                  emails=[account.email])
Esempio n. 2
0
def bucket():
    if project.verbose: print "BUCKET", project.task['bucket']

    # create bucket
    bucket_create(project.task['auth'], project.id, project.task['bucket'])
    bucket_access(project.task['auth'],
                  project.id,
                  project.task['bucket'],
                  emails=project.task.get('emails', []),
                  groups=project.task.get('groups', []))
Esempio n. 3
0
def storage(request):
    bucket = request.user.get_bucket(full_path=False)

    # create and permission bucket ( will do nothing if it exists )
    project.initialize(_project=CLOUD_PROJECT, _service=CLOUD_SERVICE)
    bucket_create('service', CLOUD_PROJECT, bucket)
    bucket_access('service',
                  CLOUD_PROJECT,
                  bucket,
                  'OWNER',
                  emails=[request.user.email])

    return HttpResponseRedirect(request.user.get_bucket())
Esempio n. 4
0
def bucket(config, task):
  if config.verbose:
    print('BUCKET', task['bucket'])

  bucket_create(
    config,
    task['auth'],
    config.project,
    task['bucket']
  )

  bucket_access(
    config,
    task['auth'],
    config.project,
    task['bucket'],
    emails=task.get('emails', []),
    groups=task.get('groups', [])
  )