Beispiel #1
0
def create_adla_compute_policy(client,
                               account_name,
                               compute_policy_name,
                               object_id,
                               object_type,
                               resource_group_name,
                               max_dop_per_job=None,
                               min_priority_per_job=None):
    from azure.mgmt.datalake.analytics.account.models import ComputePolicyCreateOrUpdateParameters
    if not max_dop_per_job and not min_priority_per_job:
        raise CLIError(
            'Please specify at least one of --max-dop-per-job and --min-priority-per-job'
        )

    create_params = ComputePolicyCreateOrUpdateParameters(
        object_id=object_id, object_type=object_type)

    if max_dop_per_job:
        create_params.max_degree_of_parallelism_per_job = int(max_dop_per_job)

    if min_priority_per_job:
        create_params.min_priority_per_job = int(min_priority_per_job)

    return client.create_or_update(resource_group_name, account_name,
                                   compute_policy_name, create_params)
Beispiel #2
0
def create_adla_compute_policy(client, account_name, compute_policy_name, object_id, object_type,
                               resource_group_name, max_dop_per_job=None, min_priority_per_job=None):
    from azure.mgmt.datalake.analytics.account.models import ComputePolicyCreateOrUpdateParameters
    if not max_dop_per_job and not min_priority_per_job:
        raise CLIError('Please specify at least one of --max-dop-per-job and --min-priority-per-job')

    create_params = ComputePolicyCreateOrUpdateParameters(object_id=object_id,
                                                          object_type=object_type)

    if max_dop_per_job:
        create_params.max_degree_of_parallelism_per_job = int(max_dop_per_job)

    if min_priority_per_job:
        create_params.min_priority_per_job = int(min_priority_per_job)

    return client.create_or_update(resource_group_name,
                                   account_name,
                                   compute_policy_name,
                                   create_params)