2016-03-01 11:23:03 -05:00
|
|
|
from django.conf.urls import url
|
|
|
|
|
|
|
|
from extras.models import GRAPH_TYPE_INTERFACE, GRAPH_TYPE_SITE
|
2016-04-08 14:57:54 -04:00
|
|
|
from extras.api.views import GraphListView, TopologyMapView
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
from .views import *
|
|
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
|
|
|
|
# Sites
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^sites/$', SiteViewSet.as_view({'get': 'list'}), name='site_list'),
|
|
|
|
url(r'^sites/(?P<pk>\d+)/$', SiteViewSet.as_view({'get': 'retrieve'}), name='site_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
url(r'^sites/(?P<pk>\d+)/graphs/$', GraphListView.as_view(), {'type': GRAPH_TYPE_SITE}, name='site_graphs'),
|
|
|
|
|
|
|
|
# Rack groups
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^rack-groups/$', RackGroupViewSet.as_view({'get': 'list'}), name='rackgroup_list'),
|
|
|
|
url(r'^rack-groups/(?P<pk>\d+)/$', RackGroupViewSet.as_view({'get': 'retrieve'}), name='rackgroup_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
2016-08-10 11:52:27 -04:00
|
|
|
# Rack roles
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^rack-roles/$', RackRoleViewSet.as_view({'get': 'list'}), name='rackrole_list'),
|
|
|
|
url(r'^rack-roles/(?P<pk>\d+)/$', RackRoleViewSet.as_view({'get': 'retrieve'}), name='rackrole_detail'),
|
2016-08-10 11:52:27 -04:00
|
|
|
|
2016-03-01 11:23:03 -05:00
|
|
|
# Racks
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^racks/$', RackViewSet.as_view({'get': 'list'}), name='rack_list'),
|
|
|
|
url(r'^racks/(?P<pk>\d+)/$', RackViewSet.as_view({'get': 'retrieve'}), name='rack_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
url(r'^racks/(?P<pk>\d+)/rack-units/$', RackUnitListView.as_view(), name='rack_units'),
|
|
|
|
|
|
|
|
# Manufacturers
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^manufacturers/$', ManufacturerViewSet.as_view({'get': 'list'}), name='manufacturer_list'),
|
|
|
|
url(r'^manufacturers/(?P<pk>\d+)/$', ManufacturerViewSet.as_view({'get': 'retrieve'}), name='manufacturer_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
# Device types
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^device-types/$', DeviceTypeViewSet.as_view({'get': 'list'}), name='devicetype_list'),
|
|
|
|
url(r'^device-types/(?P<pk>\d+)/$', DeviceTypeViewSet.as_view({'get': 'retrieve'}), name='devicetype_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
# Device roles
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^device-roles/$', DeviceRoleViewSet.as_view({'get': 'list'}), name='devicerole_list'),
|
|
|
|
url(r'^device-roles/(?P<pk>\d+)/$', DeviceRoleViewSet.as_view({'get': 'retrieve'}), name='devicerole_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
# Platforms
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^platforms/$', PlatformViewSet.as_view({'get': 'list'}), name='platform_list'),
|
|
|
|
url(r'^platforms/(?P<pk>\d+)/$', PlatformViewSet.as_view({'get': 'retrieve'}), name='platform_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
# Devices
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^devices/$', DeviceViewSet.as_view({'get': 'list'}), name='device_list'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/$', DeviceViewSet.as_view({'get': 'retrieve'}), name='device_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
url(r'^devices/(?P<pk>\d+)/lldp-neighbors/$', LLDPNeighborsView.as_view(), name='device_lldp-neighbors'),
|
2017-01-24 17:12:16 -05:00
|
|
|
url(r'^devices/(?P<pk>\d+)/console-ports/$', ConsolePortViewSet.as_view({'get': 'list'}), name='device_consoleports'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/console-server-ports/$', ConsoleServerPortViewSet.as_view({'get': 'list'}), name='device_consoleserverports'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/power-ports/$', PowerPortViewSet.as_view({'get': 'list'}), name='device_powerports'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/power-outlets/$', PowerOutletViewSet.as_view({'get': 'list'}), name='device_poweroutlets'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/interfaces/$', InterfaceViewSet.as_view({'get': 'list'}), name='device_interfaces'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/device-bays/$', DeviceBayViewSet.as_view({'get': 'list'}), name='device_devicebays'),
|
|
|
|
url(r'^devices/(?P<pk>\d+)/modules/$', ModuleViewSet.as_view({'get': 'list'}), name='device_modules'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
# Console ports
|
|
|
|
url(r'^console-ports/(?P<pk>\d+)/$', ConsolePortView.as_view(), name='consoleport'),
|
|
|
|
|
|
|
|
# Power ports
|
|
|
|
url(r'^power-ports/(?P<pk>\d+)/$', PowerPortView.as_view(), name='powerport'),
|
|
|
|
|
|
|
|
# Interfaces
|
|
|
|
url(r'^interfaces/(?P<pk>\d+)/$', InterfaceDetailView.as_view(), name='interface_detail'),
|
2016-05-18 16:02:53 -04:00
|
|
|
url(r'^interfaces/(?P<pk>\d+)/graphs/$', GraphListView.as_view(), {'type': GRAPH_TYPE_INTERFACE},
|
|
|
|
name='interface_graphs'),
|
2016-07-15 21:12:35 -07:00
|
|
|
url(r'^interface-connections/$', InterfaceConnectionListView.as_view(), name='interfaceconnection_list'),
|
|
|
|
url(r'^interface-connections/(?P<pk>\d+)/$', InterfaceConnectionView.as_view(), name='interfaceconnection_detail'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
# Miscellaneous
|
|
|
|
url(r'^related-connections/$', RelatedConnectionsView.as_view(), name='related_connections'),
|
2016-04-08 14:57:54 -04:00
|
|
|
url(r'^topology-maps/(?P<slug>[\w-]+)/$', TopologyMapView.as_view(), name='topology_map'),
|
2016-03-01 11:23:03 -05:00
|
|
|
|
|
|
|
]
|