Пример #1
0
def scale_ns(orc_id, ns_id):
    try:
        driver = manager.get_driver(request.blueprint, orc_id,
                                    database.msolo_db)
        empty_body, headers = driver.scale_ns(ns_id,
                                              args={
                                                  'payload': request.json,
                                                  'args':
                                                  request.args.to_dict()
                                              })
        return make_response('', 202, headers)
    except BadRequest as e:
        abort(400, description=e.description)
    except Unauthorized as e:
        abort(401, description=e.description)
    except Forbidden as e:
        abort(403, description=e.description)
    except (NfvoNotFound, NfvoCredentialsNotFound, NsNotFound) as e:
        abort(404, description=e.description)
    except Conflict as e:
        abort(409, description=e.description)
    except Unprocessable as e:
        abort(422, description=e.description)
    except ServerError as e:
        abort(500, description=e.description)
Пример #2
0
def get_ns_list(orc_id):
    try:
        driver = manager.get_driver(request.blueprint, orc_id,
                                    database.msolo_db)
        ns_list, headers = driver.get_ns_list(
            args={'args': request.args.to_dict()})
        return make_response(jsonify(ns_list), 200, headers)
    except BadRequest as e:
        abort(400, description=e.description)
    except Unauthorized as e:
        abort(401, description=e.description)
    except (NfvoNotFound, NfvoCredentialsNotFound) as e:
        abort(404, description=e.description)
    except ServerError as e:
        abort(500, description=e.description)