Fabric Orchestrator swagger-client
This is Fabric Orchestrator API
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0.1
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
Generating the Client Code
Due to a BUG in swagger-code-gen, Please follow the steps below
That said, there's a bug in the Python generator of Swagger Codegen 3.x, it doesn't generate the code for Bearer authentication in OpenAPI 3.0 definitions. As a workaround, edit your OpenAPI YAML file and replace this part
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
to
securitySchemes:
sso_auth:
type: apiKey
in: header
name: Authorization
Then generate a new Python client from the modified API definition.
Reference for more details here
Requirements.
Python 3.9+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/fabric-testbed/OrchestratorClient.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/fabric-testbed/OrchestratorClient.git)
Then import the package:
import fabric_cf.orchestrator.swagger_client
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 fabric_cf.orchestrator.swagger_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
from fabric_cf.orchestrator.swagger_client.api.version_api import VersionApi
from fabric_cf.orchestrator.swagger_client import Configuration, ApiClient
from fabric_cf.orchestrator.swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create_slices an instance of the API class
api_instance = VersionApi(ApiClient(configuration))
try:
# version
api_response = api_instance.version_get()
pprint(api_response)
except ApiException as e:
print("Exception when calling VersionApi->version_get: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://127.0.0.1:8700/
| Class | Method | HTTP request | Description |
|---|---|---|---|
| PoasApi | poas_create_sliver_id_post | POST /poas/create/{sliver_id} | Perform an operational action on a sliver. |
| PoasApi | poas_get | GET /poas/ | Request get the status of the POAs. |
| PoasApi | poas_poa_id_get | GET /poas/{poa_id} | Perform an operational action on a sliver. |
| ResourcesApi | portalresources_get | GET /portalresources | Retrieve a listing and description of available resources for portal |
| ResourcesApi | resources_get | GET /resources | Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. |
| SlicesApi | slices_create_post | POST /slices/create | Create slice |
| SlicesApi | slices_creates_post | POST /slices/creates | Create slice |
| SlicesApi | slices_delete_delete | DELETE /slices/delete | Delete all slices for a User within a project. |
| SlicesApi | slices_delete_slice_id_delete | DELETE /slices/delete/{slice_id} | Delete slice. |
| SlicesApi | slices_get | GET /slices | Retrieve a listing of user slices |
| SlicesApi | slices_modify_slice_id_accept_post | POST /slices/modify/{slice_id}/accept | Accept the last modify an existing slice |
| SlicesApi | slices_modify_slice_id_put | PUT /slices/modify/{slice_id} | Modify an existing slice |
| SlicesApi | slices_renew_slice_id_post | POST /slices/renew/{slice_id} | Renew slice |
| SlicesApi | slices_slice_id_get | GET /slices/{slice_id} | slice properties |
| SliversApi | slivers_get | GET /slivers | Retrieve a listing of user slivers |
| SliversApi | slivers_sliver_id_get | GET /slivers/{sliver_id} | slivers properties |
| VersionApi | version_get | GET /version | Version |
Documentation For Models
- Poa
- PoaData
- PoaPost
- PoaPostData
- PoaPostDataKeys
- PoaPostDataVcpuCpuMap
- Resource
- Resources
- Slice
- SliceDetails
- Slices
- SlicesPost
- Sliver
- Slivers
- Status200OkNoContent
- Status200OkNoContentData
- Status200OkPaginated
- Status200OkSingle
- Status400BadRequest
- Status400BadRequestErrors
- Status401Unauthorized
- Status401UnauthorizedErrors
- Status403Forbidden
- Status403ForbiddenErrors
- Status404NotFound
- Status404NotFoundErrors
- Status500InternalServerError
- Status500InternalServerErrorErrors
- Version
- VersionData
Documentation For Authorization
bearerAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Documentation For Orchestrator Proxy
Users are recommended to use Orchestrator Proxy class for any orchestrator operations. Examples are shown below.
Get Resources
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
resources = proxy.resources(token=token)
Create Slice
import fim.user as fu
t = fu.ExperimentTopology()
n1 = t.add_node(name='n1', site='RENC')
cap = fu.Capacities()
cap.set_fields(core=4, ram=64, disk=500)
n1.set_properties(capacities=cap, image_type='qcow2', image_ref='default_centos_8')
n1.add_component(ctype=fu.ComponentType.SmartNIC, model='ConnectX-6', name='nic1')
n2 = t.add_node(name='n2', site='RENC')
n2.set_properties(capacities=cap, image_type='qcow2', image_ref='default_centos_8')
n2.add_component(ctype=fu.ComponentType.GPU, model='Tesla T4', name='nic2')
slice_graph = t.serialize()
sss_key = "<user public key>"
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, reservation_list = proxy.create(token=token, slice_name=name, slice_graph=slice_graph, ssh_key=ssh_key)
Get Slices
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, slice_list = proxy.slices(token=token)
Get Slice
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, slice_topology = proxy.get_slice(token=token, slice_id=slice_id)
Get Slivers
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, reservation_list = proxy.slivers(token=token, slice_id=slice_id)
Get Sliver
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, reservation = proxy.slivers(token=token, slice_id=slice_id, sliver_id=sliver_id)
Delete Slice by slice_id
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, result = proxy.delete(token=token, slice_id=slice_id)
Delete Slices by email
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, result = proxy.delete(token=token, email=email)
Renew Slice
now = datetime.now(timezone.utc)
new_time = now + timedelta(days=2)
orchestrator_host = "dev-3.fabric-testbed.net"
proxy = OrchestratorProxy(orchestrator_host=orchestrator_host)
status, reservation = proxy.renew_slice(token=token, slice_id=slice_id,
new_lease_end_time=new_time.strftime('%Y-%m-%d %H:%M:%S %z'))
Author
Metadata
Release files for fabric_orchestrator_client 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fabric_orchestrator_client-2.0.0.tar.gz | 38.2 kB | Without provenance | Details for fabric_orchestrator_client-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fabric_orchestrator_client-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for fabric_orchestrator_client-2.0.0-py3-none-any.whl |
Total release size: 120.4 kB
Release files / fabric_orchestrator_client-2.0.0.tar.gz
| Download URL | fabric_orchestrator_client-2.0.0.tar.gz |
|---|---|
| Size | 38.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8863b39b656f9c2a3e3ff26cfda51eb8eccc48e59586c2d5c29c1117824c18a7
|
|
BLAKE2b-256 checksum How to use checksums |
fd426cf43c49c3ad837615de98cfaf17e57d5d177fd8d6d9c44c2a66ea78d726
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.5
|
Release files / fabric_orchestrator_client-2.0.0-py3-none-any.whl
| Download URL | fabric_orchestrator_client-2.0.0-py3-none-any.whl |
|---|---|
| Size | 82.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a12842923de9eaa63b6a932f7ddc2f9914d293c3f7b11f38db79be59cf97145
|
|
BLAKE2b-256 checksum How to use checksums |
e855b936fbc2f6ff61bc8eb6536a96e9f462d747d0b17ba8371e2cbdd18127fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.5
|
Security for fabric_orchestrator_client 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.