netbox-docker-plugin 1.18.0__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netbox_docker_plugin-1.18.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.0.0}/PKG-INFO +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/__init__.py +3 -3
- netbox_docker_plugin-2.0.0/netbox_docker_plugin/api/renderers.py +14 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/serializers.py +7 -37
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/views.py +13 -56
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/filtersets.py +0 -17
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/bind.py +1 -2
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/container.py +3 -12
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/env.py +1 -2
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/host.py +2 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/image.py +2 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/label.py +1 -2
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/mount.py +1 -2
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/network.py +2 -6
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/network_setting.py +1 -2
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/port.py +1 -2
- netbox_docker_plugin-2.0.0/netbox_docker_plugin/migrations/0030_alter_container_containerid_alter_container_hostname_and_more.py +86 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/container.py +12 -74
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/image.py +2 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/network.py +1 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/navigation.py +12 -24
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/signals.py +0 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tables.py +0 -31
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-layout.html +4 -18
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-logs.html +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container.html +21 -67
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host.html +5 -5
- netbox_docker_plugin-2.0.0/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +59 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/registry.html +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_actions.py +10 -34
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_api.py +9 -15
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_api_exec.py +2 -2
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_operation_view.py +9 -9
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_views.py +0 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/test_host_api.py +5 -5
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/test_host_views.py +3 -3
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/image/test_image_api.py +0 -37
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/volume/test_volume_api.py +5 -5
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/urls.py +0 -27
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/utilities/__init__.py +1 -14
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/container.py +1 -4
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/host.py +1 -12
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/image.py +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/network.py +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/registry.py +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/volume.py +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0/netbox_docker_plugin.egg-info}/PKG-INFO +1 -1
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin.egg-info/SOURCES.txt +1 -5
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/pyproject.toml +1 -1
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/api/renderers.py +0 -19
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/forms/device.py +0 -45
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/migrations/0030_container_cap_add.py +0 -26
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/migrations/0031_device_and_more.py +0 -66
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/templates/netbox_docker_plugin/host-graph.html +0 -211
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +0 -136
- netbox_docker_plugin-1.18.0/netbox_docker_plugin/views/device.py +0 -28
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/LICENSE +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/MANIFEST.in +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/README.md +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/urls.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/registry.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/volume.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0001_initial.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0002_image.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0003_image_size.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0004_volume.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0005_network.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0006_container_port_mount_label_env_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0007_remove_container_netbox_docker_plugin_container_unique_name_host__and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0008_alter_network_unique_together_network_networkid_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0009_remove_container_network_networksettings_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0010_container_containerid_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0011_host_token.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0012_host_state.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0013_host_netbox_url.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0014_container_operation.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0015_remove_mount_netbox_docker_plugin_mount_unique_volume_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0016_alter_env_value.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0017_network_state.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0018_alter_mount_volume_alter_networksetting_network.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0019_host_agent_version_host_docker_api_version.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0020_container_hostname.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0021_registry_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0022_bind_bind_netbox_docker_plugin_bind_unique_bind.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0023_delete_hosts.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0024_registry_host_alter_registry_name_and_more.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0025_alter_image_version.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0026_image_digest.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0027_container_restart_policy.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0028_mount_and_bind_read_only.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0029_alter_container_state.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/host.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/registry.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/volume.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-exec.html +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/network.html +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/volume.html +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templatetags/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templatetags/host.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/base.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_validation.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/test_replace_password.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/image/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/image/test_image_views.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/network/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/network/test_network_api.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/network/test_network_views.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/registry/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/registry/test_registry_api.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/registry/test_registry_views.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/test_init.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/volume/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/volume/test_volume_views.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/__init__.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/bind.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/env.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/label.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/mount.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/network_setting.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/port.py +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin.egg-info/top_level.txt +0 -0
- {netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/setup.cfg +0 -0
{netbox_docker_plugin-1.18.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.0.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: netbox-docker-plugin
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Manage Docker with Netbox & style.
|
|
5
5
|
Author-email: Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/SaaShup/netbox-docker-plugin
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Netbox Plugin Configuration"""
|
|
2
2
|
|
|
3
|
-
from extras.plugins import PluginConfig
|
|
4
3
|
from django.db.models.signals import post_migrate
|
|
4
|
+
from netbox.plugins import PluginConfig
|
|
5
5
|
from .utilities import create_webhook
|
|
6
6
|
|
|
7
7
|
class NetBoxDockerConfig(PluginConfig):
|
|
@@ -10,9 +10,9 @@ class NetBoxDockerConfig(PluginConfig):
|
|
|
10
10
|
name = "netbox_docker_plugin"
|
|
11
11
|
verbose_name = " NetBox Docker Plugin"
|
|
12
12
|
description = "Manage Docker"
|
|
13
|
-
version = "
|
|
14
|
-
max_version = "3.7.8"
|
|
13
|
+
version = "2.0.0"
|
|
15
14
|
base_url = "docker"
|
|
15
|
+
min_version = "4.0.0"
|
|
16
16
|
author= "Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>"
|
|
17
17
|
author_email= "vincent@saashup.com, david.jose.delassus@gmail.com"
|
|
18
18
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
""" Response renderers for Django Rest Framework """
|
|
2
|
+
|
|
3
|
+
from django.utils.encoding import smart_str
|
|
4
|
+
from rest_framework import renderers
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PlainTextRenderer(renderers.BaseRenderer):
|
|
8
|
+
""" text/plain renderer """
|
|
9
|
+
|
|
10
|
+
media_type = "text/plain"
|
|
11
|
+
format = "txt"
|
|
12
|
+
|
|
13
|
+
def render(self, data, accepted_media_type=None, renderer_context=None):
|
|
14
|
+
return smart_str(data, encoding=self.charset)
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/serializers.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# pylint: disable=E1101
|
|
4
4
|
|
|
5
5
|
from rest_framework import serializers
|
|
6
|
-
from utilities.
|
|
6
|
+
from utilities.query import dict_to_filter_params
|
|
7
7
|
from users.api.nested_serializers import NestedTokenSerializer
|
|
8
8
|
from netbox.api.serializers import NetBoxModelSerializer, WritableNestedSerializer
|
|
9
9
|
from ..models.host import Host
|
|
@@ -18,7 +18,6 @@ from ..models.container import (
|
|
|
18
18
|
Mount,
|
|
19
19
|
Bind,
|
|
20
20
|
NetworkSetting,
|
|
21
|
-
Device,
|
|
22
21
|
)
|
|
23
22
|
from ..models.registry import Registry
|
|
24
23
|
|
|
@@ -147,7 +146,6 @@ class NestedContainerSerializer(WritableNestedSerializer):
|
|
|
147
146
|
"restart_policy",
|
|
148
147
|
"operation",
|
|
149
148
|
"hostname",
|
|
150
|
-
"cap_add",
|
|
151
149
|
)
|
|
152
150
|
|
|
153
151
|
|
|
@@ -231,6 +229,7 @@ class ImageSerializer(NetBoxModelSerializer):
|
|
|
231
229
|
"containers",
|
|
232
230
|
"tags",
|
|
233
231
|
)
|
|
232
|
+
brief_fields = NestedImageSerializer.Meta.fields
|
|
234
233
|
|
|
235
234
|
|
|
236
235
|
class VolumeSerializer(NetBoxModelSerializer):
|
|
@@ -259,6 +258,7 @@ class VolumeSerializer(NetBoxModelSerializer):
|
|
|
259
258
|
"mounts",
|
|
260
259
|
"tags",
|
|
261
260
|
)
|
|
261
|
+
brief_fields = NestedVolumeSerializer.Meta.fields
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
class NetworkSerializer(NetBoxModelSerializer):
|
|
@@ -289,6 +289,7 @@ class NetworkSerializer(NetBoxModelSerializer):
|
|
|
289
289
|
"network_settings",
|
|
290
290
|
"tags",
|
|
291
291
|
)
|
|
292
|
+
brief_fields = NestedNetworkSerializer.Meta.fields
|
|
292
293
|
|
|
293
294
|
|
|
294
295
|
class PortSerializer(serializers.ModelSerializer):
|
|
@@ -373,19 +374,6 @@ class NetworkSettingSerializer(serializers.ModelSerializer):
|
|
|
373
374
|
fields = ("network",)
|
|
374
375
|
|
|
375
376
|
|
|
376
|
-
class DeviceSerializer(serializers.ModelSerializer):
|
|
377
|
-
"""Container Device Serializer class"""
|
|
378
|
-
|
|
379
|
-
class Meta:
|
|
380
|
-
"""Container Device Serializer Meta class"""
|
|
381
|
-
|
|
382
|
-
model = Device
|
|
383
|
-
fields = (
|
|
384
|
-
"host_path",
|
|
385
|
-
"container_path",
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
|
|
389
377
|
class ContainerSerializer(NetBoxModelSerializer):
|
|
390
378
|
"""Container Serializer class"""
|
|
391
379
|
|
|
@@ -400,7 +388,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
400
388
|
mounts = MountSerializer(many=True, required=False)
|
|
401
389
|
binds = BindSerializer(many=True, required=False)
|
|
402
390
|
network_settings = NetworkSettingSerializer(many=True, required=False)
|
|
403
|
-
devices = DeviceSerializer(many=True, required=False)
|
|
404
391
|
|
|
405
392
|
class Meta:
|
|
406
393
|
"""Container Serializer Meta class"""
|
|
@@ -419,19 +406,18 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
419
406
|
"ContainerID",
|
|
420
407
|
"hostname",
|
|
421
408
|
"restart_policy",
|
|
422
|
-
"cap_add",
|
|
423
409
|
"ports",
|
|
424
410
|
"env",
|
|
425
411
|
"labels",
|
|
426
412
|
"mounts",
|
|
427
413
|
"binds",
|
|
428
414
|
"network_settings",
|
|
429
|
-
"devices",
|
|
430
415
|
"custom_fields",
|
|
431
416
|
"created",
|
|
432
417
|
"last_updated",
|
|
433
418
|
"tags",
|
|
434
419
|
)
|
|
420
|
+
brief_fields = NestedContainerSerializer.Meta.fields
|
|
435
421
|
|
|
436
422
|
def validate(self, data):
|
|
437
423
|
attrs = data.copy()
|
|
@@ -441,13 +427,11 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
441
427
|
attrs.pop("mounts", None)
|
|
442
428
|
attrs.pop("binds", None)
|
|
443
429
|
attrs.pop("network_settings", None)
|
|
444
|
-
attrs.pop("devices", None)
|
|
445
430
|
|
|
446
431
|
super().validate(attrs)
|
|
447
432
|
|
|
448
433
|
return data
|
|
449
434
|
|
|
450
|
-
# pylint: disable=R0912
|
|
451
435
|
def create(self, validated_data):
|
|
452
436
|
ports_data = validated_data.pop("ports", None)
|
|
453
437
|
env_data = validated_data.pop("env", None)
|
|
@@ -455,7 +439,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
455
439
|
mounts_data = validated_data.pop("mounts", None)
|
|
456
440
|
binds_data = validated_data.pop("binds", None)
|
|
457
441
|
network_settings_data = validated_data.pop("network_settings", None)
|
|
458
|
-
devices_data = validated_data.pop("devices", None)
|
|
459
442
|
|
|
460
443
|
container = super().create(validated_data)
|
|
461
444
|
|
|
@@ -489,15 +472,8 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
489
472
|
obj.full_clean()
|
|
490
473
|
obj.save()
|
|
491
474
|
|
|
492
|
-
if devices_data is not None:
|
|
493
|
-
for device in devices_data:
|
|
494
|
-
obj = Device(container=container, **device)
|
|
495
|
-
obj.full_clean()
|
|
496
|
-
obj.save()
|
|
497
|
-
|
|
498
475
|
return container
|
|
499
476
|
|
|
500
|
-
# pylint: disable=R0912
|
|
501
477
|
def update(self, instance, validated_data):
|
|
502
478
|
ports_data = validated_data.pop("ports", None)
|
|
503
479
|
env_data = validated_data.pop("env", None)
|
|
@@ -505,7 +481,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
505
481
|
mounts_data = validated_data.pop("mounts", None)
|
|
506
482
|
binds_data = validated_data.pop("binds", None)
|
|
507
483
|
network_settings_data = validated_data.pop("network_settings", None)
|
|
508
|
-
devices_data = validated_data.pop("devices", None)
|
|
509
484
|
|
|
510
485
|
container = super().update(instance, validated_data)
|
|
511
486
|
|
|
@@ -545,13 +520,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
545
520
|
obj.full_clean()
|
|
546
521
|
obj.save()
|
|
547
522
|
|
|
548
|
-
if devices_data is not None:
|
|
549
|
-
Device.objects.filter(container=container).delete()
|
|
550
|
-
for device in devices_data:
|
|
551
|
-
obj = Device(container=container, **device)
|
|
552
|
-
obj.full_clean()
|
|
553
|
-
obj.save()
|
|
554
|
-
|
|
555
523
|
return container
|
|
556
524
|
|
|
557
525
|
|
|
@@ -580,6 +548,7 @@ class RegistrySerializer(NetBoxModelSerializer):
|
|
|
580
548
|
"email",
|
|
581
549
|
"images",
|
|
582
550
|
)
|
|
551
|
+
brief_fields = NestedRegistrySerializer.Meta.fields
|
|
583
552
|
|
|
584
553
|
|
|
585
554
|
class HostSerializer(NetBoxModelSerializer):
|
|
@@ -620,6 +589,7 @@ class HostSerializer(NetBoxModelSerializer):
|
|
|
620
589
|
"containers",
|
|
621
590
|
"registries",
|
|
622
591
|
)
|
|
592
|
+
brief_fields = NestedHostSerializer.Meta.fields
|
|
623
593
|
|
|
624
594
|
|
|
625
595
|
class ContainerCommandSerializer(serializers.Serializer):
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/views.py
RENAMED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from collections.abc import Sequence
|
|
4
4
|
import json
|
|
5
5
|
import requests
|
|
6
|
-
from django.utils.html import escape
|
|
7
6
|
from rest_framework import status
|
|
8
7
|
from rest_framework.renderers import JSONRenderer
|
|
9
8
|
from rest_framework.decorators import action
|
|
@@ -16,7 +15,7 @@ from drf_spectacular.utils import (
|
|
|
16
15
|
from users.models import Token
|
|
17
16
|
from netbox.api.viewsets import NetBoxModelViewSet
|
|
18
17
|
from .. import filtersets
|
|
19
|
-
from .renderers import
|
|
18
|
+
from .renderers import PlainTextRenderer
|
|
20
19
|
from .serializers import (
|
|
21
20
|
HostSerializer,
|
|
22
21
|
ImageSerializer,
|
|
@@ -72,47 +71,6 @@ class ImageViewSet(NetBoxModelViewSet):
|
|
|
72
71
|
serializer_class = ImageSerializer
|
|
73
72
|
http_method_names = ["get", "post", "patch", "delete", "options"]
|
|
74
73
|
|
|
75
|
-
@extend_schema(
|
|
76
|
-
operation_id="plugins_docker_image_force_pull",
|
|
77
|
-
responses={
|
|
78
|
-
(200, "application/json"): OpenApiResponse(response=str),
|
|
79
|
-
(502, "application/json"): OpenApiResponse(response=str),
|
|
80
|
-
},
|
|
81
|
-
)
|
|
82
|
-
@action(
|
|
83
|
-
detail=True,
|
|
84
|
-
methods=["post"],
|
|
85
|
-
renderer_classes=[JSONRenderer],
|
|
86
|
-
)
|
|
87
|
-
def force_pull(self, _request, **_kwargs):
|
|
88
|
-
""" Force pull an existing image """
|
|
89
|
-
|
|
90
|
-
image: Image = self.get_object()
|
|
91
|
-
agent_url = image.host.endpoint
|
|
92
|
-
|
|
93
|
-
url = f"{agent_url}/api/engine/images"
|
|
94
|
-
|
|
95
|
-
try:
|
|
96
|
-
serializer = self.get_serializer(image)
|
|
97
|
-
data = serializer.data
|
|
98
|
-
data["force"] = True
|
|
99
|
-
|
|
100
|
-
resp = requests.post(url, timeout=10, json={"data": data})
|
|
101
|
-
resp.raise_for_status()
|
|
102
|
-
|
|
103
|
-
except requests.HTTPError:
|
|
104
|
-
return Response(
|
|
105
|
-
{"success": False, "payload": resp.text},
|
|
106
|
-
status=status.HTTP_502_BAD_GATEWAY,
|
|
107
|
-
content_type="application/json",
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
return Response(
|
|
111
|
-
{"success": True, "payload": resp.json()},
|
|
112
|
-
status=status.HTTP_200_OK,
|
|
113
|
-
content_type="application/json",
|
|
114
|
-
)
|
|
115
|
-
|
|
116
74
|
|
|
117
75
|
class VolumeViewSet(NetBoxModelViewSet):
|
|
118
76
|
"""Volume view set class"""
|
|
@@ -136,7 +94,6 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
136
94
|
"""Container view set class"""
|
|
137
95
|
|
|
138
96
|
queryset = Container.objects.prefetch_related(
|
|
139
|
-
"devices",
|
|
140
97
|
"network_settings",
|
|
141
98
|
"mounts",
|
|
142
99
|
"binds",
|
|
@@ -154,13 +111,13 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
154
111
|
@extend_schema(
|
|
155
112
|
operation_id="plugins_docker_container_logs",
|
|
156
113
|
responses={
|
|
157
|
-
(200, "text/
|
|
114
|
+
(200, "text/plain"): OpenApiResponse(
|
|
158
115
|
response=str,
|
|
159
116
|
examples=[
|
|
160
117
|
OpenApiExample(
|
|
161
118
|
"Container's logs",
|
|
162
119
|
value="Hello World",
|
|
163
|
-
media_type="text/
|
|
120
|
+
media_type="text/plain",
|
|
164
121
|
),
|
|
165
122
|
],
|
|
166
123
|
),
|
|
@@ -179,7 +136,7 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
179
136
|
@action(
|
|
180
137
|
detail=True,
|
|
181
138
|
methods=["get"],
|
|
182
|
-
renderer_classes=[
|
|
139
|
+
renderer_classes=[PlainTextRenderer],
|
|
183
140
|
)
|
|
184
141
|
def logs(self, _request, **_kwargs):
|
|
185
142
|
"""Fetch container's logs"""
|
|
@@ -196,22 +153,22 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
196
153
|
|
|
197
154
|
except requests.HTTPError:
|
|
198
155
|
return Response(
|
|
199
|
-
|
|
156
|
+
resp.text,
|
|
200
157
|
status=status.HTTP_502_BAD_GATEWAY,
|
|
201
|
-
content_type="text/
|
|
158
|
+
content_type="text/plain",
|
|
202
159
|
)
|
|
203
160
|
|
|
204
161
|
return Response(
|
|
205
|
-
|
|
162
|
+
resp.text,
|
|
206
163
|
status=status.HTTP_200_OK,
|
|
207
|
-
content_type="text/
|
|
164
|
+
content_type="text/plain",
|
|
208
165
|
)
|
|
209
166
|
|
|
210
167
|
@extend_schema(
|
|
211
168
|
operation_id="plugins_docker_container_exec",
|
|
212
169
|
request=ContainerCommandSerializer,
|
|
213
170
|
responses={
|
|
214
|
-
(200, "
|
|
171
|
+
(200, "text/plain"): OpenApiResponse(
|
|
215
172
|
response=str,
|
|
216
173
|
examples=[
|
|
217
174
|
OpenApiExample(
|
|
@@ -221,13 +178,13 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
221
178
|
),
|
|
222
179
|
],
|
|
223
180
|
),
|
|
224
|
-
(502, "text/
|
|
181
|
+
(502, "text/plain"): OpenApiResponse(
|
|
225
182
|
response=str,
|
|
226
183
|
examples=[
|
|
227
184
|
OpenApiExample(
|
|
228
185
|
"Engine error",
|
|
229
186
|
value="Error as returned by Agent",
|
|
230
|
-
media_type="text/
|
|
187
|
+
media_type="text/plain",
|
|
231
188
|
),
|
|
232
189
|
],
|
|
233
190
|
),
|
|
@@ -258,9 +215,9 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
258
215
|
|
|
259
216
|
except requests.HTTPError:
|
|
260
217
|
return Response(
|
|
261
|
-
|
|
218
|
+
resp.text,
|
|
262
219
|
status=status.HTTP_502_BAD_GATEWAY,
|
|
263
|
-
content_type="text/
|
|
220
|
+
content_type="text/plain",
|
|
264
221
|
)
|
|
265
222
|
|
|
266
223
|
return Response(data=json.loads(resp.text))
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/filtersets.py
RENAMED
|
@@ -15,7 +15,6 @@ from .models.container import (
|
|
|
15
15
|
Mount,
|
|
16
16
|
Bind,
|
|
17
17
|
NetworkSetting,
|
|
18
|
-
Device,
|
|
19
18
|
)
|
|
20
19
|
from .models.registry import Registry
|
|
21
20
|
|
|
@@ -289,19 +288,3 @@ class NetworkSettingFilterSet(BaseFilterSet):
|
|
|
289
288
|
|
|
290
289
|
model = NetworkSetting
|
|
291
290
|
fields = ("id",)
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
class DeviceFilterSet(BaseFilterSet):
|
|
295
|
-
"""Device filterset definition class"""
|
|
296
|
-
|
|
297
|
-
container_id = ModelMultipleChoiceFilter(
|
|
298
|
-
field_name="container_id",
|
|
299
|
-
queryset=Container.objects.all(),
|
|
300
|
-
label="Container (ID)",
|
|
301
|
-
)
|
|
302
|
-
|
|
303
|
-
class Meta:
|
|
304
|
-
"""Device filterset definition meta class"""
|
|
305
|
-
|
|
306
|
-
model = Device
|
|
307
|
-
fields = ("id",)
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/bind.py
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Mount Form definition"""
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
|
-
from utilities.forms.mixins import BootstrapMixin
|
|
5
4
|
from utilities.forms.fields import (
|
|
6
5
|
DynamicModelMultipleChoiceField,
|
|
7
6
|
DynamicModelChoiceField,
|
|
@@ -12,7 +11,7 @@ from netbox.forms import (
|
|
|
12
11
|
from ..models.container import Bind, Container
|
|
13
12
|
|
|
14
13
|
|
|
15
|
-
class BindForm(
|
|
14
|
+
class BindForm(forms.ModelForm):
|
|
16
15
|
"""Bind form definition class"""
|
|
17
16
|
|
|
18
17
|
container = DynamicModelChoiceField(
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/container.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Container Forms definitions"""
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
|
+
from utilities.forms.rendering import FieldSet
|
|
4
5
|
from utilities.forms.fields import (
|
|
5
6
|
TagFilterField,
|
|
6
7
|
DynamicModelMultipleChoiceField,
|
|
@@ -14,11 +15,7 @@ from netbox.forms import (
|
|
|
14
15
|
)
|
|
15
16
|
from ..models.volume import Volume
|
|
16
17
|
from ..models.host import Host
|
|
17
|
-
from ..models.container import
|
|
18
|
-
Container,
|
|
19
|
-
ContainerRestartPolicyChoices,
|
|
20
|
-
ContainerCapAddChoices,
|
|
21
|
-
)
|
|
18
|
+
from ..models.container import Container, ContainerRestartPolicyChoices
|
|
22
19
|
from ..models.image import Image
|
|
23
20
|
|
|
24
21
|
|
|
@@ -34,7 +31,6 @@ class ContainerForm(NetBoxModelForm):
|
|
|
34
31
|
required=True,
|
|
35
32
|
query_params={"host_id": "$host"},
|
|
36
33
|
)
|
|
37
|
-
cap_add = forms.MultipleChoiceField(choices=ContainerCapAddChoices, required=False)
|
|
38
34
|
|
|
39
35
|
class Meta:
|
|
40
36
|
"""Container form definition Meta class"""
|
|
@@ -46,7 +42,6 @@ class ContainerForm(NetBoxModelForm):
|
|
|
46
42
|
"name",
|
|
47
43
|
"hostname",
|
|
48
44
|
"restart_policy",
|
|
49
|
-
"cap_add",
|
|
50
45
|
"tags",
|
|
51
46
|
)
|
|
52
47
|
labels = {
|
|
@@ -55,7 +50,6 @@ class ContainerForm(NetBoxModelForm):
|
|
|
55
50
|
"image": "Image",
|
|
56
51
|
"hostname": "Hostname",
|
|
57
52
|
"restart_policy": "Restart Policy",
|
|
58
|
-
"cap_add": "Add Host capabilities",
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
|
|
@@ -68,7 +62,6 @@ class ContainerEditForm(NetBoxModelForm):
|
|
|
68
62
|
required=True,
|
|
69
63
|
query_params={"host_id": "$host"},
|
|
70
64
|
)
|
|
71
|
-
cap_add = forms.MultipleChoiceField(choices=ContainerCapAddChoices, required=False)
|
|
72
65
|
|
|
73
66
|
class Meta:
|
|
74
67
|
"""Container form definition Meta class"""
|
|
@@ -79,7 +72,6 @@ class ContainerEditForm(NetBoxModelForm):
|
|
|
79
72
|
"name",
|
|
80
73
|
"hostname",
|
|
81
74
|
"restart_policy",
|
|
82
|
-
"cap_add",
|
|
83
75
|
"tags",
|
|
84
76
|
)
|
|
85
77
|
labels = {
|
|
@@ -87,7 +79,6 @@ class ContainerEditForm(NetBoxModelForm):
|
|
|
87
79
|
"image": "Image",
|
|
88
80
|
"hostname": "Hostname",
|
|
89
81
|
"restart_policy": "Restart Policy",
|
|
90
|
-
"cap_add": "Add Host capabilities",
|
|
91
82
|
}
|
|
92
83
|
|
|
93
84
|
|
|
@@ -159,7 +150,7 @@ class ContainerBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
159
150
|
)
|
|
160
151
|
|
|
161
152
|
model = Container
|
|
162
|
-
fieldsets = (("
|
|
153
|
+
fieldsets = (FieldSet("restart_policy", "hostname", name="General"),)
|
|
163
154
|
|
|
164
155
|
|
|
165
156
|
class ContainerOperationForm(NetBoxModelForm):
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/env.py
RENAMED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import DynamicModelChoiceField
|
|
5
|
-
from utilities.forms.mixins import BootstrapMixin
|
|
6
5
|
from ..models.container import Env, Container
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
class EnvForm(
|
|
8
|
+
class EnvForm(forms.ModelForm):
|
|
10
9
|
"""Env form definition class"""
|
|
11
10
|
|
|
12
11
|
container = DynamicModelChoiceField(
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/host.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Host Forms definitions"""
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
|
+
from utilities.forms.rendering import FieldSet
|
|
4
5
|
from utilities.forms.fields import TagFilterField
|
|
5
6
|
from netbox.forms import (
|
|
6
7
|
NetBoxModelForm,
|
|
@@ -70,4 +71,4 @@ class HostBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
70
71
|
)
|
|
71
72
|
|
|
72
73
|
model = Host
|
|
73
|
-
fieldsets = (("
|
|
74
|
+
fieldsets = (FieldSet("endpoint", name="General"),)
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/image.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Image Forms definitions"""
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
|
+
from utilities.forms.rendering import FieldSet
|
|
4
5
|
from utilities.forms.fields import (
|
|
5
6
|
TagFilterField,
|
|
6
7
|
DynamicModelMultipleChoiceField,
|
|
@@ -101,4 +102,4 @@ class ImageBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
101
102
|
)
|
|
102
103
|
|
|
103
104
|
model = Image
|
|
104
|
-
fieldsets = (("
|
|
105
|
+
fieldsets = (FieldSet("version", name="General"),)
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/label.py
RENAMED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import DynamicModelChoiceField
|
|
5
|
-
from utilities.forms.mixins import BootstrapMixin
|
|
6
5
|
from ..models.container import Label, Container
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
class LabelForm(
|
|
8
|
+
class LabelForm(forms.ModelForm):
|
|
10
9
|
"""Label form definition class"""
|
|
11
10
|
|
|
12
11
|
container = DynamicModelChoiceField(
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/mount.py
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Mount Form definition"""
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
|
-
from utilities.forms.mixins import BootstrapMixin
|
|
5
4
|
from utilities.forms.fields import (
|
|
6
5
|
DynamicModelMultipleChoiceField,
|
|
7
6
|
DynamicModelChoiceField,
|
|
@@ -13,7 +12,7 @@ from ..models.container import Mount, Container
|
|
|
13
12
|
from ..models.volume import Volume
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
class MountForm(
|
|
15
|
+
class MountForm(forms.ModelForm):
|
|
17
16
|
"""Mount form definition class"""
|
|
18
17
|
|
|
19
18
|
container = DynamicModelChoiceField(
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/network.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Network Forms definitions"""
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
|
+
from utilities.forms.rendering import FieldSet
|
|
4
5
|
from utilities.forms.fields import TagFilterField, DynamicModelMultipleChoiceField
|
|
5
6
|
from utilities.choices import ChoiceSet
|
|
6
7
|
from netbox.forms import (
|
|
@@ -103,9 +104,4 @@ class NetworkBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
103
104
|
NetworkID = forms.CharField(required=False, label="NetworkID")
|
|
104
105
|
|
|
105
106
|
model = Network
|
|
106
|
-
fieldsets =
|
|
107
|
-
(
|
|
108
|
-
"General",
|
|
109
|
-
("driver", "NetworkID"),
|
|
110
|
-
),
|
|
111
|
-
)
|
|
107
|
+
fieldsets =(FieldSet("driver", "NetworkID", name="General"),)
|
|
@@ -5,7 +5,6 @@ from utilities.forms.fields import (
|
|
|
5
5
|
DynamicModelMultipleChoiceField,
|
|
6
6
|
DynamicModelChoiceField,
|
|
7
7
|
)
|
|
8
|
-
from utilities.forms.mixins import BootstrapMixin
|
|
9
8
|
from netbox.forms import (
|
|
10
9
|
NetBoxModelFilterSetForm,
|
|
11
10
|
)
|
|
@@ -13,7 +12,7 @@ from ..models.container import NetworkSetting, Container
|
|
|
13
12
|
from ..models.network import Network
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
class NetworkSettingForm(
|
|
15
|
+
class NetworkSettingForm(forms.ModelForm):
|
|
17
16
|
"""NetworkSetting form definition class"""
|
|
18
17
|
|
|
19
18
|
container = DynamicModelChoiceField(
|
{netbox_docker_plugin-1.18.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/port.py
RENAMED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import DynamicModelChoiceField
|
|
5
|
-
from utilities.forms.mixins import BootstrapMixin
|
|
6
5
|
from ..models.container import Port, Container
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
class PortForm(
|
|
8
|
+
class PortForm(forms.ModelForm):
|
|
10
9
|
"""Port form definition class"""
|
|
11
10
|
|
|
12
11
|
container = DynamicModelChoiceField(
|