Last active
January 18, 2017 19:59
-
-
Save allthingsclowd/e235dc82f2699ce14f165dc085414a8c to your computer and use it in GitHub Desktop.
snippet of K5 function to add remote interface current project router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inter_project_connection_create(k5token, router, port, region): | |
routerURL = 'https://networking-ex.' + region + \ | |
'.cloud.global.fujitsu.com/v2.0/routers/' + \ | |
router + '/add_cross_project_router_interface' | |
try: | |
response = requests.put(routerURL, | |
headers={'X-Auth-Token': k5token, | |
'Content-Type': 'application/json'}, | |
json={"port_id": port}) | |
return response | |
except: | |
return ("\nUnexpected error:", sys.exc_info()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment