Skip to content

Commit bc41cb9

Browse files
committed
feat: first generated version
1 parent 6b483a7 commit bc41cb9

File tree

97 files changed

+13354
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+13354
-1
lines changed

.github/workflows/python.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
5+
6+
name: codex_client Python package
7+
8+
on: [push, pull_request]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install flake8 pytest
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
30+
- name: Lint with flake8
31+
run: |
32+
# stop the build if there are Python syntax errors or undefined names
33+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+
- name: Test with pytest
37+
run: |
38+
pytest

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
venv/
48+
.venv/
49+
.python-version
50+
.pytest_cache
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
59+
# Sphinx documentation
60+
docs/_build/
61+
62+
# PyBuilder
63+
target/
64+
65+
#Ipython Notebook
66+
.ipynb_checkpoints

.gitlab-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.gitlab.com/ee/ci/README.html
5+
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
6+
7+
stages:
8+
- test
9+
10+
.pytest:
11+
stage: test
12+
script:
13+
- pip install -r requirements.txt
14+
- pip install -r test-requirements.txt
15+
- pytest --cov=codex_client
16+
17+
pytest-3.7:
18+
extends: .pytest
19+
image: python:3.7-alpine
20+
pytest-3.8:
21+
extends: .pytest
22+
image: python:3.8-alpine
23+
pytest-3.9:
24+
extends: .pytest
25+
image: python:3.9-alpine
26+
pytest-3.10:
27+
extends: .pytest
28+
image: python:3.10-alpine
29+
pytest-3.11:
30+
extends: .pytest
31+
image: python:3.11-alpine

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/FILES

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.github/workflows/python.yml
2+
.gitignore
3+
.gitlab-ci.yml
4+
.travis.yml
5+
README.md
6+
codex_client/__init__.py
7+
codex_client/api/__init__.py
8+
codex_client/api/data_api.py
9+
codex_client/api/debug_api.py
10+
codex_client/api/marketplace_api.py
11+
codex_client/api/node_api.py
12+
codex_client/api_client.py
13+
codex_client/api_response.py
14+
codex_client/configuration.py
15+
codex_client/exceptions.py
16+
codex_client/models/__init__.py
17+
codex_client/models/content.py
18+
codex_client/models/data_item.py
19+
codex_client/models/data_list.py
20+
codex_client/models/debug_info.py
21+
codex_client/models/erasure_parameters.py
22+
codex_client/models/manifest_item.py
23+
codex_client/models/peer_id_read.py
24+
codex_client/models/po_r_parameters.py
25+
codex_client/models/purchase.py
26+
codex_client/models/reservation.py
27+
codex_client/models/sales_availability.py
28+
codex_client/models/sales_availability_create.py
29+
codex_client/models/sales_availability_read.py
30+
codex_client/models/slot.py
31+
codex_client/models/space.py
32+
codex_client/models/spr_read.py
33+
codex_client/models/storage_ask.py
34+
codex_client/models/storage_request.py
35+
codex_client/models/storage_request_creation.py
36+
codex_client/py.typed
37+
codex_client/rest.py
38+
docs/Content.md
39+
docs/DataApi.md
40+
docs/DataItem.md
41+
docs/DataList.md
42+
docs/DebugApi.md
43+
docs/DebugInfo.md
44+
docs/ErasureParameters.md
45+
docs/ManifestItem.md
46+
docs/MarketplaceApi.md
47+
docs/NodeApi.md
48+
docs/PeerIdRead.md
49+
docs/PoRParameters.md
50+
docs/Purchase.md
51+
docs/Reservation.md
52+
docs/SPRRead.md
53+
docs/SalesAvailability.md
54+
docs/SalesAvailabilityCREATE.md
55+
docs/SalesAvailabilityREAD.md
56+
docs/Slot.md
57+
docs/Space.md
58+
docs/StorageAsk.md
59+
docs/StorageRequest.md
60+
docs/StorageRequestCreation.md
61+
git_push.sh
62+
pyproject.toml
63+
requirements.txt
64+
setup.cfg
65+
setup.py
66+
test-requirements.txt
67+
test/__init__.py
68+
tox.ini

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.8.0

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "3.7"
5+
- "3.8"
6+
- "3.9"
7+
- "3.10"
8+
- "3.11"
9+
# uncomment the following if needed
10+
#- "3.11-dev" # 3.11 development branch
11+
#- "nightly" # nightly build
12+
# command to install dependencies
13+
install:
14+
- "pip install -r requirements.txt"
15+
- "pip install -r test-requirements.txt"
16+
# command to run tests
17+
script: pytest --cov=codex_client

README.md

Lines changed: 142 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,142 @@
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

Comments
 (0)