Ejemplo n.º 1
0
def dataset():
  if project.verbose:
    print('DATASET', project.id, project.task['dataset'])

  if project.task.get('delete', False):
    if project.verbose:
      print('DATASET DELETE')
    datasets_delete(
      project.task['auth'],
      project.id,
      project.task['dataset']
    )

  if project.verbose:
    print('DATASET CREATE')
  datasets_create(
    project.task['auth'],
    project.id,
    project.task['dataset']
  )

  if project.verbose:
    print('DATASET ACCESS')
  datasets_access(
    project.task['auth'],
    project.id,
    project.task['dataset'],
    emails=project.task.get('emails', []),
    groups=project.task.get('groups', [])
  )
Ejemplo n.º 2
0
def dataset():
    if project.verbose: print("DATASET", project.id, project.task['dataset'])

    # create dataset
    datasets_create(project.task['auth'], project.id, project.task['dataset'])
    datasets_access(project.task['auth'],
                    project.id,
                    project.task['dataset'],
                    emails=project.task.get('emails', []),
                    groups=project.task.get('groups', []))
Ejemplo n.º 3
0
def dataset(config, task):
    if config.verbose:
        print('DATASET', config.project, task['dataset'])

    if task.get('delete', False):
        if config.verbose:
            print('DATASET DELETE')
        # In order to fully delete a dataset, it needs to first have all tables
        # deleted, which is done with the delete_contents=True, and then the actual
        # dataset can be deleted, which is done with delete_contents=false.
        datasets_delete(config,
                        task['auth'],
                        config.project,
                        task['dataset'],
                        delete_contents=True)
        datasets_delete(config,
                        task['auth'],
                        config.project,
                        task['dataset'],
                        delete_contents=False)
    else:
        if task.get('clear', False):
            if config.project:
                print('DATASET CLEAR')
            datasets_delete(config,
                            task['auth'],
                            config.project,
                            task['dataset'],
                            delete_contents=True)

        if config.verbose:
            print('DATASET CREATE')
        datasets_create(config, task['auth'], config.project, task['dataset'])

        if config.verbose:
            print('DATASET ACCESS')
        datasets_access(config,
                        task['auth'],
                        config.project,
                        task['dataset'],
                        emails=task.get('emails', []),
                        groups=task.get('groups', []))