Revision 0be1a55e api/urls.py

b/api/urls.py
7 7
from piston.resource import Resource
8 8
from synnefo.api.handlers import *
9 9
from synnefo.api.authentication import TokenAuthentication
10
from synnefo.api.faults import fault
10 11

  
11 12
auth = TokenAuthentication()
12 13

  
14
def notFound(request):
15
    return fault.itemNotFound.response
16

  
13 17
limit_handler = Resource(LimitHandler, auth)
14 18
server_handler = Resource(ServerHandler, auth)
15 19
server_address_handler = Resource(ServerAddressHandler, auth)
......
34 38
    url(r'^images/(?P<id>[^/]+)$', image_handler),
35 39
    url(r'^shared_ip_groups$', shared_ip_group_handler),
36 40
    url(r'^shared_ip_groups/(?P<id>[^/]+)$', shared_ip_group_handler),
41
    (r'^.+', notFound), # catch-all
37 42
)
38 43

  
39 44
version_handler = Resource(VersionHandler)
......
42 47
    url(r'^(?P<number>[^/]+)/?$', version_handler),
43 48
    url(r'^$', version_handler),
44 49
    (r'^v1.0/', include(v10patterns)),
50
    (r'^.+', notFound), # catch-all
45 51
)

Also available in: Unified diff