33 lines
1003 B
Python
33 lines
1003 B
Python
import ng_openstack.keystone
|
|
import os
|
|
import json
|
|
|
|
|
|
# import ng_openstack
|
|
from ng_openstack.logger import log
|
|
|
|
log.info("Starting")
|
|
x=ng_openstack.OpenstackConnection("Fido",10)
|
|
# x.keystone.getAllProjects()
|
|
x.keystone.getCatalog()
|
|
|
|
# print (x.keystone.catalogData)
|
|
|
|
# neutronService=x.keystone.getServicebyName("Neutron")
|
|
# print(neutronService)
|
|
neutronURL=x.keystone.getEndpointByNameIDAndInterface("NeuTrOn","internal")['url']
|
|
print(neutronURL)
|
|
|
|
# token = ng_openstack.auth.getToken(os.getenv("OS_USERNAME"), os.getenv("OS_PASSWORD"),
|
|
# os.getenv("OS_USER_DOMAIN_NAME"), os.getenv("OS_USER_DOMAIN_NAME"),
|
|
# os.getenv("OS_PROJECT_ID"))
|
|
# print(token)
|
|
|
|
# # print(json.dumps(ng_openstack.keystone.getAllProjects(), indent=4))
|
|
# cat=ng_openstack.keystone.getCatalog()
|
|
|
|
|
|
# print (ng_openstack.keystone.getServicebyID("11f21a87fdaa4f5d9bd93c7396bdd93c"))
|
|
|
|
# # openstack=newOpenstack.connect()
|
|
# # projects=openstack.projects.getAll() |