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)
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)
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))
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))
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))
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))
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)
def test_json_cli_base_no_args(): with pytest.raises(RuntimeError): utils.json_cli_base('a', 'b', mock.Mock())