netbox-docker-plugin 2.8.0__tar.gz → 2.10.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-2.8.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.10.0}/PKG-INFO +3 -2
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/__init__.py +6 -5
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/serializers.py +31 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/views.py +2 -1
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/filtersets.py +22 -2
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/container.py +21 -2
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/host.py +10 -0
- netbox_docker_plugin-2.10.0/netbox_docker_plugin/forms/log_driver_option.py +28 -0
- netbox_docker_plugin-2.10.0/netbox_docker_plugin/migrations/0031_container_cap_add.py +37 -0
- netbox_docker_plugin-2.10.0/netbox_docker_plugin/migrations/0032_device_and_more.py +98 -0
- netbox_docker_plugin-2.10.0/netbox_docker_plugin/migrations/0033_host_operation.py +26 -0
- netbox_docker_plugin-2.10.0/netbox_docker_plugin/migrations/0034_container_log_driver_alter_container_containerid_and_more.py +147 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/container.py +63 -2
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/host.py +29 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/registry.py +1 -1
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tables.py +16 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container.html +75 -55
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host.html +50 -40
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/test_container_actions.py +32 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/test_container_api.py +10 -1
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/test_container_views.py +5 -3
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/host/test_host_api.py +1 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/urls.py +27 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/utilities/__init__.py +14 -1
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/host.py +11 -0
- netbox_docker_plugin-2.10.0/netbox_docker_plugin/views/log_driver_option.py +27 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0/netbox_docker_plugin.egg-info}/PKG-INFO +3 -2
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin.egg-info/SOURCES.txt +4 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/pyproject.toml +1 -1
- netbox_docker_plugin-2.8.0/netbox_docker_plugin/migrations/0031_container_cap_add.py +0 -29
- netbox_docker_plugin-2.8.0/netbox_docker_plugin/migrations/0032_device_and_more.py +0 -66
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/LICENSE +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/MANIFEST.in +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/README.md +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/renderers.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/urls.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/bind.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/device.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/env.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/image.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/label.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/mount.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/network.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/network_setting.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/port.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/registry.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/volume.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0001_initial.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0002_image.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0003_image_size.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0004_volume.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0005_network.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0006_container_port_mount_label_env_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0007_remove_container_netbox_docker_plugin_container_unique_name_host__and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0008_alter_network_unique_together_network_networkid_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0009_remove_container_network_networksettings_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0010_container_containerid_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0011_host_token.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0012_host_state.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0013_host_netbox_url.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0014_container_operation.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0015_remove_mount_netbox_docker_plugin_mount_unique_volume_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0016_alter_env_value.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0017_network_state.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0018_alter_mount_volume_alter_networksetting_network.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0019_host_agent_version_host_docker_api_version.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0020_container_hostname.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0021_registry_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0022_bind_bind_netbox_docker_plugin_bind_unique_bind.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0023_delete_hosts.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0024_registry_host_alter_registry_name_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0025_alter_image_version.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0026_image_digest.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0027_container_restart_policy.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0028_mount_and_bind_read_only.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0029_alter_container_state.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/0030_alter_container_containerid_alter_container_hostname_and_more.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/migrations/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/image.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/network.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/models/volume.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/navigation.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/signals.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-exec.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-layout.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-logs.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host-graph.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/network.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/registry.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/volume.html +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templatetags/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/templatetags/host.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/base.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/test_container_api_exec.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/test_container_operation_view.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/container/test_container_validation.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/host/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/host/test_host_views.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/host/test_replace_password.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/image/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/image/test_image_api.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/image/test_image_views.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/network/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/network/test_network_api.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/network/test_network_views.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/registry/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/registry/test_registry_api.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/registry/test_registry_views.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/test_init.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/volume/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/volume/test_volume_api.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/tests/volume/test_volume_views.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/__init__.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/bind.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/container.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/device.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/env.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/image.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/label.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/mount.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/network.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/network_setting.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/port.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/registry.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/views/volume.py +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin.egg-info/top_level.txt +0 -0
- {netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/setup.cfg +0 -0
{netbox_docker_plugin-2.8.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.10.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: netbox-docker-plugin
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.10.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
|
|
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
10
10
|
Requires-Python: >=3.8
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
+
Dynamic: license-file
|
|
13
14
|
|
|
14
15
|
# Netbox Docker Plugin
|
|
15
16
|
|
|
@@ -4,20 +4,21 @@ from django.db.models.signals import post_migrate
|
|
|
4
4
|
from netbox.plugins import PluginConfig
|
|
5
5
|
from .utilities import create_webhook
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
class NetBoxDockerConfig(PluginConfig):
|
|
8
9
|
"""Plugin Config Class"""
|
|
9
10
|
|
|
10
11
|
name = "netbox_docker_plugin"
|
|
11
12
|
verbose_name = " NetBox Docker Plugin"
|
|
12
13
|
description = "Manage Docker"
|
|
13
|
-
version = "2.
|
|
14
|
+
version = "2.10.0"
|
|
14
15
|
base_url = "docker"
|
|
15
|
-
min_version = "4.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"
|
|
16
|
+
min_version = "4.0.11"
|
|
17
|
+
author = "Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>"
|
|
18
|
+
author_email = "vincent@saashup.com, david.jose.delassus@gmail.com"
|
|
18
19
|
|
|
19
20
|
def ready(self):
|
|
20
|
-
from . import signals
|
|
21
|
+
from . import signals # pylint: disable=unused-import, import-outside-toplevel
|
|
21
22
|
|
|
22
23
|
post_migrate.connect(create_webhook)
|
|
23
24
|
|
{netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/serializers.py
RENAMED
|
@@ -19,6 +19,7 @@ from ..models.container import (
|
|
|
19
19
|
Bind,
|
|
20
20
|
NetworkSetting,
|
|
21
21
|
Device,
|
|
22
|
+
LogDriverOption,
|
|
22
23
|
)
|
|
23
24
|
from ..models.registry import Registry
|
|
24
25
|
|
|
@@ -43,6 +44,7 @@ class NestedHostSerializer(WritableNestedSerializer):
|
|
|
43
44
|
"state",
|
|
44
45
|
"agent_version",
|
|
45
46
|
"docker_api_version",
|
|
47
|
+
"operation",
|
|
46
48
|
)
|
|
47
49
|
|
|
48
50
|
|
|
@@ -148,6 +150,7 @@ class NestedContainerSerializer(WritableNestedSerializer):
|
|
|
148
150
|
"operation",
|
|
149
151
|
"hostname",
|
|
150
152
|
"cap_add",
|
|
153
|
+
"log_driver",
|
|
151
154
|
)
|
|
152
155
|
|
|
153
156
|
|
|
@@ -321,6 +324,19 @@ class EnvSerializer(serializers.ModelSerializer):
|
|
|
321
324
|
)
|
|
322
325
|
|
|
323
326
|
|
|
327
|
+
class LogDriverOptionSerializer(serializers.ModelSerializer):
|
|
328
|
+
"""Container Log Driver Option Serializer class"""
|
|
329
|
+
|
|
330
|
+
class Meta:
|
|
331
|
+
"""Container Log Driver Option Serializer Meta class"""
|
|
332
|
+
|
|
333
|
+
model = LogDriverOption
|
|
334
|
+
fields = (
|
|
335
|
+
"option_name",
|
|
336
|
+
"value",
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
|
|
324
340
|
class LabelSerializer(serializers.ModelSerializer):
|
|
325
341
|
"""Container Label Serializer class"""
|
|
326
342
|
|
|
@@ -404,6 +420,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
404
420
|
binds = BindSerializer(many=True, required=False)
|
|
405
421
|
network_settings = NetworkSettingSerializer(many=True, required=False)
|
|
406
422
|
devices = DeviceSerializer(many=True, required=False)
|
|
423
|
+
log_driver_options = LogDriverOptionSerializer(many=True, required=False)
|
|
407
424
|
|
|
408
425
|
class Meta:
|
|
409
426
|
"""Container Serializer Meta class"""
|
|
@@ -430,6 +447,8 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
430
447
|
"binds",
|
|
431
448
|
"network_settings",
|
|
432
449
|
"devices",
|
|
450
|
+
"log_driver",
|
|
451
|
+
"log_driver_options",
|
|
433
452
|
"custom_fields",
|
|
434
453
|
"created",
|
|
435
454
|
"last_updated",
|
|
@@ -455,6 +474,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
455
474
|
def create(self, validated_data):
|
|
456
475
|
ports_data = validated_data.pop("ports", None)
|
|
457
476
|
env_data = validated_data.pop("env", None)
|
|
477
|
+
log_driver_options_data = validated_data.pop("log_driver_options", None)
|
|
458
478
|
labels_data = validated_data.pop("labels", None)
|
|
459
479
|
mounts_data = validated_data.pop("mounts", None)
|
|
460
480
|
binds_data = validated_data.pop("binds", None)
|
|
@@ -471,6 +491,10 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
471
491
|
for env in env_data:
|
|
472
492
|
Env.objects.create(container=container, **env)
|
|
473
493
|
|
|
494
|
+
if log_driver_options_data is not None:
|
|
495
|
+
for option in log_driver_options_data:
|
|
496
|
+
LogDriverOption.objects.create(container=container, **option)
|
|
497
|
+
|
|
474
498
|
if labels_data is not None:
|
|
475
499
|
for label in labels_data:
|
|
476
500
|
Label.objects.create(container=container, **label)
|
|
@@ -505,6 +529,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
505
529
|
def update(self, instance, validated_data):
|
|
506
530
|
ports_data = validated_data.pop("ports", None)
|
|
507
531
|
env_data = validated_data.pop("env", None)
|
|
532
|
+
log_driver_options_data = validated_data.pop("log_driver_options", None)
|
|
508
533
|
labels_data = validated_data.pop("labels", None)
|
|
509
534
|
mounts_data = validated_data.pop("mounts", None)
|
|
510
535
|
binds_data = validated_data.pop("binds", None)
|
|
@@ -523,6 +548,11 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
523
548
|
for env in env_data:
|
|
524
549
|
Env.objects.create(container=container, **env)
|
|
525
550
|
|
|
551
|
+
if log_driver_options_data is not None:
|
|
552
|
+
LogDriverOption.objects.filter(container=container).delete()
|
|
553
|
+
for option in log_driver_options_data:
|
|
554
|
+
LogDriverOption.objects.create(container=container, **option)
|
|
555
|
+
|
|
526
556
|
if labels_data is not None:
|
|
527
557
|
Label.objects.filter(container=container).delete()
|
|
528
558
|
for label in labels_data:
|
|
@@ -615,6 +645,7 @@ class HostSerializer(NetBoxModelSerializer):
|
|
|
615
645
|
"netbox_base_url",
|
|
616
646
|
"agent_version",
|
|
617
647
|
"docker_api_version",
|
|
648
|
+
"operation",
|
|
618
649
|
"custom_fields",
|
|
619
650
|
"created",
|
|
620
651
|
"last_updated",
|
{netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/api/views.py
RENAMED
|
@@ -85,7 +85,7 @@ class ImageViewSet(NetBoxModelViewSet):
|
|
|
85
85
|
renderer_classes=[JSONRenderer],
|
|
86
86
|
)
|
|
87
87
|
def force_pull(self, _request, **_kwargs):
|
|
88
|
-
"""
|
|
88
|
+
"""Force pull an existing image"""
|
|
89
89
|
|
|
90
90
|
image: Image = self.get_object()
|
|
91
91
|
agent_url = image.host.endpoint
|
|
@@ -145,6 +145,7 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
145
145
|
"host",
|
|
146
146
|
"ports",
|
|
147
147
|
"labels",
|
|
148
|
+
"log_driver_options",
|
|
148
149
|
"tags",
|
|
149
150
|
)
|
|
150
151
|
filterset_class = filtersets.ContainerFilterSet
|
{netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/filtersets.py
RENAMED
|
@@ -16,6 +16,7 @@ from .models.container import (
|
|
|
16
16
|
Bind,
|
|
17
17
|
NetworkSetting,
|
|
18
18
|
Device,
|
|
19
|
+
LogDriverOption,
|
|
19
20
|
)
|
|
20
21
|
from .models.registry import Registry
|
|
21
22
|
|
|
@@ -89,7 +90,7 @@ class ImageFilterSet(NetBoxModelFilterSet):
|
|
|
89
90
|
"""Image filterset definition meta class"""
|
|
90
91
|
|
|
91
92
|
model = Image
|
|
92
|
-
fields = ("id", "name", "version", "size", "ImageID", "containers")
|
|
93
|
+
fields = ("id", "name", "version", "size", "ImageID", "Digest", "containers")
|
|
93
94
|
|
|
94
95
|
# pylint: disable=W0613
|
|
95
96
|
def search(self, queryset, name, value):
|
|
@@ -166,7 +167,7 @@ class ContainerFilterSet(NetBoxModelFilterSet):
|
|
|
166
167
|
"""Container filterset definition meta class"""
|
|
167
168
|
|
|
168
169
|
model = Container
|
|
169
|
-
fields = ("id", "name", "state", "hostname", "restart_policy")
|
|
170
|
+
fields = ("id", "name", "state", "hostname", "restart_policy", "ContainerID")
|
|
170
171
|
|
|
171
172
|
# pylint: disable=W0613
|
|
172
173
|
def search(self, queryset, name, value):
|
|
@@ -195,6 +196,25 @@ class EnvFilterSet(BaseFilterSet):
|
|
|
195
196
|
)
|
|
196
197
|
|
|
197
198
|
|
|
199
|
+
class LogDriverOptionFilterSet(BaseFilterSet):
|
|
200
|
+
"""Log driver option filterset definition class"""
|
|
201
|
+
|
|
202
|
+
container_id = ModelMultipleChoiceFilter(
|
|
203
|
+
field_name="container_id",
|
|
204
|
+
queryset=Container.objects.all(),
|
|
205
|
+
label="Container (ID)",
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
class Meta:
|
|
209
|
+
"""Log driver option filterset definition meta class"""
|
|
210
|
+
|
|
211
|
+
model = LogDriverOption
|
|
212
|
+
fields = (
|
|
213
|
+
"id",
|
|
214
|
+
"option_name",
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
|
|
198
218
|
class LabelFilterSet(BaseFilterSet):
|
|
199
219
|
"""Label filterset definition class"""
|
|
200
220
|
|
{netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/container.py
RENAMED
|
@@ -15,7 +15,11 @@ from netbox.forms import (
|
|
|
15
15
|
)
|
|
16
16
|
from ..models.volume import Volume
|
|
17
17
|
from ..models.host import Host
|
|
18
|
-
from ..models.container import
|
|
18
|
+
from ..models.container import (
|
|
19
|
+
Container,
|
|
20
|
+
ContainerRestartPolicyChoices,
|
|
21
|
+
ContainerCapAddChoices,
|
|
22
|
+
)
|
|
19
23
|
from ..models.image import Image
|
|
20
24
|
|
|
21
25
|
|
|
@@ -44,6 +48,7 @@ class ContainerForm(NetBoxModelForm):
|
|
|
44
48
|
"hostname",
|
|
45
49
|
"restart_policy",
|
|
46
50
|
"cap_add",
|
|
51
|
+
"log_driver",
|
|
47
52
|
"tags",
|
|
48
53
|
)
|
|
49
54
|
labels = {
|
|
@@ -53,6 +58,7 @@ class ContainerForm(NetBoxModelForm):
|
|
|
53
58
|
"hostname": "Hostname",
|
|
54
59
|
"restart_policy": "Restart Policy",
|
|
55
60
|
"cap_add": "Add Host capabilities",
|
|
61
|
+
"log_driver": "Logging Driver",
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
|
|
@@ -77,6 +83,7 @@ class ContainerEditForm(NetBoxModelForm):
|
|
|
77
83
|
"hostname",
|
|
78
84
|
"restart_policy",
|
|
79
85
|
"cap_add",
|
|
86
|
+
"log_driver",
|
|
80
87
|
"tags",
|
|
81
88
|
)
|
|
82
89
|
labels = {
|
|
@@ -85,6 +92,7 @@ class ContainerEditForm(NetBoxModelForm):
|
|
|
85
92
|
"hostname": "Hostname",
|
|
86
93
|
"restart_policy": "Restart Policy",
|
|
87
94
|
"cap_add": "Add Host capabilities",
|
|
95
|
+
"log_driver": "Logging Driver",
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
|
|
@@ -112,6 +120,7 @@ class ContainerFilterForm(NetBoxModelFilterSetForm):
|
|
|
112
120
|
restart_policy = forms.ChoiceField(
|
|
113
121
|
label="Restart Policy", choices=ContainerRestartPolicyChoices, required=False
|
|
114
122
|
)
|
|
123
|
+
log_driver = forms.ChoiceField(label="Logging driver", required=False)
|
|
115
124
|
tag = TagFilterField(model)
|
|
116
125
|
|
|
117
126
|
|
|
@@ -126,6 +135,12 @@ class ContainerImportForm(NetBoxModelImportForm):
|
|
|
126
135
|
+ "`always`, `unless-stopped`.",
|
|
127
136
|
)
|
|
128
137
|
|
|
138
|
+
log_driver = forms.CharField(
|
|
139
|
+
label="Logging driver",
|
|
140
|
+
required=False,
|
|
141
|
+
help_text="Logging driver. Can be `json-file`, `syslog`.",
|
|
142
|
+
)
|
|
143
|
+
|
|
129
144
|
class Meta:
|
|
130
145
|
"""Container importation form definition Meta class"""
|
|
131
146
|
|
|
@@ -151,12 +166,16 @@ class ContainerBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
151
166
|
choices=ContainerRestartPolicyChoices,
|
|
152
167
|
required=True,
|
|
153
168
|
)
|
|
169
|
+
log_driver = forms.CharField(
|
|
170
|
+
label="Logging driver",
|
|
171
|
+
required=False,
|
|
172
|
+
)
|
|
154
173
|
hostname = forms.CharField(
|
|
155
174
|
label="Hostname", max_length=256, min_length=1, required=False
|
|
156
175
|
)
|
|
157
176
|
|
|
158
177
|
model = Container
|
|
159
|
-
fieldsets = (FieldSet("restart_policy", "hostname", name="General"),)
|
|
178
|
+
fieldsets = (FieldSet("restart_policy", "log_driver", "hostname", name="General"),)
|
|
160
179
|
|
|
161
180
|
|
|
162
181
|
class ContainerOperationForm(NetBoxModelForm):
|
{netbox_docker_plugin-2.8.0 → netbox_docker_plugin-2.10.0}/netbox_docker_plugin/forms/host.py
RENAMED
|
@@ -72,3 +72,13 @@ class HostBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
72
72
|
|
|
73
73
|
model = Host
|
|
74
74
|
fieldsets = (FieldSet("endpoint", name="General"),)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class HostOperationForm(NetBoxModelForm):
|
|
78
|
+
"""Host Operation form definition class"""
|
|
79
|
+
|
|
80
|
+
class Meta:
|
|
81
|
+
"""Host form definition Meta class"""
|
|
82
|
+
|
|
83
|
+
model = Host
|
|
84
|
+
fields = ("operation",)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Log Driver option Form definition"""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from utilities.forms.fields import DynamicModelChoiceField
|
|
5
|
+
from ..models.container import LogDriverOption, Container
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class LogDriverOptionForm(forms.ModelForm):
|
|
9
|
+
"""Log Driver option form definition class"""
|
|
10
|
+
|
|
11
|
+
container = DynamicModelChoiceField(
|
|
12
|
+
label="Container", queryset=Container.objects.all(), required=True
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
class Meta:
|
|
16
|
+
"""Log Driver option form definition Meta class"""
|
|
17
|
+
|
|
18
|
+
model = LogDriverOption
|
|
19
|
+
fields = (
|
|
20
|
+
"container",
|
|
21
|
+
"option_name",
|
|
22
|
+
"value",
|
|
23
|
+
)
|
|
24
|
+
labels = {
|
|
25
|
+
"container": "Container",
|
|
26
|
+
"option_name": "Option Name",
|
|
27
|
+
"value": "Value",
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# pylint: disable=C0103
|
|
2
|
+
"""Migration file"""
|
|
3
|
+
|
|
4
|
+
import django.contrib.postgres.fields
|
|
5
|
+
from django.db import migrations, models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Migration(migrations.Migration):
|
|
9
|
+
"""Migration file"""
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
(
|
|
13
|
+
"netbox_docker_plugin",
|
|
14
|
+
"0030_alter_container_containerid_alter_container_hostname_and_more",
|
|
15
|
+
),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
operations = [
|
|
19
|
+
migrations.RunSQL(
|
|
20
|
+
"ALTER TABLE netbox_docker_plugin_container "
|
|
21
|
+
+ "ADD COLUMN IF NOT EXISTS cap_add character varying(32)[];",
|
|
22
|
+
state_operations=[
|
|
23
|
+
migrations.AddField(
|
|
24
|
+
model_name="container",
|
|
25
|
+
name="cap_add",
|
|
26
|
+
field=django.contrib.postgres.fields.ArrayField(
|
|
27
|
+
base_field=models.CharField(
|
|
28
|
+
blank=True, max_length=32, null=True
|
|
29
|
+
),
|
|
30
|
+
blank=True,
|
|
31
|
+
null=True,
|
|
32
|
+
size=None,
|
|
33
|
+
),
|
|
34
|
+
),
|
|
35
|
+
],
|
|
36
|
+
)
|
|
37
|
+
]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# pylint: disable=C0103
|
|
2
|
+
"""Migration file"""
|
|
3
|
+
|
|
4
|
+
import django.core.validators
|
|
5
|
+
import django.db.models.deletion
|
|
6
|
+
from django.db import migrations, models
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Migration(migrations.Migration):
|
|
10
|
+
"""Migration file"""
|
|
11
|
+
|
|
12
|
+
dependencies = [
|
|
13
|
+
("netbox_docker_plugin", "0031_container_cap_add"),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
operations = [
|
|
17
|
+
migrations.RunSQL(
|
|
18
|
+
"""
|
|
19
|
+
CREATE TABLE IF NOT EXISTS public.netbox_docker_plugin_device
|
|
20
|
+
(
|
|
21
|
+
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
|
22
|
+
host_path character varying(1024) NOT NULL,
|
|
23
|
+
container_path character varying(1024) NOT NULL,
|
|
24
|
+
container_id bigint NOT NULL,
|
|
25
|
+
CONSTRAINT netbox_docker_plugin_device_pkey PRIMARY KEY (id),
|
|
26
|
+
CONSTRAINT netbox_docker_plugin_device_unique_device UNIQUE
|
|
27
|
+
(container_id, container_path, host_path),
|
|
28
|
+
CONSTRAINT netbox_docker_plugin_container_id_a53ca874_fk_netbox_do FOREIGN KEY (container_id)
|
|
29
|
+
REFERENCES public.netbox_docker_plugin_container (id) MATCH SIMPLE
|
|
30
|
+
ON UPDATE NO ACTION
|
|
31
|
+
ON DELETE NO ACTION
|
|
32
|
+
DEFERRABLE INITIALLY DEFERRED
|
|
33
|
+
);
|
|
34
|
+
CREATE INDEX IF NOT EXISTS netbox_docker_plugin_device_container_id_a53ca874
|
|
35
|
+
ON public.netbox_docker_plugin_device USING btree
|
|
36
|
+
(container_id ASC NULLS LAST);
|
|
37
|
+
""",
|
|
38
|
+
state_operations=[
|
|
39
|
+
migrations.CreateModel(
|
|
40
|
+
name="Device",
|
|
41
|
+
fields=[
|
|
42
|
+
(
|
|
43
|
+
"id",
|
|
44
|
+
models.BigAutoField(
|
|
45
|
+
auto_created=True, primary_key=True, serialize=False
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
(
|
|
49
|
+
"host_path",
|
|
50
|
+
models.CharField(
|
|
51
|
+
max_length=1024,
|
|
52
|
+
validators=[
|
|
53
|
+
django.core.validators.MinLengthValidator(
|
|
54
|
+
limit_value=1
|
|
55
|
+
),
|
|
56
|
+
django.core.validators.MaxLengthValidator(
|
|
57
|
+
limit_value=1024
|
|
58
|
+
),
|
|
59
|
+
],
|
|
60
|
+
),
|
|
61
|
+
),
|
|
62
|
+
(
|
|
63
|
+
"container_path",
|
|
64
|
+
models.CharField(
|
|
65
|
+
max_length=1024,
|
|
66
|
+
validators=[
|
|
67
|
+
django.core.validators.MinLengthValidator(
|
|
68
|
+
limit_value=1
|
|
69
|
+
),
|
|
70
|
+
django.core.validators.MaxLengthValidator(
|
|
71
|
+
limit_value=1024
|
|
72
|
+
),
|
|
73
|
+
],
|
|
74
|
+
),
|
|
75
|
+
),
|
|
76
|
+
(
|
|
77
|
+
"container",
|
|
78
|
+
models.ForeignKey(
|
|
79
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
80
|
+
related_name="devices",
|
|
81
|
+
to="netbox_docker_plugin.container",
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
],
|
|
85
|
+
options={
|
|
86
|
+
"ordering": ("container", "container_path", "host_path"),
|
|
87
|
+
},
|
|
88
|
+
),
|
|
89
|
+
migrations.AddConstraint(
|
|
90
|
+
model_name="device",
|
|
91
|
+
constraint=models.UniqueConstraint(
|
|
92
|
+
fields=("container", "container_path", "host_path"),
|
|
93
|
+
name="netbox_docker_plugin_device_unique_device",
|
|
94
|
+
),
|
|
95
|
+
),
|
|
96
|
+
],
|
|
97
|
+
),
|
|
98
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# pylint: disable=C0103
|
|
2
|
+
"""Migration file"""
|
|
3
|
+
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
"""Migration file"""
|
|
9
|
+
|
|
10
|
+
dependencies = [
|
|
11
|
+
("netbox_docker_plugin", "0032_device_and_more"),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.RunSQL(
|
|
16
|
+
"ALTER TABLE netbox_docker_plugin_host "
|
|
17
|
+
+ "ADD COLUMN IF NOT EXISTS operation character varying(32);",
|
|
18
|
+
state_operations=[
|
|
19
|
+
migrations.AddField(
|
|
20
|
+
model_name="host",
|
|
21
|
+
name="operation",
|
|
22
|
+
field=models.CharField(default="none", max_length=32),
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
)
|
|
26
|
+
]
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# pylint: disable=C0103
|
|
2
|
+
"""Migration file"""
|
|
3
|
+
|
|
4
|
+
import django.core.validators
|
|
5
|
+
import django.db.models.deletion
|
|
6
|
+
from django.db import migrations, models
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Migration(migrations.Migration):
|
|
10
|
+
"""Migration file"""
|
|
11
|
+
|
|
12
|
+
dependencies = [
|
|
13
|
+
("netbox_docker_plugin", "0033_host_operation"),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
operations = [
|
|
17
|
+
migrations.RunSQL(
|
|
18
|
+
"ALTER TABLE netbox_docker_plugin_container "
|
|
19
|
+
+ "ADD COLUMN IF NOT EXISTS log_driver character varying(32);",
|
|
20
|
+
state_operations=[
|
|
21
|
+
migrations.AddField(
|
|
22
|
+
model_name="container",
|
|
23
|
+
name="log_driver",
|
|
24
|
+
field=models.CharField(blank=True, max_length=32, null=True),
|
|
25
|
+
),
|
|
26
|
+
],
|
|
27
|
+
),
|
|
28
|
+
migrations.AlterField(
|
|
29
|
+
model_name="container",
|
|
30
|
+
name="ContainerID",
|
|
31
|
+
field=models.CharField(
|
|
32
|
+
blank=True,
|
|
33
|
+
max_length=128,
|
|
34
|
+
null=True,
|
|
35
|
+
validators=[
|
|
36
|
+
django.core.validators.MinLengthValidator(limit_value=1),
|
|
37
|
+
django.core.validators.MaxLengthValidator(limit_value=128),
|
|
38
|
+
],
|
|
39
|
+
),
|
|
40
|
+
),
|
|
41
|
+
migrations.AlterField(
|
|
42
|
+
model_name="container",
|
|
43
|
+
name="hostname",
|
|
44
|
+
field=models.CharField(
|
|
45
|
+
blank=True,
|
|
46
|
+
max_length=256,
|
|
47
|
+
null=True,
|
|
48
|
+
validators=[
|
|
49
|
+
django.core.validators.MinLengthValidator(limit_value=1),
|
|
50
|
+
django.core.validators.MaxLengthValidator(limit_value=256),
|
|
51
|
+
],
|
|
52
|
+
),
|
|
53
|
+
),
|
|
54
|
+
migrations.AlterField(
|
|
55
|
+
model_name="port",
|
|
56
|
+
name="public_port",
|
|
57
|
+
field=models.IntegerField(
|
|
58
|
+
validators=[
|
|
59
|
+
django.core.validators.MinValueValidator(limit_value=-1),
|
|
60
|
+
django.core.validators.MaxValueValidator(limit_value=65535),
|
|
61
|
+
]
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
migrations.RunSQL(
|
|
65
|
+
"""
|
|
66
|
+
CREATE TABLE IF NOT EXISTS public.netbox_docker_plugin_logdriveroption
|
|
67
|
+
(
|
|
68
|
+
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
|
69
|
+
option_name character varying(255) NOT NULL,
|
|
70
|
+
value character varying(4096) NOT NULL,
|
|
71
|
+
container_id bigint NOT NULL,
|
|
72
|
+
CONSTRAINT netbox_docker_plugin_logdriveroption_pkey PRIMARY KEY (id),
|
|
73
|
+
CONSTRAINT netbox_docker_plugin_container_id_929d4dfe_fk_netbox_do FOREIGN KEY (container_id)
|
|
74
|
+
REFERENCES public.netbox_docker_plugin_container (id) MATCH SIMPLE
|
|
75
|
+
ON UPDATE NO ACTION
|
|
76
|
+
ON DELETE NO ACTION
|
|
77
|
+
DEFERRABLE INITIALLY DEFERRED
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
CREATE INDEX IF NOT EXISTS netbox_docker_plugin_logdriveroption_container_id_929d4dfe
|
|
81
|
+
ON public.netbox_docker_plugin_logdriveroption USING btree
|
|
82
|
+
(container_id ASC NULLS LAST);
|
|
83
|
+
|
|
84
|
+
CREATE UNIQUE INDEX IF NOT EXISTS netbox_docker_plugin_logdriveroption_unique_option_name_contain
|
|
85
|
+
ON public.netbox_docker_plugin_logdriveroption USING btree
|
|
86
|
+
(option_name ASC NULLS LAST, container_id ASC NULLS LAST);
|
|
87
|
+
""",
|
|
88
|
+
state_operations=[
|
|
89
|
+
migrations.CreateModel(
|
|
90
|
+
name="LogDriverOption",
|
|
91
|
+
fields=[
|
|
92
|
+
(
|
|
93
|
+
"id",
|
|
94
|
+
models.BigAutoField(
|
|
95
|
+
auto_created=True, primary_key=True, serialize=False
|
|
96
|
+
),
|
|
97
|
+
),
|
|
98
|
+
(
|
|
99
|
+
"option_name",
|
|
100
|
+
models.CharField(
|
|
101
|
+
max_length=255,
|
|
102
|
+
validators=[
|
|
103
|
+
django.core.validators.MinLengthValidator(
|
|
104
|
+
limit_value=1
|
|
105
|
+
),
|
|
106
|
+
django.core.validators.MaxLengthValidator(
|
|
107
|
+
limit_value=255
|
|
108
|
+
),
|
|
109
|
+
],
|
|
110
|
+
),
|
|
111
|
+
),
|
|
112
|
+
(
|
|
113
|
+
"value",
|
|
114
|
+
models.CharField(
|
|
115
|
+
blank=True,
|
|
116
|
+
max_length=4096,
|
|
117
|
+
validators=[
|
|
118
|
+
django.core.validators.MaxLengthValidator(
|
|
119
|
+
limit_value=4096
|
|
120
|
+
)
|
|
121
|
+
],
|
|
122
|
+
),
|
|
123
|
+
),
|
|
124
|
+
(
|
|
125
|
+
"container",
|
|
126
|
+
models.ForeignKey(
|
|
127
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
128
|
+
related_name="log_driver_options",
|
|
129
|
+
to="netbox_docker_plugin.container",
|
|
130
|
+
),
|
|
131
|
+
),
|
|
132
|
+
],
|
|
133
|
+
options={
|
|
134
|
+
"ordering": ("container", "option_name"),
|
|
135
|
+
},
|
|
136
|
+
),
|
|
137
|
+
migrations.AddConstraint(
|
|
138
|
+
model_name="logdriveroption",
|
|
139
|
+
constraint=models.UniqueConstraint(
|
|
140
|
+
models.F("option_name"),
|
|
141
|
+
models.F("container"),
|
|
142
|
+
name="netbox_docker_plugin_logdriveroption_unique_option_name_container'",
|
|
143
|
+
),
|
|
144
|
+
),
|
|
145
|
+
],
|
|
146
|
+
),
|
|
147
|
+
]
|