netbox-docker-plugin 4.8.0__tar.gz → 4.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-4.8.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-4.10.0}/PKG-INFO +1 -1
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/__init__.py +1 -1
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/serializers.py +28 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/views.py +10 -3
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/filtersets.py +20 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/bind.py +17 -4
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/container.py +7 -5
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/device.py +17 -4
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/forms/env.py +41 -0
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/forms/label.py +41 -0
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/forms/log_driver_option.py +41 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/mount.py +22 -5
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/network_setting.py +24 -9
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/forms/port.py +43 -0
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/forms/sysctl.py +41 -0
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/migrations/1041_sysctl.py +67 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/container.py +40 -3
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tables.py +185 -16
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container.html +64 -40
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host.html +39 -41
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/test_container_api.py +10 -2
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/host/test_host_api.py +29 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/host/test_host_views.py +21 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/urls.py +56 -3
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/container.py +17 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/image.py +10 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/network.py +11 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/registry.py +10 -0
- netbox_docker_plugin-4.10.0/netbox_docker_plugin/views/sysctl.py +27 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/volume.py +10 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0/netbox_docker_plugin.egg-info}/PKG-INFO +1 -1
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin.egg-info/SOURCES.txt +3 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/pyproject.toml +1 -1
- netbox_docker_plugin-4.8.0/netbox_docker_plugin/forms/env.py +0 -28
- netbox_docker_plugin-4.8.0/netbox_docker_plugin/forms/label.py +0 -28
- netbox_docker_plugin-4.8.0/netbox_docker_plugin/forms/log_driver_option.py +0 -28
- netbox_docker_plugin-4.8.0/netbox_docker_plugin/forms/port.py +0 -30
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/LICENSE +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/MANIFEST.in +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/README.md +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/renderers.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/urls.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/host.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/image.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/network.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/registry.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/volume.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0001_initial.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0002_image.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0003_image_size.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0004_volume.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0005_network.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0006_container_port_mount_label_env_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0007_remove_container_netbox_docker_plugin_container_unique_name_host__and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0008_alter_network_unique_together_network_networkid_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0009_remove_container_network_networksettings_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0010_container_containerid_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0011_host_token.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0012_host_state.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0013_host_netbox_url.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0014_container_operation.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0015_remove_mount_netbox_docker_plugin_mount_unique_volume_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0016_alter_env_value.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0017_network_state.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0018_alter_mount_volume_alter_networksetting_network.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0019_host_agent_version_host_docker_api_version.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0020_container_hostname.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0021_registry_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0022_bind_bind_netbox_docker_plugin_bind_unique_bind.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0023_delete_hosts.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0024_registry_host_alter_registry_name_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0025_alter_image_version.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0026_image_digest.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0027_container_restart_policy.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0028_mount_and_bind_read_only.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0029_alter_container_state.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0030_alter_container_containerid_alter_container_hostname_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0031_container_cap_add.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0032_device_and_more.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0033_host_operation.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0034_volume_max_size.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0035_container_log_driver_logdriveroption.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0036_alter_container_log_driver.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0037_alter_env_value.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/0038_container_cmd.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/1039_alter_port_public_port.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/1040_alter_container_log_driver.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/migrations/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/host.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/image.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/network.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/registry.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/models/volume.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/navigation.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/signals.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-exec.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-layout.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-logs.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host-graph.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/network.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/registry.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templates/netbox_docker_plugin/volume.html +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templatetags/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/templatetags/host.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/base.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/test_container_actions.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/test_container_api_exec.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/test_container_operation_view.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/test_container_validation.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/container/test_container_views.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/host/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/host/test_replace_password.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/image/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/image/test_image_api.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/image/test_image_views.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/network/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/network/test_network_api.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/network/test_network_views.py +2 -2
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/registry/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/registry/test_registry_api.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/registry/test_registry_views.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/test_init.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/volume/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/volume/test_volume_api.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/tests/volume/test_volume_views.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/utilities/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/__init__.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/bind.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/device.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/env.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/host.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/label.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/log_driver_option.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/mount.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/network_setting.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/views/port.py +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin.egg-info/top_level.txt +0 -0
- {netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/setup.cfg +0 -0
{netbox_docker_plugin-4.8.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-4.10.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: netbox-docker-plugin
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.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
|
|
@@ -11,7 +11,7 @@ class NetBoxDockerConfig(PluginConfig):
|
|
|
11
11
|
name = "netbox_docker_plugin"
|
|
12
12
|
verbose_name = " NetBox Docker Plugin"
|
|
13
13
|
description = "Manage Docker"
|
|
14
|
-
version = "4.
|
|
14
|
+
version = "4.10.0"
|
|
15
15
|
base_url = "docker"
|
|
16
16
|
min_version = "4.3.7"
|
|
17
17
|
author = "Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>"
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/serializers.py
RENAMED
|
@@ -20,6 +20,7 @@ from ..models.container import (
|
|
|
20
20
|
NetworkSetting,
|
|
21
21
|
Device,
|
|
22
22
|
LogDriverOption,
|
|
23
|
+
Sysctl,
|
|
23
24
|
)
|
|
24
25
|
from ..models.registry import Registry
|
|
25
26
|
|
|
@@ -422,6 +423,19 @@ class DeviceSerializer(serializers.ModelSerializer):
|
|
|
422
423
|
)
|
|
423
424
|
|
|
424
425
|
|
|
426
|
+
class SysctlSerializer(serializers.ModelSerializer):
|
|
427
|
+
"""Container sysctl Serializer class"""
|
|
428
|
+
|
|
429
|
+
class Meta:
|
|
430
|
+
"""Container sysctl Serializer Meta class"""
|
|
431
|
+
|
|
432
|
+
model = Sysctl
|
|
433
|
+
fields = (
|
|
434
|
+
"key",
|
|
435
|
+
"value",
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
|
|
425
439
|
class ContainerSerializer(NetBoxModelSerializer):
|
|
426
440
|
"""Container Serializer class"""
|
|
427
441
|
|
|
@@ -438,6 +452,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
438
452
|
network_settings = NetworkSettingSerializer(many=True, required=False)
|
|
439
453
|
devices = DeviceSerializer(many=True, required=False)
|
|
440
454
|
log_driver_options = LogDriverOptionSerializer(many=True, required=False)
|
|
455
|
+
sysctls = SysctlSerializer(many=True, required=False)
|
|
441
456
|
|
|
442
457
|
class Meta:
|
|
443
458
|
"""Container Serializer Meta class"""
|
|
@@ -467,6 +482,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
467
482
|
"devices",
|
|
468
483
|
"log_driver",
|
|
469
484
|
"log_driver_options",
|
|
485
|
+
"sysctls",
|
|
470
486
|
"custom_fields",
|
|
471
487
|
"created",
|
|
472
488
|
"last_updated",
|
|
@@ -484,6 +500,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
484
500
|
attrs.pop("binds", None)
|
|
485
501
|
attrs.pop("network_settings", None)
|
|
486
502
|
attrs.pop("devices", None)
|
|
503
|
+
attrs.pop("sysctls", None)
|
|
487
504
|
|
|
488
505
|
super().validate(attrs)
|
|
489
506
|
|
|
@@ -499,6 +516,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
499
516
|
binds_data = validated_data.pop("binds", None)
|
|
500
517
|
network_settings_data = validated_data.pop("network_settings", None)
|
|
501
518
|
devices_data = validated_data.pop("devices", None)
|
|
519
|
+
sysctls_data = validated_data.pop("sysctls", None)
|
|
502
520
|
|
|
503
521
|
container = super().create(validated_data)
|
|
504
522
|
|
|
@@ -542,6 +560,10 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
542
560
|
obj.full_clean()
|
|
543
561
|
obj.save()
|
|
544
562
|
|
|
563
|
+
if sysctls_data is not None:
|
|
564
|
+
for sysctl in sysctls_data:
|
|
565
|
+
Sysctl.objects.create(container=container, **sysctl)
|
|
566
|
+
|
|
545
567
|
return container
|
|
546
568
|
|
|
547
569
|
# pylint: disable=R0912
|
|
@@ -554,6 +576,7 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
554
576
|
binds_data = validated_data.pop("binds", None)
|
|
555
577
|
network_settings_data = validated_data.pop("network_settings", None)
|
|
556
578
|
devices_data = validated_data.pop("devices", None)
|
|
579
|
+
sysctls_data = validated_data.pop("sysctls", None)
|
|
557
580
|
|
|
558
581
|
container = super().update(instance, validated_data)
|
|
559
582
|
|
|
@@ -605,6 +628,11 @@ class ContainerSerializer(NetBoxModelSerializer):
|
|
|
605
628
|
obj.full_clean()
|
|
606
629
|
obj.save()
|
|
607
630
|
|
|
631
|
+
if sysctls_data is not None:
|
|
632
|
+
Sysctl.objects.filter(container=container).delete()
|
|
633
|
+
for sysctl in sysctls_data:
|
|
634
|
+
Sysctl.objects.create(container=container, **sysctl)
|
|
635
|
+
|
|
608
636
|
return container
|
|
609
637
|
|
|
610
638
|
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/api/views.py
RENAMED
|
@@ -47,13 +47,19 @@ class HostViewSet(NetBoxModelViewSet):
|
|
|
47
47
|
def perform_create(self, serializer):
|
|
48
48
|
if isinstance(serializer.validated_data, Sequence):
|
|
49
49
|
for obj in serializer.validated_data:
|
|
50
|
-
token = Token(
|
|
50
|
+
token = Token(
|
|
51
|
+
user=self.request.user,
|
|
52
|
+
write_enabled=True,
|
|
53
|
+
description="DockerAgent",
|
|
54
|
+
)
|
|
51
55
|
token.save()
|
|
52
56
|
|
|
53
57
|
obj["token"] = token
|
|
54
58
|
obj["netbox_base_url"] = self.request.stream.META["HTTP_ORIGIN"]
|
|
55
59
|
else:
|
|
56
|
-
token = Token(
|
|
60
|
+
token = Token(
|
|
61
|
+
user=self.request.user, write_enabled=True, description="DockerAgent"
|
|
62
|
+
)
|
|
57
63
|
token.save()
|
|
58
64
|
|
|
59
65
|
serializer.validated_data["token"] = token
|
|
@@ -85,7 +91,7 @@ class ImageViewSet(NetBoxModelViewSet):
|
|
|
85
91
|
renderer_classes=[JSONRenderer],
|
|
86
92
|
)
|
|
87
93
|
def force_pull(self, _request, **_kwargs):
|
|
88
|
-
"""
|
|
94
|
+
"""Force pull an existing image"""
|
|
89
95
|
|
|
90
96
|
image: Image = self.get_object()
|
|
91
97
|
agent_url = image.host.endpoint
|
|
@@ -146,6 +152,7 @@ class ContainerViewSet(NetBoxModelViewSet):
|
|
|
146
152
|
"ports",
|
|
147
153
|
"labels",
|
|
148
154
|
"log_driver_options",
|
|
155
|
+
"sysctls",
|
|
149
156
|
"tags",
|
|
150
157
|
)
|
|
151
158
|
filterset_class = filtersets.ContainerFilterSet
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/filtersets.py
RENAMED
|
@@ -17,6 +17,7 @@ from .models.container import (
|
|
|
17
17
|
NetworkSetting,
|
|
18
18
|
Device,
|
|
19
19
|
LogDriverOption,
|
|
20
|
+
Sysctl,
|
|
20
21
|
)
|
|
21
22
|
from .models.registry import Registry
|
|
22
23
|
|
|
@@ -340,3 +341,22 @@ class DeviceFilterSet(BaseFilterSet):
|
|
|
340
341
|
|
|
341
342
|
model = Device
|
|
342
343
|
fields = ("id",)
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
class SysctlFilterSet(BaseFilterSet):
|
|
347
|
+
"""Sysctl filterset definition class"""
|
|
348
|
+
|
|
349
|
+
container_id = ModelMultipleChoiceFilter(
|
|
350
|
+
field_name="container_id",
|
|
351
|
+
queryset=Container.objects.all(),
|
|
352
|
+
label="Container (ID)",
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
class Meta:
|
|
356
|
+
"""Sysctl filterset definition meta class"""
|
|
357
|
+
|
|
358
|
+
model = Sysctl
|
|
359
|
+
fields = (
|
|
360
|
+
"id",
|
|
361
|
+
"key",
|
|
362
|
+
)
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/bind.py
RENAMED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import (
|
|
5
5
|
DynamicModelMultipleChoiceField,
|
|
6
|
-
DynamicModelChoiceField,
|
|
7
6
|
)
|
|
8
7
|
from netbox.forms import (
|
|
9
8
|
NetBoxModelFilterSetForm,
|
|
@@ -14,8 +13,11 @@ from ..models.container import Bind, Container
|
|
|
14
13
|
class BindForm(forms.ModelForm):
|
|
15
14
|
"""Bind form definition class"""
|
|
16
15
|
|
|
17
|
-
container =
|
|
18
|
-
label="Container",
|
|
16
|
+
container = forms.ModelChoiceField(
|
|
17
|
+
label="Container",
|
|
18
|
+
queryset=Container.objects.all(),
|
|
19
|
+
required=True,
|
|
20
|
+
widget=forms.HiddenInput,
|
|
19
21
|
)
|
|
20
22
|
|
|
21
23
|
class Meta:
|
|
@@ -29,12 +31,23 @@ class BindForm(forms.ModelForm):
|
|
|
29
31
|
"read_only",
|
|
30
32
|
)
|
|
31
33
|
labels = {
|
|
32
|
-
"container": "Container",
|
|
33
34
|
"host_path": "Path to mount on host",
|
|
34
35
|
"container_path": "Mountpoint in container",
|
|
35
36
|
"read_only": "Mount as read-only within the container",
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
def __init__(self, *args, **kwargs):
|
|
40
|
+
super().__init__(*args, **kwargs)
|
|
41
|
+
|
|
42
|
+
if "data" in kwargs:
|
|
43
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
44
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
45
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
46
|
+
else:
|
|
47
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
48
|
+
|
|
49
|
+
self.instance._meta.verbose_name = f"Bind — {container.first()}"
|
|
50
|
+
|
|
38
51
|
|
|
39
52
|
class BindFilterForm(NetBoxModelFilterSetForm):
|
|
40
53
|
"""Bind filter form definition class"""
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/container.py
RENAMED
|
@@ -67,11 +67,10 @@ class ContainerForm(NetBoxModelForm):
|
|
|
67
67
|
class ContainerEditForm(NetBoxModelForm):
|
|
68
68
|
"""Container form definition class"""
|
|
69
69
|
|
|
70
|
-
image =
|
|
70
|
+
image = forms.ModelChoiceField(
|
|
71
71
|
label="Image",
|
|
72
72
|
queryset=Image.objects.all(),
|
|
73
73
|
required=True,
|
|
74
|
-
query_params={"host_id": "$host"},
|
|
75
74
|
)
|
|
76
75
|
cap_add = forms.MultipleChoiceField(choices=ContainerCapAddChoices, required=False)
|
|
77
76
|
|
|
@@ -99,6 +98,11 @@ class ContainerEditForm(NetBoxModelForm):
|
|
|
99
98
|
"cmd": "Command",
|
|
100
99
|
}
|
|
101
100
|
|
|
101
|
+
def __init__(self, *args, **kwargs):
|
|
102
|
+
super().__init__(*args, **kwargs)
|
|
103
|
+
|
|
104
|
+
self.fields["image"].queryset = Image.objects.filter(host=self.instance.host)
|
|
105
|
+
|
|
102
106
|
|
|
103
107
|
class ContainerFilterForm(NetBoxModelFilterSetForm):
|
|
104
108
|
"""Container filter form definition class"""
|
|
@@ -124,9 +128,7 @@ class ContainerFilterForm(NetBoxModelFilterSetForm):
|
|
|
124
128
|
restart_policy = forms.ChoiceField(
|
|
125
129
|
label="Restart Policy", choices=ContainerRestartPolicyChoices, required=False
|
|
126
130
|
)
|
|
127
|
-
log_driver = forms.ChoiceField(
|
|
128
|
-
label="Logging driver", required=False
|
|
129
|
-
)
|
|
131
|
+
log_driver = forms.ChoiceField(label="Logging driver", required=False)
|
|
130
132
|
tag = TagFilterField(model)
|
|
131
133
|
|
|
132
134
|
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/device.py
RENAMED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import (
|
|
5
5
|
DynamicModelMultipleChoiceField,
|
|
6
|
-
DynamicModelChoiceField,
|
|
7
6
|
)
|
|
8
7
|
from netbox.forms import (
|
|
9
8
|
NetBoxModelFilterSetForm,
|
|
@@ -14,8 +13,11 @@ from ..models.container import Device, Container
|
|
|
14
13
|
class DeviceForm(forms.ModelForm):
|
|
15
14
|
"""Device form definition class"""
|
|
16
15
|
|
|
17
|
-
container =
|
|
18
|
-
label="Container",
|
|
16
|
+
container = forms.ModelChoiceField(
|
|
17
|
+
label="Container",
|
|
18
|
+
queryset=Container.objects.all(),
|
|
19
|
+
required=True,
|
|
20
|
+
widget=forms.HiddenInput,
|
|
19
21
|
)
|
|
20
22
|
|
|
21
23
|
class Meta:
|
|
@@ -28,11 +30,22 @@ class DeviceForm(forms.ModelForm):
|
|
|
28
30
|
"container_path",
|
|
29
31
|
)
|
|
30
32
|
labels = {
|
|
31
|
-
"container": "Container",
|
|
32
33
|
"host_path": "Path to the device on host",
|
|
33
34
|
"container_path": "Path to the device in container",
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
def __init__(self, *args, **kwargs):
|
|
38
|
+
super().__init__(*args, **kwargs)
|
|
39
|
+
|
|
40
|
+
if "data" in kwargs:
|
|
41
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
42
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
43
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
44
|
+
else:
|
|
45
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
46
|
+
|
|
47
|
+
self.instance._meta.verbose_name = f"Device — {container.first()}"
|
|
48
|
+
|
|
36
49
|
|
|
37
50
|
class DeviceFilterForm(NetBoxModelFilterSetForm):
|
|
38
51
|
"""Device filter form definition class"""
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Env Form definition"""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from ..models.container import Env, Container
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class EnvForm(forms.ModelForm):
|
|
8
|
+
"""Env form definition class"""
|
|
9
|
+
|
|
10
|
+
container = forms.ModelChoiceField(
|
|
11
|
+
label="Container",
|
|
12
|
+
queryset=Container.objects.all(),
|
|
13
|
+
required=True,
|
|
14
|
+
widget=forms.HiddenInput,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
class Meta:
|
|
18
|
+
"""Env form definition Meta class"""
|
|
19
|
+
|
|
20
|
+
model = Env
|
|
21
|
+
fields = (
|
|
22
|
+
"container",
|
|
23
|
+
"var_name",
|
|
24
|
+
"value",
|
|
25
|
+
)
|
|
26
|
+
labels = {
|
|
27
|
+
"var_name": "Variable Name",
|
|
28
|
+
"value": "Value",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def __init__(self, *args, **kwargs):
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
if "data" in kwargs:
|
|
35
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
36
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
37
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
38
|
+
else:
|
|
39
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
40
|
+
|
|
41
|
+
self.instance._meta.verbose_name = f"Environment variable — {container.first()}"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Label Form definition"""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from ..models.container import Label, Container
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LabelForm(forms.ModelForm):
|
|
8
|
+
"""Label form definition class"""
|
|
9
|
+
|
|
10
|
+
container = forms.ModelChoiceField(
|
|
11
|
+
label="Container",
|
|
12
|
+
queryset=Container.objects.all(),
|
|
13
|
+
required=True,
|
|
14
|
+
widget=forms.HiddenInput,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
class Meta:
|
|
18
|
+
"""Label form definition Meta class"""
|
|
19
|
+
|
|
20
|
+
model = Label
|
|
21
|
+
fields = (
|
|
22
|
+
"container",
|
|
23
|
+
"key",
|
|
24
|
+
"value",
|
|
25
|
+
)
|
|
26
|
+
labels = {
|
|
27
|
+
"key": "Key",
|
|
28
|
+
"value": "Value",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def __init__(self, *args, **kwargs):
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
if "data" in kwargs:
|
|
35
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
36
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
37
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
38
|
+
else:
|
|
39
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
40
|
+
|
|
41
|
+
self.instance._meta.verbose_name = f"Label — {container.first()}"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Log Driver option Form definition"""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from ..models.container import LogDriverOption, Container
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LogDriverOptionForm(forms.ModelForm):
|
|
8
|
+
"""Log Driver option form definition class"""
|
|
9
|
+
|
|
10
|
+
container = forms.ModelChoiceField(
|
|
11
|
+
label="Container",
|
|
12
|
+
queryset=Container.objects.all(),
|
|
13
|
+
required=True,
|
|
14
|
+
widget=forms.HiddenInput,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
class Meta:
|
|
18
|
+
"""Log Driver option form definition Meta class"""
|
|
19
|
+
|
|
20
|
+
model = LogDriverOption
|
|
21
|
+
fields = (
|
|
22
|
+
"container",
|
|
23
|
+
"option_name",
|
|
24
|
+
"value",
|
|
25
|
+
)
|
|
26
|
+
labels = {
|
|
27
|
+
"option_name": "Option Name",
|
|
28
|
+
"value": "Value",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def __init__(self, *args, **kwargs):
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
if "data" in kwargs:
|
|
35
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
36
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
37
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
38
|
+
else:
|
|
39
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
40
|
+
|
|
41
|
+
self.instance._meta.verbose_name = f"Log driver option — {container.first()}"
|
{netbox_docker_plugin-4.8.0 → netbox_docker_plugin-4.10.0}/netbox_docker_plugin/forms/mount.py
RENAMED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import (
|
|
5
5
|
DynamicModelMultipleChoiceField,
|
|
6
|
-
DynamicModelChoiceField,
|
|
7
6
|
)
|
|
8
7
|
from netbox.forms import (
|
|
9
8
|
NetBoxModelFilterSetForm,
|
|
@@ -15,10 +14,13 @@ from ..models.volume import Volume
|
|
|
15
14
|
class MountForm(forms.ModelForm):
|
|
16
15
|
"""Mount form definition class"""
|
|
17
16
|
|
|
18
|
-
container =
|
|
19
|
-
label="Container",
|
|
17
|
+
container = forms.ModelChoiceField(
|
|
18
|
+
label="Container",
|
|
19
|
+
queryset=Container.objects.all(),
|
|
20
|
+
required=True,
|
|
21
|
+
widget=forms.HiddenInput,
|
|
20
22
|
)
|
|
21
|
-
volume =
|
|
23
|
+
volume = forms.ModelChoiceField(
|
|
22
24
|
label="Volume", queryset=Volume.objects.all(), required=True
|
|
23
25
|
)
|
|
24
26
|
|
|
@@ -33,12 +35,27 @@ class MountForm(forms.ModelForm):
|
|
|
33
35
|
"read_only",
|
|
34
36
|
)
|
|
35
37
|
labels = {
|
|
36
|
-
"container": "Container",
|
|
37
38
|
"source": "Source directory",
|
|
38
39
|
"volume": "Volume",
|
|
39
40
|
"read_only": "Mount as read-only within the container",
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
def __init__(self, *args, **kwargs):
|
|
44
|
+
super().__init__(*args, **kwargs)
|
|
45
|
+
|
|
46
|
+
if "data" in kwargs:
|
|
47
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
48
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
49
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
50
|
+
else:
|
|
51
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
52
|
+
|
|
53
|
+
self.fields["volume"].queryset = Volume.objects.filter(
|
|
54
|
+
host=container.first().host
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
self.instance._meta.verbose_name = f"Mount — {container.first()}"
|
|
58
|
+
|
|
42
59
|
|
|
43
60
|
class MountFilterForm(NetBoxModelFilterSetForm):
|
|
44
61
|
"""Mount filter form definition class"""
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.fields import (
|
|
5
5
|
DynamicModelMultipleChoiceField,
|
|
6
|
-
DynamicModelChoiceField,
|
|
7
6
|
)
|
|
8
7
|
from netbox.forms import (
|
|
9
8
|
NetBoxModelFilterSetForm,
|
|
@@ -15,10 +14,13 @@ from ..models.network import Network
|
|
|
15
14
|
class NetworkSettingForm(forms.ModelForm):
|
|
16
15
|
"""NetworkSetting form definition class"""
|
|
17
16
|
|
|
18
|
-
container =
|
|
19
|
-
label="Container",
|
|
17
|
+
container = forms.ModelChoiceField(
|
|
18
|
+
label="Container",
|
|
19
|
+
queryset=Container.objects.all(),
|
|
20
|
+
required=True,
|
|
21
|
+
widget=forms.HiddenInput,
|
|
20
22
|
)
|
|
21
|
-
network =
|
|
23
|
+
network = forms.ModelChoiceField(
|
|
22
24
|
label="Network", queryset=Network.objects.all(), required=True
|
|
23
25
|
)
|
|
24
26
|
|
|
@@ -26,15 +28,28 @@ class NetworkSettingForm(forms.ModelForm):
|
|
|
26
28
|
"""NetworkSetting form definition Meta class"""
|
|
27
29
|
|
|
28
30
|
model = NetworkSetting
|
|
29
|
-
fields = (
|
|
30
|
-
"container",
|
|
31
|
-
"network"
|
|
32
|
-
)
|
|
31
|
+
fields = ("container", "network")
|
|
33
32
|
labels = {
|
|
34
|
-
"container": "Container",
|
|
35
33
|
"network": "Network",
|
|
36
34
|
}
|
|
37
35
|
|
|
36
|
+
def __init__(self, *args, **kwargs):
|
|
37
|
+
super().__init__(*args, **kwargs)
|
|
38
|
+
|
|
39
|
+
if "data" in kwargs:
|
|
40
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
41
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
42
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
43
|
+
else:
|
|
44
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
45
|
+
|
|
46
|
+
self.fields["network"].queryset = Network.objects.filter(
|
|
47
|
+
host=container.first().host
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
self.instance._meta.verbose_name = f"Network setting — {container.first()}"
|
|
51
|
+
|
|
52
|
+
|
|
38
53
|
class NetworkSettingFilterForm(NetBoxModelFilterSetForm):
|
|
39
54
|
"""Mount filter form definition class"""
|
|
40
55
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Port Form definition"""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from ..models.container import Port, Container
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PortForm(forms.ModelForm):
|
|
8
|
+
"""Port form definition class"""
|
|
9
|
+
|
|
10
|
+
container = forms.ModelChoiceField(
|
|
11
|
+
label="Container",
|
|
12
|
+
queryset=Container.objects.all(),
|
|
13
|
+
required=True,
|
|
14
|
+
widget=forms.HiddenInput,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
class Meta:
|
|
18
|
+
"""Port form definition Meta class"""
|
|
19
|
+
|
|
20
|
+
model = Port
|
|
21
|
+
fields = (
|
|
22
|
+
"container",
|
|
23
|
+
"public_port",
|
|
24
|
+
"private_port",
|
|
25
|
+
"type",
|
|
26
|
+
)
|
|
27
|
+
labels = {
|
|
28
|
+
"public_port": "Public Port",
|
|
29
|
+
"private_port": "Private Port",
|
|
30
|
+
"type": "Type",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
def __init__(self, *args, **kwargs):
|
|
34
|
+
super().__init__(*args, **kwargs)
|
|
35
|
+
|
|
36
|
+
if "data" in kwargs:
|
|
37
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
38
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
39
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
40
|
+
else:
|
|
41
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
42
|
+
|
|
43
|
+
self.instance._meta.verbose_name = f"Port mapping — {container.first()}"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Sysctl Form definition"""
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from ..models.container import Sysctl, Container
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SysctlForm(forms.ModelForm):
|
|
8
|
+
"""Sysctl form definition class"""
|
|
9
|
+
|
|
10
|
+
container = forms.ModelChoiceField(
|
|
11
|
+
label="Container",
|
|
12
|
+
queryset=Container.objects.all(),
|
|
13
|
+
required=True,
|
|
14
|
+
widget=forms.HiddenInput,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
class Meta:
|
|
18
|
+
"""Sysctl form definition Meta class"""
|
|
19
|
+
|
|
20
|
+
model = Sysctl
|
|
21
|
+
fields = (
|
|
22
|
+
"container",
|
|
23
|
+
"key",
|
|
24
|
+
"value",
|
|
25
|
+
)
|
|
26
|
+
labels = {
|
|
27
|
+
"key": " Sysctl Key",
|
|
28
|
+
"value": "Value",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def __init__(self, *args, **kwargs):
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
if "data" in kwargs:
|
|
35
|
+
container = Container.objects.filter(id=kwargs["data"]["container"])
|
|
36
|
+
elif "initial" in kwargs and "container" in kwargs["initial"]:
|
|
37
|
+
container = Container.objects.filter(id=kwargs["initial"]["container"])
|
|
38
|
+
else:
|
|
39
|
+
container = Container.objects.filter(id=self.instance.container.id)
|
|
40
|
+
|
|
41
|
+
self.instance._meta.verbose_name = f"Sysctl — {container.first()}"
|