Skip to content

Commit

Permalink
Fix Python SDK (#4194)
Browse files Browse the repository at this point in the history
This PR does the following

- Run `swag fmt` on `pkg/publicapi/orchestrator/` this formats all API
comments on endpoints.
- Generate and update the swager `go generate pkg/swaggger/generate.sh`
- Build the apiclient `make build-python-apiclient`
- Fix the SDK meaning all files under `python/bacalhau_sdk`
- Update README.md for `python/` folder.

Github Keywords
close #4164
  • Loading branch information
udsamani committed Jul 3, 2024
1 parent a766d1c commit 9c41fd7
Show file tree
Hide file tree
Showing 398 changed files with 13,520 additions and 19,898 deletions.
2 changes: 1 addition & 1 deletion clients/python/.swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.53
3.0.52
159 changes: 82 additions & 77 deletions clients/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ This page is the reference of the Bacalhau REST API. Project docs are available

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: ${PYPI_VERSION}
- Package version: 0.3.24.dev8
- API version: ${VERSION}
- Package version:
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
For more information, please visit [https://github.com/bacalhau-project/bacalhau](https://github.com/bacalhau-project/bacalhau)

Expand All @@ -24,7 +24,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Then import the package:
```python
import bacalhau_apiclient
import bacalhau_apiclient
```

### Setuptools
Expand Down Expand Up @@ -53,24 +53,24 @@ from bacalhau_apiclient.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = bacalhau_apiclient.HealthApi(bacalhau_apiclient.ApiClient(configuration))
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()
# 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 HealthApi->api_serverdebug: %s\n" % e)
print("Exception when calling ComputeNodeApi->api_serverapprover: %s\n" % e)

# create an instance of the API class
api_instance = bacalhau_apiclient.HealthApi(bacalhau_apiclient.ApiClient(configuration))
api_instance = bacalhau_apiclient.ComputeNodeApi(bacalhau_apiclient.ApiClient(configuration))

try:
# Returns debug information on what the current node is doing.
api_response = api_instance.debug()
api_response = api_instance.api_serverdebug()
pprint(api_response)
except ApiException as e:
print("Exception when calling HealthApi->debug: %s\n" % e)
print("Exception when calling ComputeNodeApi->api_serverdebug: %s\n" % e)
```

## Documentation for API Endpoints
Expand All @@ -79,96 +79,101 @@ All URIs are relative to *http://bootstrap.production.bacalhau.org:1234/*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*HealthApi* | [**api_serverdebug**](docs/HealthApi.md#api_serverdebug) | **GET** /debug | Returns debug information on what the current node is doing.
*HealthApi* | [**debug**](docs/HealthApi.md#debug) | **GET** /requester/debug | Returns debug information on what the current node is doing.
*JobApi* | [**cancel**](docs/JobApi.md#cancel) | **POST** /requester/cancel | Cancels the job with the job-id specified in the body payload.
*JobApi* | [**events**](docs/JobApi.md#events) | **POST** /requester/events | Returns the events related to the job-id passed in the body payload. Useful for troubleshooting.
*JobApi* | [**list**](docs/JobApi.md#list) | **POST** /requester/list | Simply lists jobs.
*JobApi* | [**results**](docs/JobApi.md#results) | **POST** /requester/results | Returns the results of the job-id specified in the body payload.
*JobApi* | [**states**](docs/JobApi.md#states) | **POST** /requester/states | Returns the state of the job-id specified in the body payload.
*JobApi* | [**submit**](docs/JobApi.md#submit) | **POST** /requester/submit | Submits a new job to the network.
*MiscApi* | [**api_serverversion**](docs/MiscApi.md#api_serverversion) | **POST** /version | Returns the build version running on the server.
*UtilsApi* | [**healthz**](docs/UtilsApi.md#healthz) | **GET** /healthz |
*UtilsApi* | [**id**](docs/UtilsApi.md#id) | **GET** /id | Returns the id of the host node.
*UtilsApi* | [**livez**](docs/UtilsApi.md#livez) | **GET** /livez |
*UtilsApi* | [**logz**](docs/UtilsApi.md#logz) | **GET** /logz |
*UtilsApi* | [**node_info**](docs/UtilsApi.md#node_info) | **GET** /node_info | Returns the info of the node.
*UtilsApi* | [**peers**](docs/UtilsApi.md#peers) | **GET** /peers | Returns the peers connected to the host via the transport layer.
*UtilsApi* | [**readyz**](docs/UtilsApi.md#readyz) | **GET** /readyz |
*UtilsApi* | [**varz**](docs/UtilsApi.md#varz) | **GET** /varz |
*ComputeNodeApi* | [**api_serverapprover**](docs/ComputeNodeApi.md#api_serverapprover) | **GET** /api/v1/compute/approve | Approves a job to be run on this compute node.
*ComputeNodeApi* | [**api_serverdebug**](docs/ComputeNodeApi.md#api_serverdebug) | **GET** /api/v1/compute/debug | Returns debug information on what the current node is doing.
*MiscApi* | [**api_serverversion**](docs/MiscApi.md#api_serverversion) | **POST** /api/v1/version | Returns the build version running on the server.
*OpsApi* | [**agentalive**](docs/OpsApi.md#agentalive) | **GET** /api/v1/agent/alive |
*OpsApi* | [**agentdebug**](docs/OpsApi.md#agentdebug) | **GET** /api/v1/agent/debug | Returns debug information on what the current node is doing.
*OpsApi* | [**agentnode**](docs/OpsApi.md#agentnode) | **GET** /api/v1/agent/node | Returns the info of the node.
*OpsApi* | [**agentversion**](docs/OpsApi.md#agentversion) | **GET** /api/v1/agent/version | Returns the build version running on the server.
*OrchestratorApi* | [**orchestratorget_job**](docs/OrchestratorApi.md#orchestratorget_job) | **GET** /api/v1/orchestrator/jobs/{id} | Returns a job.
*OrchestratorApi* | [**orchestratorget_node**](docs/OrchestratorApi.md#orchestratorget_node) | **GET** /api/v1/orchestrator/nodes/{id} | Get an orchestrator node
*OrchestratorApi* | [**orchestratorjob_executions**](docs/OrchestratorApi.md#orchestratorjob_executions) | **GET** /api/v1/orchestrator/jobs/{id}/executions | Returns the executions of a job.
*OrchestratorApi* | [**orchestratorjob_history**](docs/OrchestratorApi.md#orchestratorjob_history) | **GET** /api/v1/orchestrator/jobs/{id}/history | Returns the history of a job.
*OrchestratorApi* | [**orchestratorjob_results**](docs/OrchestratorApi.md#orchestratorjob_results) | **GET** /api/v1/orchestrator/jobs/{id}/results | Returns the results of a job.
*OrchestratorApi* | [**orchestratorlist_jobs**](docs/OrchestratorApi.md#orchestratorlist_jobs) | **GET** /api/v1/orchestrator/jobs | Returns a list of jobs.
*OrchestratorApi* | [**orchestratorlist_nodes**](docs/OrchestratorApi.md#orchestratorlist_nodes) | **GET** /api/v1/orchestrator/nodes | Returns a list of orchestrator nodes.
*OrchestratorApi* | [**orchestratorlogs**](docs/OrchestratorApi.md#orchestratorlogs) | **GET** /api/v1/orchestrator/jobs/{id}/logs | Displays the logs for a current job/execution
*OrchestratorApi* | [**orchestratorput_job**](docs/OrchestratorApi.md#orchestratorput_job) | **PUT** /api/v1/orchestrator/jobs | Submits a job to the orchestrator.
*OrchestratorApi* | [**orchestratorstop_job**](docs/OrchestratorApi.md#orchestratorstop_job) | **DELETE** /api/v1/orchestrator/jobs/{id} | Stops a job.
*OrchestratorApi* | [**orchestratorupdate_node**](docs/OrchestratorApi.md#orchestratorupdate_node) | **POST** /api/v1/orchestrator/nodes | Update an orchestrator node.
*UtilsApi* | [**healthz**](docs/UtilsApi.md#healthz) | **GET** /api/v1/healthz |
*UtilsApi* | [**home**](docs/UtilsApi.md#home) | **GET** / |
*UtilsApi* | [**id**](docs/UtilsApi.md#id) | **GET** /api/v1/id | Returns the id of the host node.
*UtilsApi* | [**livez**](docs/UtilsApi.md#livez) | **GET** /api/v1/livez |
*UtilsApi* | [**node_info**](docs/UtilsApi.md#node_info) | **GET** /api/v1/node_info | Returns the info of the node.

## Documentation For Models

- [AllOfExecutionStateRunOutput](docs/AllOfExecutionStateRunOutput.md)
- [AllOfExecutionStateState](docs/AllOfExecutionStateState.md)
- [AllOfJobSpec](docs/AllOfJobSpec.md)
- [AllOfJobSpecLanguageJobContext](docs/AllOfJobSpecLanguageJobContext.md)
- [AllOfJobSpecWasmEntryModule](docs/AllOfJobSpecWasmEntryModule.md)
- [AllOfJobStateState](docs/AllOfJobStateState.md)
- [AllOfJobWithInfoJob](docs/AllOfJobWithInfoJob.md)
- [AllOfJobWithInfoState](docs/AllOfJobWithInfoState.md)
- [AllOfExecutionAllocatedResources](docs/AllOfExecutionAllocatedResources.md)
- [AllOfExecutionComputeState](docs/AllOfExecutionComputeState.md)
- [AllOfExecutionDesiredState](docs/AllOfExecutionDesiredState.md)
- [AllOfExecutionJob](docs/AllOfExecutionJob.md)
- [AllOfExecutionPublishedResult](docs/AllOfExecutionPublishedResult.md)
- [AllOfExecutionRunOutput](docs/AllOfExecutionRunOutput.md)
- [AllOfGPUVendor](docs/AllOfGPUVendor.md)
- [AllOfInputSourceSource](docs/AllOfInputSourceSource.md)
- [AllOfJobState](docs/AllOfJobState.md)
- [AllOfLabelSelectorRequirementOperator](docs/AllOfLabelSelectorRequirementOperator.md)
- [AllOfSpecDeal](docs/AllOfSpecDeal.md)
- [AllOfSpecDocker](docs/AllOfSpecDocker.md)
- [AllOfSpecEngine](docs/AllOfSpecEngine.md)
- [AllOfSpecNetwork](docs/AllOfSpecNetwork.md)
- [AllOfSpecPublisher](docs/AllOfSpecPublisher.md)
- [AllOfSpecResources](docs/AllOfSpecResources.md)
- [AllOfStorageSpecStorageSource](docs/AllOfStorageSpecStorageSource.md)
- [AllOfcancelRequestPayload](docs/AllOfcancelRequestPayload.md)
- [AllOfStateExecutionDesiredStateTypeStateType](docs/AllOfStateExecutionDesiredStateTypeStateType.md)
- [AllOfStateExecutionStateTypeStateType](docs/AllOfStateExecutionStateTypeStateType.md)
- [AllOfStateJobStateTypeStateType](docs/AllOfStateJobStateTypeStateType.md)
- [AllOfTaskResources](docs/AllOfTaskResources.md)
- [AllocatedResources](docs/AllocatedResources.md)
- [ApiGetJobResponse](docs/ApiGetJobResponse.md)
- [ApiGetNodeResponse](docs/ApiGetNodeResponse.md)
- [ApiGetVersionResponse](docs/ApiGetVersionResponse.md)
- [ApiHTTPCredential](docs/ApiHTTPCredential.md)
- [ApiListJobExecutionsResponse](docs/ApiListJobExecutionsResponse.md)
- [ApiListJobHistoryResponse](docs/ApiListJobHistoryResponse.md)
- [ApiListJobResultsResponse](docs/ApiListJobResultsResponse.md)
- [ApiListJobsResponse](docs/ApiListJobsResponse.md)
- [ApiListNodesResponse](docs/ApiListNodesResponse.md)
- [ApiPutJobRequest](docs/ApiPutJobRequest.md)
- [ApiPutJobResponse](docs/ApiPutJobResponse.md)
- [ApiPutNodeRequest](docs/ApiPutNodeRequest.md)
- [ApiPutNodeResponse](docs/ApiPutNodeResponse.md)
- [ApiStopJobResponse](docs/ApiStopJobResponse.md)
- [BuildVersionInfo](docs/BuildVersionInfo.md)
- [CancelRequest](docs/CancelRequest.md)
- [CancelResponse](docs/CancelResponse.md)
- [ComputeNodeInfo](docs/ComputeNodeInfo.md)
- [Deal](docs/Deal.md)
- [Engine](docs/Engine.md)
- [EventsRequest](docs/EventsRequest.md)
- [EventsResponse](docs/EventsResponse.md)
- [ExecutionState](docs/ExecutionState.md)
- [DebugInfo](docs/DebugInfo.md)
- [Event](docs/Event.md)
- [Execution](docs/Execution.md)
- [ExecutionDesiredStateType](docs/ExecutionDesiredStateType.md)
- [ExecutionStateType](docs/ExecutionStateType.md)
- [FreeSpace](docs/FreeSpace.md)
- [GPU](docs/GPU.md)
- [GPUVendor](docs/GPUVendor.md)
- [HealthInfo](docs/HealthInfo.md)
- [InputSource](docs/InputSource.md)
- [Job](docs/Job.md)
- [JobCancelPayload](docs/JobCancelPayload.md)
- [JobHistory](docs/JobHistory.md)
- [JobHistoryType](docs/JobHistoryType.md)
- [JobRequester](docs/JobRequester.md)
- [JobSpecDocker](docs/JobSpecDocker.md)
- [JobSpecLanguage](docs/JobSpecLanguage.md)
- [JobSpecWasm](docs/JobSpecWasm.md)
- [JobState](docs/JobState.md)
- [JobStateType](docs/JobStateType.md)
- [JobWithInfo](docs/JobWithInfo.md)
- [LabelSelectorRequirement](docs/LabelSelectorRequirement.md)
- [ListRequest](docs/ListRequest.md)
- [ListResponse](docs/ListResponse.md)
- [Metadata](docs/Metadata.md)
- [MountStatus](docs/MountStatus.md)
- [Network](docs/Network.md)
- [NetworkConfig](docs/NetworkConfig.md)
- [NodeConnectionState](docs/NodeConnectionState.md)
- [NodeInfo](docs/NodeInfo.md)
- [NodeMembershipState](docs/NodeMembershipState.md)
- [NodeState](docs/NodeState.md)
- [NodeType](docs/NodeType.md)
- [PeerAddrInfo](docs/PeerAddrInfo.md)
- [PublishedResult](docs/PublishedResult.md)
- [Publisher](docs/Publisher.md)
- [ResourceUsageConfig](docs/ResourceUsageConfig.md)
- [ResourceUsageData](docs/ResourceUsageData.md)
- [ResultsResponse](docs/ResultsResponse.md)
- [Resources](docs/Resources.md)
- [ResourcesConfig](docs/ResourcesConfig.md)
- [ResultPath](docs/ResultPath.md)
- [RunCommandResult](docs/RunCommandResult.md)
- [SelectionOperator](docs/SelectionOperator.md)
- [Spec](docs/Spec.md)
- [SharedVersionRequest](docs/SharedVersionRequest.md)
- [SharedVersionResponse](docs/SharedVersionResponse.md)
- [SpecConfig](docs/SpecConfig.md)
- [StateChangeExecutionStateType](docs/StateChangeExecutionStateType.md)
- [StateChangeJobStateType](docs/StateChangeJobStateType.md)
- [StateRequest](docs/StateRequest.md)
- [StateResponse](docs/StateResponse.md)
- [StorageSourceType](docs/StorageSourceType.md)
- [StorageSpec](docs/StorageSpec.md)
- [SubmitRequest](docs/SubmitRequest.md)
- [SubmitResponse](docs/SubmitResponse.md)
- [VerificationResult](docs/VerificationResult.md)
- [Verifier](docs/Verifier.md)
- [VersionRequest](docs/VersionRequest.md)
- [VersionResponse](docs/VersionResponse.md)
- [StateExecutionDesiredStateType](docs/StateExecutionDesiredStateType.md)
- [StateExecutionStateType](docs/StateExecutionStateType.md)
- [StateJobStateType](docs/StateJobStateType.md)
- [Task](docs/Task.md)
- [TimeoutConfig](docs/TimeoutConfig.md)

## Documentation For Authorization

Expand Down
Loading

0 comments on commit 9c41fd7

Please sign in to comment.