示例#1
0
def putCountriesConfig():
    body = request.get_json()
    MediationConfig.getCollection().update_one(MEDIATION_DOCUMENT,
                                               {"$set": {
                                                   "countries": body
                                               }})
    return jsonify(MediationConfig.getCountries())
示例#2
0
def enableCountry(country):
    body = request.get_json()
    enable = body["enable"]
    MediationConfig.getCollection().update_one(
        MEDIATION_DOCUMENT,
        {"$set": {
            "countries." + country + ".enabled": enable
        }})
    return getEnabledCountry(country)
示例#3
0
def enableLob(country, lobName):
    enable = request.get_json()["enable"]
    optionsPath = "lobs." + country + "." + lobName + ".options.enabled"
    MediationConfig.getCollection().update_one(MEDIATION_DOCUMENT,
                                               {"$set": {
                                                   optionsPath: enable
                                               }})
    return jsonify(
        MediationConfig.getLobWithCountry(country, lobName)["options"])
示例#4
0
def lobOptionsPUT(country, lobName):
    body = request.get_json()
    optionsPath = "lobs." + country + "." + lobName + ".options"
    MediationConfig.getCollection().update_one(MEDIATION_DOCUMENT,
                                               {"$set": {
                                                   optionsPath: body
                                               }})
    return jsonify(
        MediationConfig.getLobWithCountry(country, lobName)["options"])
示例#5
0
def enableFlow(country, lobName, flowName):
    body = request.get_json()
    enable = body["enable"]
    flow = MediationConfig.getLobWithCountry(country,
                                             lobName)["flows"][flowName]
    MediationConfig.getCollection().update_one(
        MEDIATION_DOCUMENT,
        {"$set": {
            "lobs." + flow["dataPath"] + ".enabled": enable
        }})
    return jsonify(
        MediationConfig.getLobWithCountry(
            country, lobName)["flows"][flowName]["options"])
示例#6
0
def putFlowOptions(country, lobName, flowName):
    body = request.get_json()
    flow = MediationConfig.getLobWithCountry(country,
                                             lobName)["flows"][flowName]
    res = MediationConfig.getCollection().update_one(
        MEDIATION_DOCUMENT, {"$set": {
            "lobs." + flow["dataPath"]: body
        }})
    return jsonify(
        MediationConfig.getLobWithCountry(
            country, lobName)["flows"][flowName]["options"])