Skip to content

Instantly share code, notes, and snippets.

@allthingsclowd
Last active January 18, 2017 19:59
Show Gist options
  • Save allthingsclowd/e235dc82f2699ce14f165dc085414a8c to your computer and use it in GitHub Desktop.
Save allthingsclowd/e235dc82f2699ce14f165dc085414a8c to your computer and use it in GitHub Desktop.
snippet of K5 function to add remote interface current project router
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