示例#1
0
def create_cli(json_file, json):
    """
    Creates a Databricks cluster.

    The specification for the request json can be found at
    https://docs.databricks.com/api/latest/clusters.html#create
    """
    json_cli_base(json_file, json, create_cluster)
示例#2
0
def create_cli(json_file, json):
    """
    Creates a job.

    The specification for the json option can be found
    https://docs.databricks.com/api/latest/jobs.html#create
    """
    json_cli_base(json_file, json, create_job)
示例#3
0
def submit_cli(api_client, json_file, json):
    """
    Submits a one-time run.

    The specification for the request json can be found
    https://docs.databricks.com/api/latest/jobs.html#runs-submit
    """
    json_cli_base(json_file, json, lambda json: RunsApi(api_client).submit_run(json))
示例#4
0
文件: cli.py 项目: Men0x/aobd_project
def create_cli(api_client, json_file, json):
    """
    Creates a job.

    The specification for the json option can be found
    https://docs.databricks.com/api/latest/jobs.html#create
    """
    json_cli_base(json_file, json, lambda json: JobsApi(api_client).create_job(json))
示例#5
0
def create_cli(api_client, json_file, json):
    """
    Creates a Databricks instance pool.

    The specification for the request json can be found at
    https://docs.databricks.com/api/latest/instance-pools.html#create
    """
    json_cli_base(json_file, json,
                  lambda json: InstancePoolsApi(api_client).create_instance_pool(json))
示例#6
0
文件: cli.py 项目: Men0x/aobd_project
def create_cli(api_client, json_file, json):
    """
    Creates a Databricks cluster Policy.

    The specification for the request json can be found at
    https://docs.databricks.com/dev-tools/api/latest/policies.html#create
    """
    json_cli_base(
        json_file, json,
        lambda json: ClusterPolicyApi(api_client).create_cluster_policy(json))
示例#7
0
def edit_cli(api_client, json_file, json):
    """
    Edits a Databricks instance pool.

    The specification for the request json can be found at
    https://docs.databricks.com/api/latest/instance-pools.html#edit
    """
    if not bool(json_file) ^ bool(json):
        raise RuntimeError('Either --json-file or --json should be provided')
    json_cli_base(json_file, json,
                  lambda json: InstancePoolsApi(api_client).edit_instance_pool(json),
                  print_response=False)
示例#8
0
def test_json_cli_base_no_args():
    with pytest.raises(RuntimeError):
        utils.json_cli_base('a', 'b', mock.Mock())