new-openstackcheck/ng_openstack/keystone.py

38 lines
1.1 KiB
Python
Raw Normal View History

2022-10-10 06:33:10 +00:00
import imp
2022-10-10 05:25:49 +00:00
import json
import ng_openstack.openstackRequest
2022-10-10 06:33:10 +00:00
import ng_openstack.settings
import os
2022-10-10 05:25:49 +00:00
2022-10-10 06:33:10 +00:00
class Openstack_Keystone():
def __init__(self, requestor):
self.serviceData={}
self.catalogData={}
self.projectData={}
self.requestor=requestor
2022-10-10 05:25:49 +00:00
2022-10-10 06:33:10 +00:00
def getAllProjects(_self):
_self.projectData=_self.requestor.make_request("GET", "projects", "",
os.getenv("OS_AUTH_URL")).json()
return _self.projectData
2022-10-10 05:25:49 +00:00
2022-10-10 05:29:15 +00:00
2022-10-10 06:33:10 +00:00
def getCatalog():
catalogData=json.dumps(ng_openstack.openstackRequest.openstackRequest("GET", "endpoints", "",
os.getenv("OS_AUTH_URL")).json())
serviceData=json.dumps(ng_openstack.openstackRequest.openstackRequest("GET", "services", "",
os.getenv("OS_AUTH_URL")).json())
print(serviceData)
return serviceData
def getServicebyID(id):
print(serviceData)
# for _service in service_Data['services']:
# if _service['id']==id:
# return(_service)