import helper # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/keyvaluemaps mapNames = helper.get("keyvaluemaps") kvms=[] for name in mapNames: kvm=helper.get("keyvaluemaps/"+name) kvms.append(kvm) helper.dumpConfig("org/kvms.json", kvms)
import helper import constants # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/environments/prod/caches for e in constants.ENVS: caches = [] cacheNames = helper.get("environments/" + e + "/caches") for name in cacheNames: cacheInfo = helper.get("environments/" + e + "/caches/" + name) caches.append(cacheInfo) helper.dumpConfig("env/" + e + "/caches.json", caches)
import helper devEmails = helper.get("developers") developers = [] for email in devEmails: developer = helper.get("developers/" + email) developers.append(developer) helper.dumpConfig("org/developers.json", developers)
import helper # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/maskconfigs configs = helper.get("maskconfigs") maskConfigs = [] for name in configs: config = helper.get("maskconfigs/" + name) maskConfigs.append(config) helper.dumpConfig("org/maskconfigs.json", maskConfigs)
import helper import constants # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/environments/prod/references for e in constants.ENVS: references = [] relurl = "environments/" + e + "/references" refs = helper.get(relurl) for r in refs: ref = helper.get(relurl + "/" + r) references.append(ref) helper.dumpConfig("env/" + e + "/references.json", references)
import helper import constants # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/environments/prod/virtualhosts for e in constants.ENVS: virtualHosts = [] relurl = "environments/prod/virtualhosts" hosts = helper.get(relurl) for h in hosts: host = helper.get(relurl + "/" + h) virtualHosts.append(host) helper.dumpConfig("env/" + e + "/virtualHosts.json", virtualHosts)
import helper # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/userroles roles = helper.get("userroles") userRoles = [] for r in roles: if r == 'devadmin': continue permissions = helper.get("userroles/" + r + "/permissions") permissions["name"] = r userRoles.append(permissions) helper.dumpConfig("org/userroles.json", userRoles)
import helper products = helper.get("apiproducts") apiProducts = [] for p in products: print("product=%s" % (p)) product = helper.get("apiproducts/" + p) apiProducts.append(product) helper.dumpConfig("org/apiProducts.json", apiProducts)
import helper # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/reports response = helper.get("reports") reports=[] for q in response["qualifier"]: report=helper.get("reports/"+q["name"]) reports.append(report) helper.dumpConfig("org/reports.json", reports)
import helper import constants # https://api.enterprise.apigee.com/v1/organizations/yemhuynh-eval/environments/test/targetservers for e in constants.ENVS: targetServers = [] relurl = "environments/" + e + "/targetservers" servers = helper.get(relurl) for name in servers: server = helper.get(relurl + "/" + name) targetServers.append(server) helper.dumpConfig("env/" + e + "/targetServers.json", targetServers)
import json import helper import constants # get env-specific kvms for e in constants.ENVS: response = helper.get("environments/" + e + "/keyvaluemaps") envKvm = [] for kvm in response: response = helper.get("environments/" + e + "/keyvaluemaps/" + kvm) envKvm.append(response) # now write to file helper.dumpConfig("env/" + e + "/kvms.json", envKvm)