A client library for accessing Flink Job Manager REST API
Project description
Flink SQL Gateway Python Client
A client library for accessing Flink Job Manager REST API (mostly generated by OpenAPI Generator)
Compartibility Overview
| API Versions | Compatible Flink Versions | Comment | |
|---|---|---|---|
| API V1 | flink-1.16.2 -> flink-2.1 | Allow users to submit statements to the gateway and execute. |
Usage
First, create a client:
from flink_job_manager_api import Client
from flink_job_manager_api.api.default import get_cluster_overview, get_dashboard_configuration
from flink_job_manager_api.models import DashboardConfiguration
BASE_URL = "http://localhost:8081"
# Sync Client:
with Client(BASE_URL) as client:
response: ClusterOverviewWithVersion = get_cluster_overview.sync(client=client)
print(f"Flink version: {response.flink_version}")
print(f"Flink commit: {response.flink_commit}")
print(f"Jobs cancelled: {response.jobs_cancelled}")
print(f"Jobs failed: {response.jobs_failed}")
print(f"Jobs finished: {response.jobs_finished}")
print(f"Jobs running: {response.jobs_running}")
print(f"Slots available: {response.slots_available}")
print(f"Slots free and blocked: {response.slots_free_and_blocked}")
print(f"Slots total: {response.slots_total}")
print(f"Taskmanagers: {response.taskmanagers}")
print(f"Taskmanagers blocked: {response.taskmanagers_blocked}")
# Async Client:
async with Client(BASE_URL) as client:
response = await get_dashboard_configuration.asyncio(client=client)
Advanced customizations
Developer
- Quick start
# code gen
make gen
make release
# release production
make release_production
- Manual release
# 1. test, exit if fail
cd $(rev-parse --show-toplevel)/flink-job-manager-api && pytest tests
# 2. check current version
cd $(rev-parse --show-toplevel)
cat flink-job-manager-api/pyproject.toml | grep version
version=$(cat flink-job-manager-api/pyproject.toml| grep version | cut -d '"' -f2)
# 3. tag & release
release_tag='VERSION_TO_BE_SET'
poetry -C flink-job-manager-api/flink-job-manager-api/ version $release_tag
cd $(rev-parse --show-toplevel)
git add -u
git commit -m
git tag -d $release_tag || true
git tag "release-$version"
git push origin "release-$version"
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flink_job_manager_api-1.0.2.tar.gz.
File metadata
- Download URL: flink_job_manager_api-1.0.2.tar.gz
- Upload date:
- Size: 61.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7498b5adbde2398c441ade14257eadd586b766b3e516c78b69a7b017fcaea690
|
|
| MD5 |
902c8c17407927cfbdb98bed8754221a
|
|
| BLAKE2b-256 |
1fba7434eb93dc33f08ac82a0fc41214c4e313db80190a78d161fc8b59968bab
|
Provenance
The following attestation bundles were made for flink_job_manager_api-1.0.2.tar.gz:
Publisher:
python-publish.yml on resink-ai/flink-job-manager-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flink_job_manager_api-1.0.2.tar.gz -
Subject digest:
7498b5adbde2398c441ade14257eadd586b766b3e516c78b69a7b017fcaea690 - Sigstore transparency entry: 201548406
- Sigstore integration time:
-
Permalink:
resink-ai/flink-job-manager-api@ced39bcfba757641b82f2a60c87102045d739f4a -
Branch / Tag:
refs/tags/release-1.0.2 - Owner: https://github.com/resink-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ced39bcfba757641b82f2a60c87102045d739f4a -
Trigger Event:
push
-
Statement type:
File details
Details for the file flink_job_manager_api-1.0.2-py3-none-any.whl.
File metadata
- Download URL: flink_job_manager_api-1.0.2-py3-none-any.whl
- Upload date:
- Size: 215.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0bf26b03c2b5ce71bb96ec6d873a3bbcb4a1f8b02d7bddf4300b3eefe4402d3
|
|
| MD5 |
1c9e0329e4b98611332586b867078ce6
|
|
| BLAKE2b-256 |
693a55baa565c3efbd36a1e1f4ed65a0b9f2c8614800489b5fa7ed17e49ab9d9
|
Provenance
The following attestation bundles were made for flink_job_manager_api-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on resink-ai/flink-job-manager-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flink_job_manager_api-1.0.2-py3-none-any.whl -
Subject digest:
c0bf26b03c2b5ce71bb96ec6d873a3bbcb4a1f8b02d7bddf4300b3eefe4402d3 - Sigstore transparency entry: 201548410
- Sigstore integration time:
-
Permalink:
resink-ai/flink-job-manager-api@ced39bcfba757641b82f2a60c87102045d739f4a -
Branch / Tag:
refs/tags/release-1.0.2 - Owner: https://github.com/resink-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ced39bcfba757641b82f2a60c87102045d739f4a -
Trigger Event:
push
-
Statement type: