Skip to content

Commit

Permalink
FIM Rest API Improvement (#80)
Browse files Browse the repository at this point in the history
Added custom exceptions to REST API in order to be used by ETSI OSM vimconn
  • Loading branch information
gabrik committed May 13, 2019
1 parent 2f91dde commit aa75c39
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/api/python/rest_api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ install:
rm -rf build dist fog05rest.egg-info

uninstall:
pip uninstall fog05rest -y
pip uninstall fog05rest -y

package:
python setup.py sdist bdist_wheel
34 changes: 34 additions & 0 deletions src/api/python/rest_api/fog05rest/fimerrors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2014,2018 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors: Gabriele Baldoni, ADLINK Technology Inc. - API v2



class FIMAuthExcetpion(Exception):
def __init__(self, message):
super(FIMAuthExcetpion, self).__init__(message)


class FIMAResouceExistingException(Exception):
def __init__(self, message):
super(FIMAResouceExistingException, self).__init__(message)


class FIMNotFoundException(Exception):
def __init__(self, message):
super(FIMNotFoundException, self).__init__(message)


class FIMTaskFailedException(Exception):
def __init__(self, message):
super(FIMTaskFailedException, self).__init__(message)
7 changes: 4 additions & 3 deletions src/api/python/rest_api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

setup(
name='fog05rest',
version='0.0.2',
version='0.0.3',
author='ADLINK',
packages=['fog05rest',],
install_requires=['requests'],
include_package_data=True,
description='Python 2 API fog05 REST Client',
description='Python API fog05 REST Client',
url='https://github.com/eclipse/fog05',
authon_email='gabriele.baldoni@adlinktech.com',
license='Apache 2.O or EPL 2.0',
Expand All @@ -34,6 +34,7 @@
'Intended Audience :: Telecommunications Industry',
'License :: OSI Approved :: Apache Software License',
'License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)',
'Programming Language :: Python :: 2'
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'
],
)

0 comments on commit aa75c39

Please sign in to comment.