Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
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)
Ejemplo n.º 10
0
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)
Ejemplo n.º 11
0
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)