コード例 #1
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def computehosts_update(host_id, data):
    """Update computehost. Only name changing may be proceeded."""
    if len(data) == 0:
        return api_utils.internal_error(status_code=400,
                                        descr="No data to update")
    else:
        return api_utils.render(host=_api.update_computehost(host_id, data))
コード例 #2
0
def computehosts_update(host_id, data):
    """Update computehost. Only name changing may be proceeded."""
    if len(data) == 0:
        return api_utils.internal_error(status_code=400,
                                        descr="No data to update")
    else:
        return api_utils.render(host=_api.update_computehost(host_id, data))
コード例 #3
0
ファイル: app.py プロジェクト: frossigneux/blazar
def make_json_error(ex):
    if isinstance(ex, werkzeug_exceptions.HTTPException):
        status_code = ex.code
        description = ex.description
    else:
        status_code = 500
        description = str(ex)
    return api_utils.render({'error': status_code,
                             'error_message': description},
                            status=status_code)
コード例 #4
0
ファイル: app.py プロジェクト: frossigneux/blazar
def version_list():
    return api_utils.render({
        "versions": [
            {"id": "v1.0",
             "status": "CURRENT",
             "links": [{"href": "{0}v1".format(flask.request.host_url),
                        "rel": "self"}]
             },
        ],
    }, status="300 Multiple Choices")
コード例 #5
0
ファイル: app.py プロジェクト: jakecoll/blazar
def make_json_error(ex):
    if isinstance(ex, werkzeug_exceptions.HTTPException):
        status_code = ex.code
        description = ex.description
    else:
        status_code = 500
        description = str(ex)
    return api_utils.render(
        {
            'error': status_code,
            'error_message': description
        },
        status=status_code)
コード例 #6
0
ファイル: app.py プロジェクト: jakecoll/blazar
def version_list():
    return api_utils.render(
        {
            "versions": [
                {
                    "id":
                    "v1.0",
                    "status":
                    "CURRENT",
                    "links": [{
                        "href": "{0}v1".format(flask.request.host_url),
                        "rel": "self"
                    }]
                },
            ],
        },
        status="300 Multiple Choices")
コード例 #7
0
ファイル: v1_0.py プロジェクト: tejaswibachu/blazar
def plugins_list():
    """List all possible plugins."""
    return api_utils.render(plugins=_api.get_plugins())
コード例 #8
0
ファイル: v1_0.py プロジェクト: tejaswibachu/blazar
def leases_update(lease_id, data):
    """Update lease. Only name changing and prolonging may be proceeded."""
    return api_utils.render(lease=_api.update_lease(lease_id, data))
コード例 #9
0
ファイル: v1_0.py プロジェクト: tejaswibachu/blazar
def leases_delete(lease_id):
    """Delete specified lease."""
    _api.delete_lease(lease_id)
    return api_utils.render()
コード例 #10
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def computehosts_create(data):
    """Create new computehost."""
    return api_utils.render(host=_api.create_computehost(data))
コード例 #11
0
ファイル: v1_0.py プロジェクト: tejaswibachu/blazar
def leases_get(lease_id):
    """Get lease by its ID."""
    return api_utils.render(lease=_api.get_lease(lease_id))
コード例 #12
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def leases_get(lease_id):
    """Get lease by its ID."""
    return api_utils.render(lease=_api.get_lease(lease_id))
コード例 #13
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def leases_delete(lease_id):
    """Delete specified lease."""
    _api.delete_lease(lease_id)
    return api_utils.render()
コード例 #14
0
def computehosts_delete(host_id):
    """Delete specified computehost."""
    _api.delete_computehost(host_id)
    return api_utils.render()
コード例 #15
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def leases_list():
    """List all existing leases."""
    return api_utils.render(leases=_api.get_leases())
コード例 #16
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def computehosts_get(host_id):
    """Get computehost by its ID."""
    return api_utils.render(host=_api.get_computehost(host_id))
コード例 #17
0
def computehosts_get(host_id):
    """Get computehost by its ID."""
    return api_utils.render(host=_api.get_computehost(host_id))
コード例 #18
0
def computehosts_create(data):
    """Create new computehost."""
    return api_utils.render(host=_api.create_computehost(data))
コード例 #19
0
def computehosts_list():
    """List all existing computehosts."""
    return api_utils.render(hosts=_api.get_computehosts())
コード例 #20
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def computehosts_delete(host_id):
    """Delete specified computehost."""
    _api.delete_computehost(host_id)
    return api_utils.render()
コード例 #21
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def leases_create(data):
    """Create new lease."""
    return api_utils.render(lease=_api.create_lease(data))
コード例 #22
0
ファイル: v1_0.py プロジェクト: tejaswibachu/blazar
def leases_list():
    """List all existing leases."""
    return api_utils.render(leases=_api.get_leases())
コード例 #23
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def leases_update(lease_id, data):
    """Update lease. Only name changing and prolonging may be proceeded."""
    return api_utils.render(lease=_api.update_lease(lease_id, data))
コード例 #24
0
ファイル: v1_0.py プロジェクト: tejaswibachu/blazar
def leases_create(data):
    """Create new lease."""
    return api_utils.render(lease=_api.create_lease(data))
コード例 #25
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def plugins_list():
    """List all possible plugins."""
    return api_utils.render(plugins=_api.get_plugins())
コード例 #26
0
ファイル: v1_0.py プロジェクト: NikolayStarodubtsev/blazar
def computehosts_list():
    """List all existing computehosts."""
    return api_utils.render(hosts=_api.get_computehosts())