Esempio n. 1
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.UsersRootView

# Users and groups
router.register("users", views.UserViewSet)
router.register("groups", views.GroupViewSet)

# Tokens
router.register("tokens", views.TokenViewSet)

# Permissions
router.register("permissions", views.ObjectPermissionViewSet)

# User preferences
router.register("config", views.UserConfigViewSet, basename="userconfig")

app_name = "users-api"
urlpatterns = router.urls
"""API for Custom Jobs ."""

from django.urls import path
from nautobot.core.api import OrderedDefaultRouter

from nautobot_golden_config.api import views

router = OrderedDefaultRouter()
router.APIRootView = views.GoldenConfigRootView
router.register("compliance-feature", views.ComplianceFeatureViewSet)
router.register("compliance-rule", views.ComplianceRuleViewSet)
router.register("config-compliance", views.ConfigComplianceViewSet)
router.register("golden-config", views.GoldenConfigViewSet)
router.register("golden-config-settings", views.GoldenConfigSettingViewSet)
router.register("config-remove", views.ConfigRemoveViewSet)
router.register("config-replace", views.ConfigReplaceViewSet)
urlpatterns = router.urls
urlpatterns.append(
    path(
        "sotagg/<uuid:pk>/",
        views.SOTAggDeviceDetailView.as_view(),
        name="device_detail",
    ))
Esempio n. 3
0
from django.urls import include, path

from nautobot.core.api import OrderedDefaultRouter
from dummy_plugin.api.views import DummyViewSet, DummyModelWebhook


router = OrderedDefaultRouter()
router.register("models", DummyViewSet)

urlpatterns = [
    path("webhook/", DummyModelWebhook.as_view(), name="dummymodel_webhook"),  # URL path for testing plugin webhooks
    path("", include(router.urls)),
]
Esempio n. 4
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.TenancyRootView

# Tenants
router.register("tenant-groups", views.TenantGroupViewSet)
router.register("tenants", views.TenantViewSet)

app_name = "tenancy-api"
urlpatterns = router.urls
Esempio n. 5
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.CircuitsRootView

# Providers
router.register("providers", views.ProviderViewSet)

# Circuits
router.register("circuit-types", views.CircuitTypeViewSet)
router.register("circuits", views.CircuitViewSet)
router.register("circuit-terminations", views.CircuitTerminationViewSet)

router.register("provider-networks", views.ProviderNetworkViewSet)

app_name = "circuits-api"
urlpatterns = router.urls
Esempio n. 6
0
from django.urls import include, path

from nautobot.core.api import OrderedDefaultRouter
from example_plugin.api.views import ExampleModelViewSet, ExampleModelWebhook

router = OrderedDefaultRouter()
router.register("models", ExampleModelViewSet)

urlpatterns = [
    path("webhook/",
         ExampleModelWebhook.as_view(),
         name="examplemodel_webhook"),  # URL path for testing plugin webhooks
    path("", include(router.urls)),
]
Esempio n. 7
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.IPAMRootView

# VRFs
router.register("vrfs", views.VRFViewSet)

# Route targets
router.register("route-targets", views.RouteTargetViewSet)

# RIRs
router.register("rirs", views.RIRViewSet)

# Aggregates
router.register("aggregates", views.AggregateViewSet)

# Prefixes
router.register("roles", views.RoleViewSet)
router.register("prefixes", views.PrefixViewSet)

# IP addresses
router.register("ip-addresses", views.IPAddressViewSet)

# VLANs
router.register("vlan-groups", views.VLANGroupViewSet)
router.register("vlans", views.VLANViewSet)

# Services
router.register("services", views.ServiceViewSet)
Esempio n. 8
0
from nautobot.core.api import OrderedDefaultRouter
from . import views


router = OrderedDefaultRouter()
router.APIRootView = views.ExtrasRootView

# Computed Fields
router.register("computed-fields", views.ComputedFieldViewSet)

# Config contexts
router.register("config-contexts", views.ConfigContextViewSet)

# Config context schemas
router.register("config-context-schemas", views.ConfigContextSchemaViewSet)

# ContentTypes
router.register("content-types", views.ContentTypeViewSet)

# Custom fields
router.register("custom-fields", views.CustomFieldViewSet)
router.register("custom-field-choices", views.CustomFieldChoiceViewSet)

# Custom Links
router.register("custom-links", views.CustomLinkViewSet)

# Export templates
router.register("export-templates", views.ExportTemplateViewSet)

# Git repositories
router.register("git-repositories", views.GitRepositoryViewSet)
Esempio n. 9
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.DCIMRootView

# Sites
router.register("regions", views.RegionViewSet)
router.register("sites", views.SiteViewSet)

# Racks
router.register("rack-groups", views.RackGroupViewSet)
router.register("rack-roles", views.RackRoleViewSet)
router.register("racks", views.RackViewSet)
router.register("rack-reservations", views.RackReservationViewSet)

# Device types
router.register("manufacturers", views.ManufacturerViewSet)
router.register("device-types", views.DeviceTypeViewSet)

# Device type components
router.register("console-port-templates", views.ConsolePortTemplateViewSet)
router.register("console-server-port-templates",
                views.ConsoleServerPortTemplateViewSet)
router.register("power-port-templates", views.PowerPortTemplateViewSet)
router.register("power-outlet-templates", views.PowerOutletTemplateViewSet)
router.register("interface-templates", views.InterfaceTemplateViewSet)
router.register("front-port-templates", views.FrontPortTemplateViewSet)
router.register("rear-port-templates", views.RearPortTemplateViewSet)
router.register("device-bay-templates", views.DeviceBayTemplateViewSet)
Esempio n. 10
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.ExtrasRootView

# Custom fields
router.register("custom-fields", views.CustomFieldViewSet)

# Export templates
router.register("export-templates", views.ExportTemplateViewSet)

# Tags
router.register("tags", views.TagViewSet)

# Git repositories
router.register("git-repositories", views.GitRepositoryViewSet)

# Image attachments
router.register("image-attachments", views.ImageAttachmentViewSet)

# Config contexts
router.register("config-contexts", views.ConfigContextViewSet)

# Jobs
router.register("jobs", views.JobViewSet, basename="job")

# Change logging
router.register("object-changes", views.ObjectChangeViewSet)

# Job Results
Esempio n. 11
0
from nautobot.core.api import OrderedDefaultRouter
from . import views

router = OrderedDefaultRouter()
router.APIRootView = views.VirtualizationRootView

# Clusters
router.register("cluster-types", views.ClusterTypeViewSet)
router.register("cluster-groups", views.ClusterGroupViewSet)
router.register("clusters", views.ClusterViewSet)

# VirtualMachines
router.register("virtual-machines", views.VirtualMachineViewSet)
router.register("interfaces", views.VMInterfaceViewSet)

app_name = "virtualization-api"
urlpatterns = router.urls