Git Product home page Git Product logo

pureport-python's Introduction

Pureport Ansible Collections

This repository represents various Ansible Collections for interaction with Pureport & Pureport's ReST API.

Pureport provides the following collections:

  • pureport.fabric - A collection of modules that directly interact with the Pureport ReST API.
  • pureport.network - A collection of roles for building cloud native networks.
  • pureport.aws - A collection of AWS patched modules for handling DirectConnect automation.

pureport-python's People

Contributors

privateip avatar rghodgkin avatar

Watchers

 avatar

pureport-python's Issues

delete_network() function fails against Pureport Prod api - invalid return code

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

models.load() does not enforce required customer_networks 'address' field

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()

gateway_respawn() function fails against Pureport Prod api - invalid return code

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()

Integrate CHAGELOG into documentation site

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.