A Python client for the Bacalhau public API - https://github.com/bacalhau-project/bacalhau/tree/main/clients/python
Project description
bacalhau_apiclient
This page is the reference of the Bacalhau REST API. Project docs are available at https://docs.bacalhau.org/. Find more information about Bacalhau at https://github.com/bacalhau-project/bacalhau.
This Python package is automatically generated by the Swagger Codegen project:
- API version: ${PYPI_VERSION}
- Package version: 1.2.1
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen For more information, please visit https://github.com/bacalhau-project/bacalhau
Requirements.
Python 3.6+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
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 bacalhau_apiclient
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 bacalhau_apiclient
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import bacalhau_apiclient
from bacalhau_apiclient.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = bacalhau_apiclient.ComputeNodeApi(bacalhau_apiclient.ApiClient(configuration))
try:
# Approves a job to be run on this compute node.
api_response = api_instance.api_serverapprover()
pprint(api_response)
except ApiException as e:
print("Exception when calling ComputeNodeApi->api_serverapprover: %s\n" % e)
# create an instance of the API class
api_instance = bacalhau_apiclient.ComputeNodeApi(bacalhau_apiclient.ApiClient(configuration))
try:
# Returns debug information on what the current node is doing.
api_response = api_instance.api_serverdebug()
pprint(api_response)
except ApiException as e:
print("Exception when calling ComputeNodeApi->api_serverdebug: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://bootstrap.production.bacalhau.org:1234/
Class | Method | HTTP request | Description |
---|---|---|---|
ComputeNodeApi | api_serverapprover | GET /api/v1/compute/approve | Approves a job to be run on this compute node. |
ComputeNodeApi | api_serverdebug | GET /api/v1/compute/debug | Returns debug information on what the current node is doing. |
HealthApi | debug | GET /api/v1/requester/debug | Returns debug information on what the current node is doing. |
JobApi | cancel | POST /api/v1/requester/cancel | Cancels the job with the job-id specified in the body payload. |
JobApi | events | POST /api/v1/requester/events | Returns the events related to the job-id passed in the body payload. Useful for troubleshooting. |
JobApi | list | POST /api/v1/requester/list | Simply lists jobs. |
JobApi | logs | POST /api/v1/requester/logs | Displays the logs for a current job/execution |
JobApi | results | POST /api/v1/requester/results | Returns the results of the job-id specified in the body payload. |
JobApi | states | POST /api/v1/requester/states | Returns the state of the job-id specified in the body payload. |
JobApi | submit | POST /api/v1/requester/submit | Submits a new job to the network. |
MiscApi | api_serverversion | POST /api/v1/version | Returns the build version running on the server. |
OpsApi | agentalive | GET /api/v1/agent/alive | |
OpsApi | agentdebug | GET /api/v1/agent/debug | Returns debug information on what the current node is doing. |
OpsApi | agentnode | GET /api/v1/agent/node | Returns the info of the node. |
OpsApi | agentversion | GET /api/v1/agent/version | Returns the build version running on the server. |
OrchestratorApi | orchestratorjob_executions | GET /api/v1/orchestrator/jobs/{id}/executions | Returns the executions of a job. |
OrchestratorApi | orchestratorjob_history | GET /api/v1/orchestrator/jobs/{id}/history | Returns the history of a job. |
OrchestratorApi | orchestratorjob_results | GET /api/v1/orchestrator/jobs/{id}/results | Returns the results of a job. |
OrchestratorApi | orchestratorlist_jobs | GET /api/v1/orchestrator/jobs | Returns a list of jobs. |
OrchestratorApi | orchestratorput_job | PUT /api/v1/orchestrator/jobs | Submits a job to the orchestrator. |
OrchestratorApi | orchestratorstop_job | DELETE /api/v1/orchestrator/jobs/{id} | Stops a job. |
UtilsApi | healthz | GET /api/v1/healthz | |
UtilsApi | home | GET / | |
UtilsApi | id | GET /api/v1/id | Returns the id of the host node. |
UtilsApi | livez | GET /api/v1/livez | |
UtilsApi | node_info | GET /api/v1/node_info | Returns the info of the node. |
DefaultApi | nodes | GET /api/v1/requester/nodes | Displays the nodes that this requester knows about |
Documentation For Models
- AllOfExecutionAllocatedResources
- AllOfExecutionComputeState
- AllOfExecutionDesiredState
- AllOfExecutionJob
- AllOfExecutionPublishedResult
- AllOfExecutionRunOutput
- AllOfExecutionStateDesiredState
- AllOfExecutionStatePublishedResults
- AllOfExecutionStateRunOutput
- AllOfExecutionStateState
- AllOfGPUVendor
- AllOfInputSourceSource
- AllOfJobCreatePayloadSpec
- AllOfJobSpecWasmEntryModule
- AllOfJobState
- AllOfJobStateState
- AllOfJobWithInfoJob
- AllOfJobWithInfoState
- AllOfLabelSelectorRequirementOperator
- AllOfSpecDeal
- AllOfSpecDocker
- AllOfSpecEngine
- AllOfSpecNetwork
- AllOfSpecPublisher
- AllOfSpecResources
- AllOfSpecWasm
- AllOfStateExecutionDesiredStateTypeStateType
- AllOfStateExecutionStateTypeStateType
- AllOfStateJobStateTypeStateType
- AllOfStorageSpecStorageSource
- AllOfTaskResources
- AllOflegacyCancelRequestPayload
- AllOflegacyEventsRequestFilters
- AllOflegacyLogRequestPayload
- AllOflegacySubmitRequestPayload
- AllocatedResources
- ApiGetJobResponse
- ApiGetVersionResponse
- ApiListJobExecutionsResponse
- ApiListJobHistoryResponse
- ApiListJobResultsResponse
- ApiListJobsResponse
- ApiPutJobResponse
- ApiStopJobResponse
- BuildVersionInfo
- ComputeNodeInfo
- Deal
- DebugInfo
- Engine
- EngineSpec
- Execution
- ExecutionDesiredState
- ExecutionDesiredStateType
- ExecutionState
- ExecutionStateType
- FreeSpace
- GPU
- GPUVendor
- HealthInfo
- InputSource
- Job
- JobCancelPayload
- JobCreatePayload
- JobHistory
- JobHistoryType
- JobRequester
- JobSpecDocker
- JobSpecWasm
- JobState
- JobStateType
- JobWithInfo
- LabelSelectorRequirement
- LegacyCancelRequest
- LegacyCancelResponse
- LegacyEventFilterOptions
- LegacyEventsRequest
- LegacyEventsResponse
- LegacyListRequest
- LegacyListResponse
- LegacyLogRequest
- LegacyResultsResponse
- LegacyStateRequest
- LegacyStateResponse
- LegacySubmitRequest
- LegacySubmitResponse
- LegacyVersionRequest
- LegacyVersionResponse
- LogsPayload
- Metadata
- MountStatus
- Network
- NetworkConfig
- NodeInfo
- NodeType
- PeerAddrInfo
- PublishedResult
- Publisher
- PublisherSpec
- ResourceUsageConfig
- Resources
- ResourcesConfig
- ResultPath
- RunCommandResult
- S3StorageSpec
- SelectionOperator
- Spec
- SpecConfig
- StateChangeExecutionStateType
- StateChangeJobStateType
- StateExecutionDesiredStateType
- StateExecutionStateType
- StateJobStateType
- StorageSourceType
- StorageSpec
- Task
- TimeoutConfig
Documentation For Authorization
All endpoints do not require authorization.
Author
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
Hashes for bacalhau_apiclient-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e9cc603641761c7e0d81d835f9ac1cab1d940b8dd35487fe236179addabb76 |
|
MD5 | 9187e70ddaae311a368ef3838ab91141 |
|
BLAKE2b-256 | 737616b80b5c79f03be7565837961b43fd4939b69f82363104be8238a9faaca0 |