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.spark import SparkJobApiClient
from iomete_sdk.api_utils import ClientError
HOST = "<YOUR_DATAPLANE_HOST>" # https://dataplane-endpoint.example.com
API_KEY = "<YOU_IOMETE_API_KEY>"
job_client = SparkJobApiClient(
host=HOST,
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
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-2.0.0.tar.gz
(8.0 kB
view details)
Built Distribution
File details
Details for the file iomete_sdk-2.0.0.tar.gz
.
File metadata
- Download URL: iomete_sdk-2.0.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d897dfc94958923310ebfa6c447cb2c30695a22dee0562c8aff06f267040d92 |
|
MD5 | 5cb7f454c9a9f875da5630477fc02a46 |
|
BLAKE2b-256 | 475f70a13f27a1338ab4dab1b353748a9eadb7bb3ba63e8f68517bf202682904 |
File details
Details for the file iomete_sdk-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: iomete_sdk-2.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57324c6011b2b5521fbd979d9c9b0cafc98b8328139b91ae7d9c833c101e06d1 |
|
MD5 | a22400d1414061d11adc151fcb0efec9 |
|
BLAKE2b-256 | c71c1cf53bbde48b48c3d7c1736f4fd81f35ab6d82b9a5132a0766ed67ee878a |