<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot create job through Jobs API in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16588#M10752</link>
    <description>&lt;P&gt;@keenan_jones7​&amp;nbsp; what's happening is that you are not sending the request body correctly. Please take a look at &lt;A href="https://docs.databricks.com/dev-tools/api/latest/jobs.html#example" alt="https://docs.databricks.com/dev-tools/api/latest/jobs.html#example" target="_blank"&gt;this documentation&lt;/A&gt;. Do you see how there is no top-level &lt;I&gt;settings&lt;/I&gt; key? You also don't need to specify the &lt;I&gt;format&lt;/I&gt; key or &lt;I&gt;creator_user_name&lt;/I&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Sep 2021 09:44:19 GMT</pubDate>
    <dc:creator>BilalAslamDbrx</dc:creator>
    <dc:date>2021-09-06T09:44:19Z</dc:date>
    <item>
      <title>Cannot create job through Jobs API</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16587#M10751</link>
      <description>&lt;P&gt;import requests import json&lt;/P&gt; 
&lt;P&gt;instance_id = 'abcd.azuredatabricks.net'&lt;/P&gt; 
&lt;P&gt;api_version = '/api/2.0' api_command = '/jobs/create' url = f"https://{instance_id}{api_version}{api_command}"&lt;/P&gt; 
&lt;P&gt;headers = {'Authorization': 'Bearer myToken'}&lt;/P&gt; 
&lt;P&gt;params = { "settings": { "name": "Test API", "new_cluster": { "cluster_name": "", "spark_version": "8.2.x-scala2.12", "spark_conf": { "spark.databricks.delta.preview.enabled": "true", "spark.sql.shuffle.partitions": "1024" }, "node_type_id": "Standard_D16s_v3", "spark_env_vars": { "PYSPARK_PYTHON": "/databricks/python3/bin/python3" }, "enable_elastic_disk": True, "azure_attributes": { "first_on_demand": 1, "availability": "ON_DEMAND_AZURE", "spot_bid_max_price": -1.0 }, "num_workers": 8 }, "email_notifications": { "no_alert_for_skipped_runs": False }, "timeout_seconds": 0, "notebook_task": { "notebook_path": "/Repos/abcd@repo.com/notebook", "base_parameters": { "start_date": "", "end_date": "", "client": "", "client_output_sa": "", "initial_telomere_load": "", "run_validation": "", "run_telomere": "" } }, "max_concurrent_runs": 1, "format": "SINGLE_TASK" }, "creator_user_name": "abcd@repo.com" }&lt;/P&gt; 
&lt;P&gt;response = requests.post(url = url, params = params, headers = headers)&lt;/P&gt; 
&lt;P&gt;print(json.dumps(json.loads(response.text), indent = 2)) &lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;I am executing the above code (with real instance id, bearer token, and paths) and keep getting the following error: 
&lt;PRE&gt;&lt;CODE&gt;{
  "error_code": "INVALID_PARAMETER_VALUE",
  "message": "Job settings must be specified."
} 
&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 14:50:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16587#M10751</guid>
      <dc:creator>keenan_jones7</dc:creator>
      <dc:date>2021-08-12T14:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create job through Jobs API</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16588#M10752</link>
      <description>&lt;P&gt;@keenan_jones7​&amp;nbsp; what's happening is that you are not sending the request body correctly. Please take a look at &lt;A href="https://docs.databricks.com/dev-tools/api/latest/jobs.html#example" alt="https://docs.databricks.com/dev-tools/api/latest/jobs.html#example" target="_blank"&gt;this documentation&lt;/A&gt;. Do you see how there is no top-level &lt;I&gt;settings&lt;/I&gt; key? You also don't need to specify the &lt;I&gt;format&lt;/I&gt; key or &lt;I&gt;creator_user_name&lt;/I&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 09:44:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16588#M10752</guid>
      <dc:creator>BilalAslamDbrx</dc:creator>
      <dc:date>2021-09-06T09:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create job through Jobs API</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16590#M10754</link>
      <description>&lt;P&gt;@keenan_jones7​&amp;nbsp;I had the same problem today.  It looks like you've copied and pasted the JSON that Databricks displays in the GUI when you select View JSON from the dropdown menu when viewing a job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to use that JSON in a request to the Jobs API, you want to use just the JSON that is the value of the settings key.  In your case, that would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{ "name": "Test API", "new_cluster": { "cluster_name": "", "spark_version": "8.2.x-scala2.12", "spark_conf": { "spark.databricks.delta.preview.enabled": "true", "spark.sql.shuffle.partitions": "1024" }, "node_type_id": "Standard_D16s_v3", "spark_env_vars": { "PYSPARK_PYTHON": "/databricks/python3/bin/python3" }, "enable_elastic_disk": True, "azure_attributes": { "first_on_demand": 1, "availability": "ON_DEMAND_AZURE", "spot_bid_max_price": -1.0 }, "num_workers": 8 }, "email_notifications": { "no_alert_for_skipped_runs": False }, "timeout_seconds": 0, "notebook_task": { "notebook_path": "/Repos/abcd@repo.com/notebook", "base_parameters": { "start_date": "", "end_date": "", "client": "", "client_output_sa": "", "initial_telomere_load": "", "run_validation": "", "run_telomere": "" } }, "max_concurrent_runs": 1, "format": "SINGLE_TASK" }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 19:49:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-create-job-through-jobs-api/m-p/16590#M10754</guid>
      <dc:creator>rAlex</dc:creator>
      <dc:date>2023-04-19T19:49:03Z</dc:date>
    </item>
  </channel>
</rss>

