Skip to content

Commit

Permalink
added SMC API test tool
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelNevinFP committed May 21, 2021
1 parent d9d4bb5 commit 0e9c180
Show file tree
Hide file tree
Showing 2 changed files with 860 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Api-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/python
import os
import sys
from smcConnector.Config import get_url, get_api_version, get_api_key
from smc import session


parent_dir = os.path.abspath(os.path.dirname(__file__))
vendor_dir = os.path.join(parent_dir, 'Libs')
pem_dir = os.path.join(parent_dir, 'smc.pem')
sys.path.append(vendor_dir)


PROFILE_NAME = "aws_profile"

try:
session.login(url=get_url(), api_key=get_api_key(), api_version=get_api_version(), verify=pem_dir)
print(f'Your API Client: \'{session.current_user.name}\' can be reached')

except Exception as e:
print(f'Error connecting: {e}')
session.logout()

0 comments on commit 0e9c180

Please sign in to comment.