Giter Site home page Giter Site logo

cvp-netsim's Introduction

cvp-netsim's People

Contributors

networkop avatar xk2600 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cvp-netsim's Issues

cvp-netsim broken in CVP 2021.2

Looks like the API has been updated since this was published. The following diff resolves the issues. It would also probably be worth noting the user must create a config folder in the directory the script is executed within or the script fails because the folder doesn't exist when attempting to save files into it.

diff --git a/ingest.py b/ingest.py
index 5d322d1..6d34844 100755
--- a/ingest.py
+++ b/ingest.py
@@ -78,7 +78,9 @@ class CVP(object):
         response = requests.request("POST", url, data=json.dumps(data), headers=self.headers, verify=False)
         if response.status_code == 200:
             data = response.json()
-            self.cookie = f"session_id={data.get('sessionId')}"
+            self.cookie = f"access_token={data.get('sessionId')}"
+            logging.debug(f"cookie: {self.cookie}")
             logging.debug(f"Successfully authenticated on {self.ip}")
             return True
         else:
@@ -278,7 +280,7 @@ def main():
             for k,v2 in v["value"].items(): 
                 from_intf = k
                 for k,v3 in v2.items(): 
-                    to_intf = v3['_key']['neighborPort']
+                    to_intf = v3['key']['neighborPort']
                     if is_macaddress(from_intf): # Corner case for 3rd party LLDP device
                         from_intf = "eth0"
                     elif is_macaddress(to_intf):

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.