Example #1
0
def check_data_source_create(data, **kwargs):
    b.check_data_source_unique_name(data['name'])

    if "swift" == data["type"]:
        _check_swift_data_source_create(data)

    if "hdfs" == data["type"]:
        _check_hdfs_data_source_create(data)
Example #2
0
def check_data_source_create(data, **kwargs):
    b.check_data_source_unique_name(data['name'])

    if "swift" == data["type"]:
        _check_swift_data_source_create(data)

    if "hdfs" == data["type"]:
        _check_hdfs_data_source_create(data)
Example #3
0
def check_data_source_update(data, data_source_id):
    ctx = context.ctx()
    jobs = c.API.job_execution_get_all(ctx)
    pending_jobs = [job for job in jobs if job.info["status"] == "PENDING"]
    for job in pending_jobs:
        if data_source_id in job.data_source_urls:
            raise ex.UpdateFailedException(
                _("DataSource is used in a "
                  "PENDING Job and can not be updated."))

    ds = c.API.data_source_get(ctx, data_source_id)
    if 'name' in data and data['name'] != ds.name:
        b.check_data_source_unique_name(data['name'])

    check_data = {'type': data.get('type', None) or ds.type,
                  'url': data.get('url', None) or ds.url,
                  'credentials': data.get(
                      'credentials', None) or ds.credentials}
    _check_data_source(check_data)
Example #4
0
def check_data_source_update(data, data_source_id):
    ctx = context.ctx()
    jobs = c.API.job_execution_get_all(ctx)
    pending_jobs = [job for job in jobs if job.info["status"] == "PENDING"]
    for job in pending_jobs:
        if data_source_id in job.data_source_urls:
            raise ex.UpdateFailedException(
                _("DataSource is used in a "
                  "PENDING Job and can not be updated."))

    ds = c.API.data_source_get(ctx, data_source_id)
    if 'name' in data and data['name'] != ds.name:
        b.check_data_source_unique_name(data['name'])

    check_data = {'type': data.get('type', None) or ds.type,
                  'url': data.get('url', None) or ds.url,
                  'credentials': data.get(
                      'credentials', None) or ds.credentials}
    _check_data_source_url(check_data)
Example #5
0
def check_data_source_create(data, **kwargs):
    b.check_data_source_unique_name(data['name'])
    _check_data_source_url(data)
Example #6
0
def check_data_source_create(data, **kwargs):
    b.check_data_source_unique_name(data['name'])
    _check_data_source_url(data)