# 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:
```bash
pip install iomete-sdk
```
## Usage
### Spark Job API
Import and initialize the client:
```python
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:
```python
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:
```python
response = job_client.get_jobs()
```
Get job:
```python
response = job_client.get_job(job_id=job_id)
```
Update job:
```python
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:
```python
response = job_client.delete_job(job_id=job_id)
```
Submit job run:
```python
response = job_client.submit_job_run(job_id=job_id, payload={})
```
Cancel job run:
```python
response = job_client.cancel_job_run(job_id=job_id, run_id=run_id)
```
Get Job Runs:
```python
response = job_client.get_job_runs(job_id=job_id)
```
Get Job Run:
```python
response = job_client.get_job_run(job_id=job_id, run_id=run_id)
```
Get Job Run Logs:
```python
response = job_client.get_job_run_logs(job_id=job_id, run_id=run_id)
```
Get Job Run Metrics:
```python
response = job_client.get_job_run_metrics(job_id=job_id, run_id=run_id)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/iomete/iomete-sdk",
"name": "iomete-sdk",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "iomete,sdk,spark-job,data-security-api",
"author": "IOMETE",
"author_email": "vusal@iomete.com",
"download_url": "https://files.pythonhosted.org/packages/47/5f/70a13f27a1338ab4dab1b353748a9eadb7bb3ba63e8f68517bf202682904/iomete_sdk-2.0.0.tar.gz",
"platform": null,
"description": "# IOMETE SDK\n\nThis is the IOMETE SDK for Python. \nIt provides convenient access to the IOMETE API from applications written in the Python language.\n\n## Installation\n\nInstall the package with:\n\n```bash\npip install iomete-sdk\n```\n\n## Usage\n\n### Spark Job API\n\nImport and initialize the client:\n```python\nfrom iomete_sdk.spark import SparkJobApiClient\nfrom iomete_sdk.api_utils import ClientError\n\nHOST = \"<YOUR_DATAPLANE_HOST>\" # https://dataplane-endpoint.example.com\nAPI_KEY = \"<YOU_IOMETE_API_KEY>\"\n\njob_client = SparkJobApiClient(\n host=HOST,\n api_key=API_KEY,\n)\n```\n\nCreate a new job:\n```python\nresponse = job_client.create_job(payload={\n \"name\": \"job-name\",\n \"template\": {\n \"main_application_file\": \"local:///opt/spark/examples/jars/spark-examples_2.12-3.2.1-iomete.jar\",\n \"main_class\": \"org.apache.spark.examples.SparkPi\",\n \"arguments\": [\"10\"]\n }\n })\n\njob_id = response[\"id\"]\n```\n\nGet jobs:\n```python\nresponse = job_client.get_jobs()\n```\n\nGet job:\n```python\nresponse = job_client.get_job(job_id=job_id)\n```\n\nUpdate job:\n```python\nresponse = job_client.update_job(job_id=job_id, payload={\n \"template\": {\n \"main_application_file\": \"local:///opt/spark/examples/jars/spark-examples_2.12-3.2.1-iomete.jar\",\n \"main_class\": \"org.apache.spark.examples.SparkPi\",\n \"arguments\": [\"10\"]\n }\n })\n```\n\nDelete job:\n```python\nresponse = job_client.delete_job(job_id=job_id)\n```\n\n\nSubmit job run:\n```python\nresponse = job_client.submit_job_run(job_id=job_id, payload={})\n```\n\nCancel job run:\n```python\nresponse = job_client.cancel_job_run(job_id=job_id, run_id=run_id)\n```\n\nGet Job Runs:\n```python\nresponse = job_client.get_job_runs(job_id=job_id)\n```\n\nGet Job Run:\n```python\nresponse = job_client.get_job_run(job_id=job_id, run_id=run_id)\n```\n\nGet Job Run Logs:\n```python\nresponse = job_client.get_job_run_logs(job_id=job_id, run_id=run_id)\n```\n\nGet Job Run Metrics:\n```python\nresponse = job_client.get_job_run_metrics(job_id=job_id, run_id=run_id)\n```\n\n\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "IOMETE SDK for Python.",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/iomete/iomete-sdk"
},
"split_keywords": [
"iomete",
"sdk",
"spark-job",
"data-security-api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c71c1cf53bbde48b48c3d7c1736f4fd81f35ab6d82b9a5132a0766ed67ee878a",
"md5": "a22400d1414061d11adc151fcb0efec9",
"sha256": "57324c6011b2b5521fbd979d9c9b0cafc98b8328139b91ae7d9c833c101e06d1"
},
"downloads": -1,
"filename": "iomete_sdk-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a22400d1414061d11adc151fcb0efec9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5873,
"upload_time": "2023-10-22T13:58:06",
"upload_time_iso_8601": "2023-10-22T13:58:06.936682Z",
"url": "https://files.pythonhosted.org/packages/c7/1c/1cf53bbde48b48c3d7c1736f4fd81f35ab6d82b9a5132a0766ed67ee878a/iomete_sdk-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "475f70a13f27a1338ab4dab1b353748a9eadb7bb3ba63e8f68517bf202682904",
"md5": "5cb7f454c9a9f875da5630477fc02a46",
"sha256": "7d897dfc94958923310ebfa6c447cb2c30695a22dee0562c8aff06f267040d92"
},
"downloads": -1,
"filename": "iomete_sdk-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "5cb7f454c9a9f875da5630477fc02a46",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7960,
"upload_time": "2023-10-22T13:58:09",
"upload_time_iso_8601": "2023-10-22T13:58:09.938331Z",
"url": "https://files.pythonhosted.org/packages/47/5f/70a13f27a1338ab4dab1b353748a9eadb7bb3ba63e8f68517bf202682904/iomete_sdk-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-22 13:58:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "iomete",
"github_project": "iomete-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "iomete-sdk"
}