|
1 |
| -# py-codex-api |
| 1 | +# Codex API Client |
| 2 | +List of endpoints and interfaces available to Codex API users |
| 3 | + |
| 4 | +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 5 | + |
| 6 | +- API version: 0.0.1 |
| 7 | +- Package version: 1.0.0 |
| 8 | +- Generator version: 7.8.0 |
| 9 | +- Build package: org.openapitools.codegen.languages.PythonClientCodegen |
| 10 | + |
| 11 | +## Requirements. |
| 12 | + |
| 13 | +Python 3.7+ |
| 14 | + |
| 15 | +## Installation & Usage |
| 16 | +### pip install |
| 17 | + |
| 18 | +If the python package is hosted on a repository, you can install directly using: |
| 19 | + |
| 20 | +```sh |
| 21 | +pip install git+https://github.com/auhau/py-codex-api.git |
| 22 | +``` |
| 23 | +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/auhau/py-codex-api.git`) |
| 24 | + |
| 25 | +Then import the package: |
| 26 | +```python |
| 27 | +import codex_client |
| 28 | +``` |
| 29 | + |
| 30 | +### Setuptools |
| 31 | + |
| 32 | +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 33 | + |
| 34 | +```sh |
| 35 | +python setup.py install --user |
| 36 | +``` |
| 37 | +(or `sudo python setup.py install` to install the package for all users) |
| 38 | + |
| 39 | +Then import the package: |
| 40 | +```python |
| 41 | +import codex_client |
| 42 | +``` |
| 43 | + |
| 44 | +### Tests |
| 45 | + |
| 46 | +Execute `pytest` to run the tests. |
| 47 | + |
| 48 | +## Getting Started |
| 49 | + |
| 50 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 51 | + |
| 52 | +```python |
| 53 | + |
| 54 | +import codex_client |
| 55 | +from codex_client.rest import ApiException |
| 56 | +from pprint import pprint |
| 57 | + |
| 58 | +# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1 |
| 59 | +# See configuration.py for a list of all supported configuration parameters. |
| 60 | +configuration = codex_client.Configuration( |
| 61 | + host = "http://localhost:8080/api/codex/v1" |
| 62 | +) |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +# Enter a context with an instance of the API client |
| 67 | +with codex_client.ApiClient(configuration) as api_client: |
| 68 | + # Create an instance of the API class |
| 69 | + api_instance = codex_client.DataApi(api_client) |
| 70 | + cid = 'cid_example' # str | File to be downloaded. |
| 71 | + |
| 72 | + try: |
| 73 | + # Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned. |
| 74 | + api_response = api_instance.download_local(cid) |
| 75 | + print("The response of DataApi->download_local:\n") |
| 76 | + pprint(api_response) |
| 77 | + except ApiException as e: |
| 78 | + print("Exception when calling DataApi->download_local: %s\n" % e) |
| 79 | + |
| 80 | +``` |
| 81 | + |
| 82 | +## Documentation for API Endpoints |
| 83 | + |
| 84 | +All URIs are relative to *http://localhost:8080/api/codex/v1* |
| 85 | + |
| 86 | +Class | Method | HTTP request | Description |
| 87 | +------------ | ------------- | ------------- | ------------- |
| 88 | +*DataApi* | [**download_local**](docs/DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned. |
| 89 | +*DataApi* | [**download_network**](docs/DataApi.md#download_network) | **GET** /data/{cid}/network | Download a file from the network in a streaming manner. If the file is not available locally, it will be retrieved from other nodes in the network if able. |
| 90 | +*DataApi* | [**list_data**](docs/DataApi.md#list_data) | **GET** /data | Lists manifest CIDs stored locally in node. |
| 91 | +*DataApi* | [**space**](docs/DataApi.md#space) | **GET** /space | Gets a summary of the storage space allocation of the node. |
| 92 | +*DataApi* | [**upload**](docs/DataApi.md#upload) | **POST** /data | Upload a file in a streaming manner. Once finished, the file is stored in the node and can be retrieved by any node in the network using the returned CID. |
| 93 | +*DebugApi* | [**get_debug_info**](docs/DebugApi.md#get_debug_info) | **GET** /debug/info | Gets node information |
| 94 | +*DebugApi* | [**set_debug_log_level**](docs/DebugApi.md#set_debug_log_level) | **POST** /debug/chronicles/loglevel | Set log level at run time |
| 95 | +*MarketplaceApi* | [**create_storage_request**](docs/MarketplaceApi.md#create_storage_request) | **POST** /storage/request/{cid} | Creates a new Request for storage |
| 96 | +*MarketplaceApi* | [**get_active_slot_by_id**](docs/MarketplaceApi.md#get_active_slot_by_id) | **GET** /sales/slots/{slotId} | Returns active slot with id {slotId} for the host |
| 97 | +*MarketplaceApi* | [**get_active_slots**](docs/MarketplaceApi.md#get_active_slots) | **GET** /sales/slots | Returns active slots |
| 98 | +*MarketplaceApi* | [**get_offered_storage**](docs/MarketplaceApi.md#get_offered_storage) | **GET** /sales/availability | Returns storage that is for sale |
| 99 | +*MarketplaceApi* | [**get_purchase**](docs/MarketplaceApi.md#get_purchase) | **GET** /storage/purchases/{id} | Returns purchase details |
| 100 | +*MarketplaceApi* | [**get_purchases**](docs/MarketplaceApi.md#get_purchases) | **GET** /storage/purchases | Returns list of purchase IDs |
| 101 | +*MarketplaceApi* | [**get_reservations**](docs/MarketplaceApi.md#get_reservations) | **PATCH** /sales/availability/{id}/reservations | Get availability's reservations |
| 102 | +*MarketplaceApi* | [**offer_storage**](docs/MarketplaceApi.md#offer_storage) | **POST** /sales/availability | Offers storage for sale |
| 103 | +*MarketplaceApi* | [**update_offered_storage**](docs/MarketplaceApi.md#update_offered_storage) | **PATCH** /sales/availability/{id} | Updates availability |
| 104 | +*NodeApi* | [**connect_peer**](docs/NodeApi.md#connect_peer) | **GET** /connect/{peerId} | Connect to a peer |
| 105 | +*NodeApi* | [**get_peer_id**](docs/NodeApi.md#get_peer_id) | **GET** /node/peerid | Get Node's PeerID |
| 106 | +*NodeApi* | [**get_spr**](docs/NodeApi.md#get_spr) | **GET** /node/spr | Get Node's SPR |
| 107 | + |
| 108 | + |
| 109 | +## Documentation For Models |
| 110 | + |
| 111 | + - [Content](docs/Content.md) |
| 112 | + - [DataItem](docs/DataItem.md) |
| 113 | + - [DataList](docs/DataList.md) |
| 114 | + - [DebugInfo](docs/DebugInfo.md) |
| 115 | + - [ErasureParameters](docs/ErasureParameters.md) |
| 116 | + - [ManifestItem](docs/ManifestItem.md) |
| 117 | + - [PeerIdRead](docs/PeerIdRead.md) |
| 118 | + - [PoRParameters](docs/PoRParameters.md) |
| 119 | + - [Purchase](docs/Purchase.md) |
| 120 | + - [Reservation](docs/Reservation.md) |
| 121 | + - [SPRRead](docs/SPRRead.md) |
| 122 | + - [SalesAvailability](docs/SalesAvailability.md) |
| 123 | + - [SalesAvailabilityCREATE](docs/SalesAvailabilityCREATE.md) |
| 124 | + - [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md) |
| 125 | + - [Slot](docs/Slot.md) |
| 126 | + - [Space](docs/Space.md) |
| 127 | + - [StorageAsk](docs/StorageAsk.md) |
| 128 | + - [StorageRequest](docs/StorageRequest.md) |
| 129 | + - [StorageRequestCreation](docs/StorageRequestCreation.md) |
| 130 | + |
| 131 | + |
| 132 | +<a id="documentation-for-authorization"></a> |
| 133 | +## Documentation For Authorization |
| 134 | + |
| 135 | +Endpoints do not require authorization. |
| 136 | + |
| 137 | + |
| 138 | +## Author |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
0 commit comments