IOMETE SDK for Python.
Project description
IOMETE SDK
This is the IOMETE SDK for Python. It provides convenient access to the IOMETE API from applications written in the Python language.
Installation
Install the package with:
pip install iomete-sdk
Usage
Spark Job API
Import and initialize the client:
from iomete_sdk import SparkJobApiClient, ClientError
WORKSPACE_ID = "<YOUR_WORKSPACE_ID>"
API_KEY = "<YOU_IOMETE_API_KEY>"
job_client = SparkJobApiClient(
workspace_id=WORKSPACE_ID,
api_key=API_KEY,
)
Create a new job:
response = job_client.create_job(payload={
"name": "job-name",
"template": {
"main_application_file": "local:///opt/spark/examples/jars/spark-examples_2.12-3.2.1-iomete.jar",
"main_class": "org.apache.spark.examples.SparkPi",
"arguments": ["10"]
}
})
job_id = response["id"]
Get jobs:
response = job_client.get_jobs()
Get job:
response = job_client.get_job(job_id=job_id)
Update job:
response = job_client.update_job(job_id=job_id, payload={
"template": {
"main_application_file": "local:///opt/spark/examples/jars/spark-examples_2.12-3.2.1-iomete.jar",
"main_class": "org.apache.spark.examples.SparkPi",
"arguments": ["10"]
}
})
Delete job:
response = job_client.delete_job(job_id=job_id)
Submit job run:
response = job_client.submit_job_run(job_id=job_id, payload={})
Cancel job run:
response = job_client.cancel_job_run(job_id=job_id, run_id=run_id)
Get Job Runs:
response = job_client.get_job_runs(job_id=job_id)
Get Job Run:
response = job_client.get_job_run(job_id=job_id, run_id=run_id)
Get Job Run Logs:
response = job_client.get_job_run_logs(job_id=job_id, run_id=run_id)
Get Job Run Metrics:
response = job_client.get_job_run_metrics(job_id=job_id, run_id=run_id)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iomete_sdk-1.0.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for iomete_sdk-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d60d1c5b0f5d12831ab0f1303c2e5b711d0d15ca9a0a5a38d8e65bd50b934139 |
|
MD5 | df5a77d5d36782cb437fd67cf1502d93 |
|
BLAKE2b-256 | 941bdcb5ad4ec90853c8f9d25b88436865bd0ade3c2cdca23c95ef48e55a0dd9 |