Skip to main content

Vxapi Client

The Vxfiber API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

This Python library provides convenient access to the Vxfiber API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the vxfiber API.

Examples

Client initialization

Give url and path for swagger's cache (it automatically call spec endpoint to known all specification's endpoints)

client = Client(url='https://vxapitest-test-test.vx.se', cache_path='/tmp/pyvxclient.swagger.json') token = client.get_token('massimo', 'password') client.api_key = token['api_key'] client.setup()

Alert: cache_path must end with .json extension

Actions

  • get customers with limit results

client.Customer.get(limit=5)

idc = ret.json['data'][0]['id']

  • get just customers on first page

client.Customer.get(page=1, per_page=20)

  • get customers filtered and ordered

client.Customer.get(limit=5, q=["country_code:it","city:Milan"], sort="-created")

  • get single customer

client.Customer.get(limit=5, q=["id:D28E299D-8673-41AB-89B4-1B20F64F8E02"])

  • get single customer, with only some fields

client.Customers.get(limit=5, q=["id:D28E299D-8673-41AB-89B4-1B20F64F8E02"], fields=['id', 'first_name', 'last_name'])

  • create customer

ret = client.Customer.create(first_name='pluto', last_name='pluto', password='ciao#1234', email='ciao@test.it', province='', city='', customer_type='Residential', postal_code='', language='English', mobile_number='', phone_number='', street_address='')

idc = ret.json['data']['id']

  • modify customer

client.Customer.update(id=idc, first_name='pluto2')

There are many others resources (partially or full implemented):

  • client.ApiUser
  • client.Inventory
  • client.NetworkOperator
  • client.Network
  • client.ObjectGroup
  • client.Object
  • client.Order
  • client.Customer
  • client.Service ...

All results are returned inside an instance of ApiResponse. The same object is used when there are no results (404). For every methods (get, create, update, delete) of a resource could generate many types of errors: BadRequest(400), Forbidden(403), Unauthorized(401), ServerError(5xx), ClientError(others).

Metadata

Release files for pyvxclient 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvxclient 0.2.6
File Size Uploaded Provenance Actions
pyvxclient-0.2.6.tar.gz 34.6 kB Without provenance Details for pyvxclient-0.2.6.tar.gz

Release files / pyvxclient-0.2.6.tar.gz

Download URL pyvxclient-0.2.6.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ca4b0cd43ea9c2c4e82b34d5b9b0a421fd2f96a53f2fbb00ac2d94757073514f
BLAKE2b-256 checksum
How to use checksums
0b674dcb2701cc9c7173ce2864ba0f880d686e122e3c9ab8113a71f593c100e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/38.5.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.14

Security for pyvxclient 0.2.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page