netbox-docker-plugin 1.19.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.19.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.0.0}/PKG-INFO +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/__init__.py +6 -7
- netbox_docker_plugin-2.0.0/netbox_docker_plugin/api/renderers.py +14 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/serializers.py +7 -39
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/views.py +13 -56
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/filtersets.py +0 -17
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/bind.py +1 -2
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/container.py +3 -12
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/env.py +1 -2
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/host.py +2 -11
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/image.py +2 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/label.py +1 -2
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/mount.py +1 -2
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/network.py +2 -6
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/network_setting.py +1 -2
- {netbox_docker_plugin-1.19.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.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/container.py +12 -77
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/host.py +0 -29
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/image.py +2 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/network.py +1 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/navigation.py +12 -24
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/signals.py +0 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tables.py +0 -31
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-layout.html +4 -18
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-logs.html +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container.html +21 -67
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host.html +40 -46
- netbox_docker_plugin-2.0.0/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +59 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/registry.html +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_actions.py +10 -66
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_api.py +9 -15
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_api_exec.py +2 -2
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_operation_view.py +9 -9
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_views.py +0 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/test_host_api.py +5 -6
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/test_host_views.py +3 -3
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/image/test_image_api.py +0 -37
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/volume/test_volume_api.py +5 -5
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/urls.py +0 -32
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/utilities/__init__.py +2 -28
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/container.py +1 -4
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/host.py +1 -23
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/image.py +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/network.py +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/registry.py +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/volume.py +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0/netbox_docker_plugin.egg-info}/PKG-INFO +1 -1
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin.egg-info/SOURCES.txt +1 -6
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/pyproject.toml +1 -1
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/api/renderers.py +0 -19
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/forms/device.py +0 -45
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/migrations/0030_container_cap_add.py +0 -26
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/migrations/0031_device_and_more.py +0 -66
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/migrations/0032_host_operation.py +0 -20
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/templates/netbox_docker_plugin/host-graph.html +0 -211
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +0 -136
- netbox_docker_plugin-1.19.0/netbox_docker_plugin/views/device.py +0 -28
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/LICENSE +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/MANIFEST.in +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/README.md +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/api/urls.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/registry.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/forms/volume.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0001_initial.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0002_image.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0003_image_size.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0004_volume.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0005_network.py +0 -0
- {netbox_docker_plugin-1.19.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.19.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.19.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.19.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.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0010_container_containerid_and_more.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0011_host_token.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0012_host_state.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0013_host_netbox_url.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0014_container_operation.py +0 -0
- {netbox_docker_plugin-1.19.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.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0016_alter_env_value.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0017_network_state.py +0 -0
- {netbox_docker_plugin-1.19.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.19.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.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0020_container_hostname.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0021_registry_and_more.py +0 -0
- {netbox_docker_plugin-1.19.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.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0023_delete_hosts.py +0 -0
- {netbox_docker_plugin-1.19.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.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0025_alter_image_version.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0026_image_digest.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0027_container_restart_policy.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0028_mount_and_bind_read_only.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/0029_alter_container_state.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/migrations/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/registry.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/models/volume.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-exec.html +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/network.html +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templates/netbox_docker_plugin/volume.html +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templatetags/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/templatetags/host.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/base.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/container/test_container_validation.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/host/test_replace_password.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/image/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/image/test_image_views.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/network/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/network/test_network_api.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/network/test_network_views.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/registry/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/registry/test_registry_api.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/registry/test_registry_views.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/test_init.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/volume/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/tests/volume/test_volume_views.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/__init__.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/bind.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/env.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/label.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/mount.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/network_setting.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin/views/port.py +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/netbox_docker_plugin.egg-info/top_level.txt +0 -0
- {netbox_docker_plugin-1.19.0 → netbox_docker_plugin-2.0.0}/setup.cfg +0 -0
{netbox_docker_plugin-1.19.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,24 +1,23 @@
|
|
|
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
|
-
|
|
8
7
|
class NetBoxDockerConfig(PluginConfig):
|
|
9
8
|
"""Plugin Config Class"""
|
|
10
9
|
|
|
11
10
|
name = "netbox_docker_plugin"
|
|
12
11
|
verbose_name = " NetBox Docker Plugin"
|
|
13
12
|
description = "Manage Docker"
|
|
14
|
-
version = "
|
|
15
|
-
max_version = "3.7.8"
|
|
13
|
+
version = "2.0.0"
|
|
16
14
|
base_url = "docker"
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
min_version = "4.0.0"
|
|
16
|
+
author= "Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>"
|
|
17
|
+
author_email= "vincent@saashup.com, david.jose.delassus@gmail.com"
|
|
19
18
|
|
|
20
19
|
def ready(self):
|
|
21
|
-
from . import signals
|
|
20
|
+
from . import signals # pylint: disable=unused-import, import-outside-toplevel
|
|
22
21
|
|
|
23
22
|
post_migrate.connect(create_webhook)
|
|
24
23
|
|
|
@@ -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.19.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
|
|
|
@@ -43,7 +42,6 @@ class NestedHostSerializer(WritableNestedSerializer):
|
|
|
43
42
|
"state",
|
|
44
43
|
"agent_version",
|
|
45
44
|
"docker_api_version",
|
|
46
|
-
"operation",
|
|
47
45
|
)
|
|
48
46
|
|
|
49
47
|
|
|
@@ -148,7 +146,6 @@ class NestedContainerSerializer(WritableNestedSerializer):
|
|
|
148
146
|
"restart_policy",
|
|
149
147
|
"operation",
|
|
150
148
|
"hostname",
|
|
151
|
-
"cap_add",
|
|
152
149
|
)
|
|
153
150
|
|
|
154
151
|
|
|
@@ -232,6 +229,7 @@ class ImageSerializer(NetBoxModelSerializer):
|
|
|
232
229
|
"containers",
|
|
233
230
|
"tags",
|
|
234
231
|
)
|
|
232
|
+
brief_fields = NestedImageSerializer.Meta.fields
|
|
235
233
|
|
|
236
234
|
|
|
237
235
|
class VolumeSerializer(NetBoxModelSerializer):
|
|
@@ -260,6 +258,7 @@ class VolumeSerializer(NetBoxModelSerializer):
|
|
|
260
258
|
"mounts",
|
|
261
259
|
"tags",
|
|
262
260
|
)
|
|
261
|
+
brief_fields = NestedVolumeSerializer.Meta.fields
|
|
263
262
|
|
|
264
263
|
|
|
265
264
|
class NetworkSerializer(NetBoxModelSerializer):
|
|
@@ -290,6 +289,7 @@ class NetworkSerializer(NetBoxModelSerializer):
|
|
|
290
289
|
"network_settings",
|
|
291
290
|
"tags",
|
|
292
291
|
)
|
|
292
|
+
brief_fields = NestedNetworkSerializer.Meta.fields
|
|
293
293
|
|
|
294
294
|
|
|
295
295
|
class PortSerializer(serializers.ModelSerializer):
|
|
@@ -374,19 +374,6 @@ class NetworkSettingSerializer(serializers.ModelSerializer):
|
|
|
374
374
|
fields = ("network",)
|
|
375
375
|
|
|
376
376
|
|
|
377
|
-
class DeviceSerializer(serializers.ModelSerializer):
|
|
378
|
-
"""Container Device Serializer class"""
|
|
379
|
-
|
|
380
|
-
class Meta:
|
|
381
|
-
"""Container Device Serializer Meta class"""
|
|
382
|
-
|
|
383
|
-
model = Device
|
|
384
|
-
fields = (
|
|
385
|
-
"host_path",
|
|
386
|
-
"container_path",
|
|
387
|
-
)
|
|
388
|
-
|
|
389
|
-
|
|
390
377
|
class ContainerSerializer(NetBoxModelSerializer):
|
|
391
378
|
"""Container Serializer class"""
|
|
392
379
|
|
|
@@ -401,7 +388,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
401
388
|
mounts = MountSerializer(many=True, required=False)
|
|
402
389
|
binds = BindSerializer(many=True, required=False)
|
|
403
390
|
network_settings = NetworkSettingSerializer(many=True, required=False)
|
|
404
|
-
devices = DeviceSerializer(many=True, required=False)
|
|
405
391
|
|
|
406
392
|
class Meta:
|
|
407
393
|
"""Container Serializer Meta class"""
|
|
@@ -420,19 +406,18 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
420
406
|
"ContainerID",
|
|
421
407
|
"hostname",
|
|
422
408
|
"restart_policy",
|
|
423
|
-
"cap_add",
|
|
424
409
|
"ports",
|
|
425
410
|
"env",
|
|
426
411
|
"labels",
|
|
427
412
|
"mounts",
|
|
428
413
|
"binds",
|
|
429
414
|
"network_settings",
|
|
430
|
-
"devices",
|
|
431
415
|
"custom_fields",
|
|
432
416
|
"created",
|
|
433
417
|
"last_updated",
|
|
434
418
|
"tags",
|
|
435
419
|
)
|
|
420
|
+
brief_fields = NestedContainerSerializer.Meta.fields
|
|
436
421
|
|
|
437
422
|
def validate(self, data):
|
|
438
423
|
attrs = data.copy()
|
|
@@ -442,13 +427,11 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
442
427
|
attrs.pop("mounts", None)
|
|
443
428
|
attrs.pop("binds", None)
|
|
444
429
|
attrs.pop("network_settings", None)
|
|
445
|
-
attrs.pop("devices", None)
|
|
446
430
|
|
|
447
431
|
super().validate(attrs)
|
|
448
432
|
|
|
449
433
|
return data
|
|
450
434
|
|
|
451
|
-
# pylint: disable=R0912
|
|
452
435
|
def create(self, validated_data):
|
|
453
436
|
ports_data = validated_data.pop("ports", None)
|
|
454
437
|
env_data = validated_data.pop("env", None)
|
|
@@ -456,7 +439,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
456
439
|
mounts_data = validated_data.pop("mounts", None)
|
|
457
440
|
binds_data = validated_data.pop("binds", None)
|
|
458
441
|
network_settings_data = validated_data.pop("network_settings", None)
|
|
459
|
-
devices_data = validated_data.pop("devices", None)
|
|
460
442
|
|
|
461
443
|
container = super().create(validated_data)
|
|
462
444
|
|
|
@@ -490,15 +472,8 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
490
472
|
obj.full_clean()
|
|
491
473
|
obj.save()
|
|
492
474
|
|
|
493
|
-
if devices_data is not None:
|
|
494
|
-
for device in devices_data:
|
|
495
|
-
obj = Device(container=container, **device)
|
|
496
|
-
obj.full_clean()
|
|
497
|
-
obj.save()
|
|
498
|
-
|
|
499
475
|
return container
|
|
500
476
|
|
|
501
|
-
# pylint: disable=R0912
|
|
502
477
|
def update(self, instance, validated_data):
|
|
503
478
|
ports_data = validated_data.pop("ports", None)
|
|
504
479
|
env_data = validated_data.pop("env", None)
|
|
@@ -506,7 +481,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
506
481
|
mounts_data = validated_data.pop("mounts", None)
|
|
507
482
|
binds_data = validated_data.pop("binds", None)
|
|
508
483
|
network_settings_data = validated_data.pop("network_settings", None)
|
|
509
|
-
devices_data = validated_data.pop("devices", None)
|
|
510
484
|
|
|
511
485
|
container = super().update(instance, validated_data)
|
|
512
486
|
|
|
@@ -546,13 +520,6 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
546
520
|
obj.full_clean()
|
|
547
521
|
obj.save()
|
|
548
522
|
|
|
549
|
-
if devices_data is not None:
|
|
550
|
-
Device.objects.filter(container=container).delete()
|
|
551
|
-
for device in devices_data:
|
|
552
|
-
obj = Device(container=container, **device)
|
|
553
|
-
obj.full_clean()
|
|
554
|
-
obj.save()
|
|
555
|
-
|
|
556
523
|
return container
|
|
557
524
|
|
|
558
525
|
|
|
@@ -581,6 +548,7 @@ class RegistrySerializer(NetBoxModelSerializer):
|
|
|
581
548
|
"email",
|
|
582
549
|
"images",
|
|
583
550
|
)
|
|
551
|
+
brief_fields = NestedRegistrySerializer.Meta.fields
|
|
584
552
|
|
|
585
553
|
|
|
586
554
|
class HostSerializer(NetBoxModelSerializer):
|
|
@@ -611,7 +579,6 @@ class HostSerializer(NetBoxModelSerializer):
|
|
|
611
579
|
"netbox_base_url",
|
|
612
580
|
"agent_version",
|
|
613
581
|
"docker_api_version",
|
|
614
|
-
"operation",
|
|
615
582
|
"custom_fields",
|
|
616
583
|
"created",
|
|
617
584
|
"last_updated",
|
|
@@ -622,6 +589,7 @@ class HostSerializer(NetBoxModelSerializer):
|
|
|
622
589
|
"containers",
|
|
623
590
|
"registries",
|
|
624
591
|
)
|
|
592
|
+
brief_fields = NestedHostSerializer.Meta.fields
|
|
625
593
|
|
|
626
594
|
|
|
627
595
|
class ContainerCommandSerializer(serializers.Serializer):
|
{netbox_docker_plugin-1.19.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.19.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.19.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.19.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.19.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.19.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,14 +71,4 @@ class HostBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
70
71
|
)
|
|
71
72
|
|
|
72
73
|
model = Host
|
|
73
|
-
fieldsets = (("
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
class HostOperationForm(NetBoxModelForm):
|
|
77
|
-
"""Host Operation form definition class"""
|
|
78
|
-
|
|
79
|
-
class Meta:
|
|
80
|
-
"""Host form definition Meta class"""
|
|
81
|
-
|
|
82
|
-
model = Host
|
|
83
|
-
fields = ("operation",)
|
|
74
|
+
fieldsets = (FieldSet("endpoint", name="General"),)
|
{netbox_docker_plugin-1.19.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.19.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.19.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.19.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.19.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(
|