pureport / pureport-python Goto Github PK
View Code? Open in Web Editor NEWPython language bindings for Pureport Fabric API
License: MIT License
Python language bindings for Pureport Fabric API
License: MIT License
When executing a 'session.delete_network(<net_id>)' against the Pureport public api ('https://api.pureport.com'), this seems to throw a Pureport exception stating "pureport.exceptions.PureportError: invalid status code received from response". The reason seems to be that the DELETE was successful on Pureport side but is returning a "204" response rather than expected "200".
If I manually update the 'DELETE' status_codes list to include '204' it works cleanly.
Response from Pureport API for network delete:
Request URL: https://api.pureport.com/networks/network-PoZdpa9GRAoXkp5luGrFrg
Request Method: DELETE
Status Code: 204
Remote Address: 34.231.19.164:443
Referrer Policy: no-referrer-when-downgrade
Read the Docs is not rendering rst code blocks properly - see https://pureport-python.readthedocs.io/en/latest/installation.html#installing-from-pypi for an example.
When executing models.load() function against an AWS connection type with 'customer_networks' attribute specified, but missing required "address" field - it does not flag this as an invalid request. If the same is sent to actual Pureport API it gets rejected with below:
"Instantiation of object value failed for JSON property 'address' due to missing (therefore NULL). 'address' is a non-nullable type"
Is it expected that non-required attributes will be validated?
Example:
(Pdb) conn_data.type
'Connection'
(Pdb) conn_data.data
{'type': 'AWS_DIRECT_CONNECT', 'name': '0CEWQZN9E5SSQ14FR0I4OLWINOOS75WKDM4JIKDJTBSUGJC8VC', 'billing_term': 'HOURLY', 'high_availability': False, 'location': {'href': '/locations/us-sea'}, 'speed': 50, 'aws_account_id': '123412341234', 'aws_region': 'us-west-2', 'customer_networks': [{'name': 'net1'}]}
(Pdb) n
/run/pureport-python/test/pureport-test/func/test_connections.py(20)test_connections_create()
-> conn_obj = runtime.models.load(conn_data.type, conn_data.data)
(Pdb)
(Pdb) conn_obj.serialize()
{'high_availability': False, 'speed': 50, 'billing_term': 'HOURLY', 'customer_networks': [{'name': 'net1'}], 'name': '0CEWQZN9E5SSQ14FR0I4OLWINOOS75WKDM4JIKDJTBSUGJC8VC', 'location': {'href': '/locations/us-sea'}, 'type': 'AWS_DIRECT_CONNECT', 'aws_account_id': '123412341234', 'aws_region': 'us-west-2'}
(Pdb)
When sent to Pureport API:
(Pdb) n
pureport.exceptions.PureportHttpError: Instantiation of object value failed for JSON property 'address' due to missing (therefore NULL). 'address' is a non-nullable type.
/run/pureport-python/test/pureport-test/func/test_connections.py(22)test_connections_create()
When executing any of the following three functions below against the Pureport API, the action succeeds, but the response generates a pureport.Exception for invalid status code. The three functions below are returning a "200" response and expected for a POST looks to be "201".
Functions: stop_gateway(), start_gateway(), respawn_gateway()
Output:
(Pdb) runtime.session.start_gateway(gw_id)
*** pureport.exceptions.PureportError: invalid status code received from response
(Pdb) result = runtime.session.get_connection(conn_id).serialize()
Currently the CHANGELOG is tracked in a text file in the root of the project. With the project released, the CHANGELOG should be integrated in the documentation site.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.