Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Latest commit

 

History

History
261 lines (221 loc) · 11.2 KB

README.md

File metadata and controls

261 lines (221 loc) · 11.2 KB

databricks-jobs

The Jobs API allows you to create, edit, and delete jobs. You should never hard code secrets or store them in plain text. Use the Secrets API to manage secrets in the Databricks CLI. Use the Secrets utility to reference secrets in notebooks and jobs.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 2.1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import databricks_jobs

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import databricks_jobs

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function

import time
import databricks_jobs
from databricks_jobs.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://<databricks-instance>/api
# See configuration.py for a list of all supported configuration parameters.
configuration = databricks_jobs.Configuration(
    host = "https://<databricks-instance>/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (api_token): bearerAuth
configuration = databricks_jobs.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with databricks_jobs.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = databricks_jobs.DefaultApi(api_client)
    jobs_create_request = databricks_jobs.JobsCreateRequest() # JobsCreateRequest | 

    try:
        # Create a new job
        api_response = api_instance.jobs_create(jobs_create_request)
        print("The response of DefaultApi->jobs_create:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DefaultApi->jobs_create: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https:///api

Class Method HTTP request Description
DefaultApi jobs_create POST /2.1/jobs/create Create a new job
DefaultApi jobs_delete POST /2.1/jobs/delete Delete a job
DefaultApi jobs_get GET /2.1/jobs/get Get a single job
DefaultApi jobs_list GET /2.1/jobs/list List all jobs
DefaultApi jobs_reset POST /2.1/jobs/reset Overwrites all settings for a job
DefaultApi jobs_run_now POST /2.1/jobs/run-now Trigger a new job run
DefaultApi jobs_runs_cancel POST /2.1/jobs/runs/cancel Cancel a job run
DefaultApi jobs_runs_cancel_all POST /2.1/jobs/runs/cancel-all Cancel all runs of a job
DefaultApi jobs_runs_delete POST /2.1/jobs/runs/delete Delete a job run
DefaultApi jobs_runs_export GET /2.0/jobs/runs/export Export and retrieve a job run
DefaultApi jobs_runs_get GET /2.1/jobs/runs/get Get a single job run
DefaultApi jobs_runs_get_output GET /2.1/jobs/runs/get-output Get the output for a single run
DefaultApi jobs_runs_list GET /2.1/jobs/runs/list List runs for a job
DefaultApi jobs_runs_repair POST /2.1/jobs/runs/repair Repair a job run
DefaultApi jobs_runs_submit POST /2.1/jobs/runs/submit Create and trigger a one-time run
DefaultApi jobs_update POST /2.1/jobs/update Partially updates a job

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: Bearer authentication (api_token)

Author