netbox-docker-plugin 5.1.1__tar.gz → 5.3.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-5.1.1/netbox_docker_plugin.egg-info → netbox_docker_plugin-5.3.0}/PKG-INFO +1 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/__init__.py +1 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/api/serializers.py +8 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/api/views.py +8 -2
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/filtersets.py +12 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/host.py +37 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/image.py +39 -1
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/migrations/1044_host_virtual_machine.py +29 -0
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/migrations/1045_image_tenant_image_tenant_group.py +38 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/container.py +6 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/host.py +7 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/image.py +15 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tables.py +8 -0
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/template_content.py +23 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host.html +11 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +25 -0
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/templates/netbox_docker_plugin/virtual_machine_host_table.html +4 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_api.py +25 -4
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_api_exec.py +8 -3
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_operation_view.py +6 -2
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_validation.py +36 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_views.py +6 -2
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/host/test_host_views.py +2 -2
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/tests/host/test_host_virtual_machine.py +74 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/image/test_image_api.py +13 -1
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/tests/image/test_image_filtersets.py +89 -0
- netbox_docker_plugin-5.3.0/netbox_docker_plugin/tests/image/test_image_tenancy.py +121 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/image/test_image_views.py +13 -2
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/volume/test_volume_api.py +3 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/urls.py +1 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/host.py +15 -6
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0/netbox_docker_plugin.egg-info}/PKG-INFO +1 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin.egg-info/SOURCES.txt +7 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/pyproject.toml +1 -1
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/LICENSE +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/MANIFEST.in +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/README.md +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/api/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/api/renderers.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/api/urls.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/bind.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/container.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/device.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/env.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/label.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/log_driver_option.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/mount.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/network.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/network_setting.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/port.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/registry.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/sysctl.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/volume.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0001_initial.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0002_image.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0003_image_size.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0004_volume.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0005_network.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0006_container_port_mount_label_env_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0007_remove_container_netbox_docker_plugin_container_unique_name_host__and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0008_alter_network_unique_together_network_networkid_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0009_remove_container_network_networksettings_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0010_container_containerid_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0011_host_token.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0012_host_state.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0013_host_netbox_url.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0014_container_operation.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0015_remove_mount_netbox_docker_plugin_mount_unique_volume_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0016_alter_env_value.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0017_network_state.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0018_alter_mount_volume_alter_networksetting_network.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0019_host_agent_version_host_docker_api_version.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0020_container_hostname.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0021_registry_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0022_bind_bind_netbox_docker_plugin_bind_unique_bind.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0023_delete_hosts.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0024_registry_host_alter_registry_name_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0025_alter_image_version.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0026_image_digest.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0027_container_restart_policy.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0028_mount_and_bind_read_only.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0029_alter_container_state.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0030_alter_container_containerid_alter_container_hostname_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0031_container_cap_add.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0032_device_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0033_host_operation.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0034_volume_max_size.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0035_container_log_driver_logdriveroption.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0036_alter_container_log_driver.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0037_alter_env_value.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/0038_container_cmd.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/1039_alter_port_public_port.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/1040_alter_container_log_driver.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/1041_sysctl.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/1042_registry_username_max_length.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/1043_container_cap_drop_container_extra_hosts_and_more.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/migrations/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/network.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/registry.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/volume.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/navigation.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/signals.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-exec.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-layout.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-logs.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host-graph.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/network.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/registry.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templates/netbox_docker_plugin/volume.html +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templatetags/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/templatetags/host.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/base.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_actions.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/container/test_container_delete.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/host/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/host/test_host_api.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/host/test_replace_password.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/image/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/image/test_force_pull_image_with_special_cf.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/network/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/network/test_network_api.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/network/test_network_views.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/registry/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/registry/test_registry_api.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/registry/test_registry_views.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/test_init.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/volume/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/tests/volume/test_volume_views.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/utilities/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/__init__.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/bind.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/container.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/device.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/env.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/image.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/label.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/log_driver_option.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/mount.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/network.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/network_setting.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/port.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/registry.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/sysctl.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/views/volume.py +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin.egg-info/requires.txt +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin.egg-info/top_level.txt +0 -0
- {netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/setup.cfg +0 -0
{netbox_docker_plugin-5.1.1/netbox_docker_plugin.egg-info → netbox_docker_plugin-5.3.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: netbox-docker-plugin
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.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 = "5.
|
|
14
|
+
version = "5.3.0"
|
|
15
15
|
base_url = "docker"
|
|
16
16
|
min_version = "4.5.0"
|
|
17
17
|
author = "Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>"
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/api/serializers.py
RENAMED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
from rest_framework import serializers
|
|
6
6
|
from utilities.query import dict_to_filter_params
|
|
7
7
|
from users.models import Token
|
|
8
|
+
from virtualization.api.serializers import VirtualMachineSerializer
|
|
9
|
+
from tenancy.api.serializers_.tenants import TenantSerializer, TenantGroupSerializer
|
|
8
10
|
from netbox.api.serializers import NetBoxModelSerializer, WritableNestedSerializer
|
|
9
11
|
from ..models.host import Host
|
|
10
12
|
from ..models.image import Image
|
|
@@ -239,6 +241,8 @@ class ImageSerializer(NetBoxModelSerializer):
|
|
|
239
241
|
url = serializers.HyperlinkedIdentityField(
|
|
240
242
|
view_name="plugins-api:netbox_docker_plugin-api:image-detail"
|
|
241
243
|
)
|
|
244
|
+
tenant_group = TenantGroupSerializer(nested=True, required=False, allow_null=True)
|
|
245
|
+
tenant = TenantSerializer(nested=True, required=False, allow_null=True)
|
|
242
246
|
host = NestedHostSerializer()
|
|
243
247
|
containers = NestedContainerSerializer(many=True, read_only=True)
|
|
244
248
|
registry = NestedRegistrySerializer()
|
|
@@ -251,6 +255,8 @@ class ImageSerializer(NetBoxModelSerializer):
|
|
|
251
255
|
"id",
|
|
252
256
|
"url",
|
|
253
257
|
"display",
|
|
258
|
+
"tenant_group",
|
|
259
|
+
"tenant",
|
|
254
260
|
"host",
|
|
255
261
|
"name",
|
|
256
262
|
"version",
|
|
@@ -693,6 +699,7 @@ class HostSerializer(NetBoxModelSerializer):
|
|
|
693
699
|
containers = NestedContainerSerializer(many=True, read_only=True)
|
|
694
700
|
registries = NestedRegistrySerializer(many=True, read_only=True)
|
|
695
701
|
token = NestedTokenSerializer(read_only=True)
|
|
702
|
+
virtual_machine = VirtualMachineSerializer(required=False)
|
|
696
703
|
|
|
697
704
|
class Meta:
|
|
698
705
|
"""Host Serializer Meta class"""
|
|
@@ -706,6 +713,7 @@ class HostSerializer(NetBoxModelSerializer):
|
|
|
706
713
|
"name",
|
|
707
714
|
"state",
|
|
708
715
|
"token",
|
|
716
|
+
"virtual_machine",
|
|
709
717
|
"netbox_base_url",
|
|
710
718
|
"agent_version",
|
|
711
719
|
"docker_api_version",
|
|
@@ -39,7 +39,13 @@ class HostViewSet(NetBoxModelViewSet):
|
|
|
39
39
|
"""Host view set class"""
|
|
40
40
|
|
|
41
41
|
queryset = Host.objects.prefetch_related(
|
|
42
|
-
"images",
|
|
42
|
+
"images",
|
|
43
|
+
"volumes",
|
|
44
|
+
"networks",
|
|
45
|
+
"containers",
|
|
46
|
+
"registries",
|
|
47
|
+
"virtual_machine",
|
|
48
|
+
"tags",
|
|
43
49
|
)
|
|
44
50
|
filterset_class = filtersets.HostFilterSet
|
|
45
51
|
serializer_class = HostSerializer
|
|
@@ -108,7 +114,7 @@ class ImageViewSet(NetBoxModelViewSet):
|
|
|
108
114
|
url,
|
|
109
115
|
timeout=10,
|
|
110
116
|
data=json.dumps({"data": data}, cls=DjangoJSONEncoder),
|
|
111
|
-
headers={"Content-Type": "application/json"}
|
|
117
|
+
headers={"Content-Type": "application/json"},
|
|
112
118
|
)
|
|
113
119
|
resp.raise_for_status()
|
|
114
120
|
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/filtersets.py
RENAMED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from django_filters import filters, ModelMultipleChoiceFilter
|
|
4
4
|
from django.db.models import Q
|
|
5
|
+
from tenancy.models import Tenant, TenantGroup
|
|
5
6
|
from netbox.filtersets import NetBoxModelFilterSet, BaseFilterSet
|
|
6
7
|
from .models.host import Host
|
|
7
8
|
from .models.image import Image
|
|
@@ -38,6 +39,7 @@ class HostFilterSet(NetBoxModelFilterSet):
|
|
|
38
39
|
"state",
|
|
39
40
|
"agent_version",
|
|
40
41
|
"docker_api_version",
|
|
42
|
+
"virtual_machine",
|
|
41
43
|
)
|
|
42
44
|
|
|
43
45
|
# pylint: disable=W0613
|
|
@@ -76,6 +78,16 @@ class ImageFilterSet(NetBoxModelFilterSet):
|
|
|
76
78
|
"""Image filterset definition class"""
|
|
77
79
|
|
|
78
80
|
name = filters.CharFilter(lookup_expr="icontains")
|
|
81
|
+
tenant_group_id = ModelMultipleChoiceFilter(
|
|
82
|
+
field_name="tenant_group_id",
|
|
83
|
+
queryset=TenantGroup.objects.all(),
|
|
84
|
+
label="Tenant Group (ID)",
|
|
85
|
+
)
|
|
86
|
+
tenant_id = ModelMultipleChoiceFilter(
|
|
87
|
+
field_name="tenant_id",
|
|
88
|
+
queryset=Tenant.objects.all(),
|
|
89
|
+
label="Tenant (ID)",
|
|
90
|
+
)
|
|
79
91
|
host_id = ModelMultipleChoiceFilter(
|
|
80
92
|
field_name="host_id",
|
|
81
93
|
queryset=Host.objects.all(),
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/host.py
RENAMED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from django import forms
|
|
4
4
|
from utilities.forms.rendering import FieldSet
|
|
5
|
-
from utilities.forms.fields import TagFilterField
|
|
5
|
+
from utilities.forms.fields import TagFilterField, DynamicModelChoiceField
|
|
6
|
+
from virtualization.models import VirtualMachine
|
|
6
7
|
from netbox.forms import (
|
|
7
8
|
NetBoxModelForm,
|
|
8
9
|
NetBoxModelImportForm,
|
|
@@ -12,9 +13,43 @@ from netbox.forms import (
|
|
|
12
13
|
from ..models.host import Host, HostStateChoices
|
|
13
14
|
|
|
14
15
|
|
|
16
|
+
class HostAddForm(NetBoxModelForm):
|
|
17
|
+
"""Host form definition class"""
|
|
18
|
+
|
|
19
|
+
virtual_machine = DynamicModelChoiceField(
|
|
20
|
+
queryset=VirtualMachine.objects.all(),
|
|
21
|
+
selector=True,
|
|
22
|
+
required=False,
|
|
23
|
+
label="Virtual Machine",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
class Meta:
|
|
27
|
+
"""Host form definition Meta class"""
|
|
28
|
+
|
|
29
|
+
model = Host
|
|
30
|
+
fields = (
|
|
31
|
+
"name",
|
|
32
|
+
"endpoint",
|
|
33
|
+
"virtual_machine",
|
|
34
|
+
)
|
|
35
|
+
help_texts = {"name": "Unique Name", "endpoint": "Docker instance endpoint"}
|
|
36
|
+
labels = {"name": "Name", "endpoint": "Endpoint"}
|
|
37
|
+
|
|
38
|
+
def __init__(self, *args, **kwargs):
|
|
39
|
+
super().__init__(*args, **kwargs)
|
|
40
|
+
self.fields.pop("tags", None)
|
|
41
|
+
|
|
42
|
+
|
|
15
43
|
class HostForm(NetBoxModelForm):
|
|
16
44
|
"""Host form definition class"""
|
|
17
45
|
|
|
46
|
+
virtual_machine = DynamicModelChoiceField(
|
|
47
|
+
queryset=VirtualMachine.objects.all(),
|
|
48
|
+
selector=True,
|
|
49
|
+
required=False,
|
|
50
|
+
label="Virtual Machine",
|
|
51
|
+
)
|
|
52
|
+
|
|
18
53
|
class Meta:
|
|
19
54
|
"""Host form definition Meta class"""
|
|
20
55
|
|
|
@@ -22,6 +57,7 @@ class HostForm(NetBoxModelForm):
|
|
|
22
57
|
fields = (
|
|
23
58
|
"name",
|
|
24
59
|
"endpoint",
|
|
60
|
+
"virtual_machine",
|
|
25
61
|
"tags",
|
|
26
62
|
)
|
|
27
63
|
help_texts = {"name": "Unique Name", "endpoint": "Docker instance endpoint"}
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/forms/image.py
RENAMED
|
@@ -7,6 +7,7 @@ from utilities.forms.fields import (
|
|
|
7
7
|
DynamicModelMultipleChoiceField,
|
|
8
8
|
DynamicModelChoiceField,
|
|
9
9
|
)
|
|
10
|
+
from tenancy.models import Tenant, TenantGroup
|
|
10
11
|
from netbox.forms import (
|
|
11
12
|
NetBoxModelForm,
|
|
12
13
|
NetBoxModelImportForm,
|
|
@@ -21,6 +22,13 @@ from ..models.registry import Registry
|
|
|
21
22
|
class ImageForm(NetBoxModelForm):
|
|
22
23
|
"""Image form definition class"""
|
|
23
24
|
|
|
25
|
+
tenant_group = DynamicModelChoiceField(
|
|
26
|
+
label="Tenant Group", queryset=TenantGroup.objects.all(), required=False
|
|
27
|
+
)
|
|
28
|
+
tenant = DynamicModelChoiceField(
|
|
29
|
+
label="Tenant", queryset=Tenant.objects.all(), required=False,
|
|
30
|
+
query_params={"group_id": "$tenant_group"},
|
|
31
|
+
)
|
|
24
32
|
host = DynamicModelChoiceField(
|
|
25
33
|
label="Host", queryset=Host.objects.all(), required=True
|
|
26
34
|
)
|
|
@@ -31,11 +39,18 @@ class ImageForm(NetBoxModelForm):
|
|
|
31
39
|
query_params={"host_id": "$host"},
|
|
32
40
|
)
|
|
33
41
|
|
|
42
|
+
fieldsets = (
|
|
43
|
+
FieldSet("host", "registry", "name", "version", "tags", name="General"),
|
|
44
|
+
FieldSet("tenant_group", "tenant", name="Tenancy"),
|
|
45
|
+
)
|
|
46
|
+
|
|
34
47
|
class Meta:
|
|
35
48
|
"""Image form definition Meta class"""
|
|
36
49
|
|
|
37
50
|
model = Image
|
|
38
51
|
fields = (
|
|
52
|
+
"tenant_group",
|
|
53
|
+
"tenant",
|
|
39
54
|
"host",
|
|
40
55
|
"registry",
|
|
41
56
|
"name",
|
|
@@ -44,6 +59,8 @@ class ImageForm(NetBoxModelForm):
|
|
|
44
59
|
)
|
|
45
60
|
labels = {
|
|
46
61
|
"name": "Name",
|
|
62
|
+
"tenant_group": "Tenant Group",
|
|
63
|
+
"tenant": "Tenant",
|
|
47
64
|
"host": "Host",
|
|
48
65
|
"registry": "Registry",
|
|
49
66
|
"version": "Version",
|
|
@@ -54,6 +71,16 @@ class ImageFilterForm(NetBoxModelFilterSetForm):
|
|
|
54
71
|
"""Image filter form definition class"""
|
|
55
72
|
|
|
56
73
|
model = Image
|
|
74
|
+
tenant_group_id = DynamicModelMultipleChoiceField(
|
|
75
|
+
queryset=TenantGroup.objects.all(),
|
|
76
|
+
required=False,
|
|
77
|
+
label="Tenant Group",
|
|
78
|
+
)
|
|
79
|
+
tenant_id = DynamicModelMultipleChoiceField(
|
|
80
|
+
queryset=Tenant.objects.all(),
|
|
81
|
+
required=False,
|
|
82
|
+
label="Tenant",
|
|
83
|
+
)
|
|
57
84
|
name = forms.CharField(label="Name", max_length=256, min_length=1, required=False)
|
|
58
85
|
version = forms.CharField(
|
|
59
86
|
label="Version", max_length=256, min_length=1, required=False
|
|
@@ -97,9 +124,20 @@ class ImageImportForm(NetBoxModelImportForm):
|
|
|
97
124
|
class ImageBulkEditForm(NetBoxModelBulkEditForm):
|
|
98
125
|
"""Image bulk edit form definition class"""
|
|
99
126
|
|
|
127
|
+
tenant_group = DynamicModelChoiceField(
|
|
128
|
+
queryset=TenantGroup.objects.all(),
|
|
129
|
+
required=False,
|
|
130
|
+
)
|
|
131
|
+
tenant = DynamicModelChoiceField(
|
|
132
|
+
queryset=Tenant.objects.all(),
|
|
133
|
+
required=False,
|
|
134
|
+
)
|
|
100
135
|
version = forms.CharField(
|
|
101
136
|
required=False,
|
|
102
137
|
)
|
|
103
138
|
|
|
104
139
|
model = Image
|
|
105
|
-
fieldsets = (
|
|
140
|
+
fieldsets = (
|
|
141
|
+
FieldSet("version", name="General"),
|
|
142
|
+
FieldSet("tenant_group", "tenant", name="Tenancy"),
|
|
143
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# pylint: disable=C0103
|
|
2
|
+
"""Migration file"""
|
|
3
|
+
|
|
4
|
+
import django.db.models.deletion
|
|
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
|
+
"1043_container_cap_drop_container_extra_hosts_and_more",
|
|
15
|
+
),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
operations = [
|
|
19
|
+
migrations.AddField(
|
|
20
|
+
model_name="host",
|
|
21
|
+
name="virtual_machine",
|
|
22
|
+
field=models.OneToOneField(
|
|
23
|
+
blank=True,
|
|
24
|
+
null=True,
|
|
25
|
+
on_delete=django.db.models.deletion.SET_NULL,
|
|
26
|
+
to="virtualization.virtualmachine",
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
]
|
netbox_docker_plugin-5.3.0/netbox_docker_plugin/migrations/1045_image_tenant_image_tenant_group.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# pylint: disable=C0103
|
|
2
|
+
"""Migration file"""
|
|
3
|
+
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
from django.db import migrations, models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Migration(migrations.Migration):
|
|
9
|
+
"""Migration file"""
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
("netbox_docker_plugin", "1044_host_virtual_machine"),
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
operations = [
|
|
16
|
+
migrations.AddField(
|
|
17
|
+
model_name="image",
|
|
18
|
+
name="tenant",
|
|
19
|
+
field=models.ForeignKey(
|
|
20
|
+
blank=True,
|
|
21
|
+
null=True,
|
|
22
|
+
on_delete=django.db.models.deletion.SET_NULL,
|
|
23
|
+
related_name="images",
|
|
24
|
+
to="tenancy.tenant",
|
|
25
|
+
),
|
|
26
|
+
),
|
|
27
|
+
migrations.AddField(
|
|
28
|
+
model_name="image",
|
|
29
|
+
name="tenant_group",
|
|
30
|
+
field=models.ForeignKey(
|
|
31
|
+
blank=True,
|
|
32
|
+
null=True,
|
|
33
|
+
on_delete=django.db.models.deletion.SET_NULL,
|
|
34
|
+
related_name="images",
|
|
35
|
+
to="tenancy.tenantgroup",
|
|
36
|
+
),
|
|
37
|
+
),
|
|
38
|
+
]
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/container.py
RENAMED
|
@@ -328,6 +328,7 @@ class Container(NetBoxModel):
|
|
|
328
328
|
return reverse("plugins:netbox_docker_plugin:container", args=[self.pk])
|
|
329
329
|
|
|
330
330
|
def clean(self):
|
|
331
|
+
"""Validate that the image belongs to the same host and has been pulled."""
|
|
331
332
|
super().clean()
|
|
332
333
|
|
|
333
334
|
if self.host != self.image.host:
|
|
@@ -335,6 +336,11 @@ class Container(NetBoxModel):
|
|
|
335
336
|
{"image": f"Image {self.image} does not belong to host {self.host}."}
|
|
336
337
|
)
|
|
337
338
|
|
|
339
|
+
if not self.image.ImageID:
|
|
340
|
+
raise ValidationError(
|
|
341
|
+
{"image": f"Image {self.image} has no ID yet. Pull or refresh it first."}
|
|
342
|
+
)
|
|
343
|
+
|
|
338
344
|
|
|
339
345
|
class Port(models.Model):
|
|
340
346
|
"""Container definition class"""
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/host.py
RENAMED
|
@@ -9,6 +9,7 @@ from django.core.validators import (
|
|
|
9
9
|
)
|
|
10
10
|
from utilities.choices import ChoiceSet
|
|
11
11
|
from users.models import Token
|
|
12
|
+
from virtualization.models import VirtualMachine
|
|
12
13
|
from netbox.models import NetBoxModel
|
|
13
14
|
|
|
14
15
|
|
|
@@ -64,6 +65,12 @@ class Host(NetBoxModel):
|
|
|
64
65
|
default=HostStateChoices.STATE_CREATED,
|
|
65
66
|
)
|
|
66
67
|
token = models.ForeignKey(Token, on_delete=models.SET_NULL, null=True, blank=True)
|
|
68
|
+
virtual_machine = models.OneToOneField(
|
|
69
|
+
VirtualMachine,
|
|
70
|
+
on_delete=models.SET_NULL,
|
|
71
|
+
null=True,
|
|
72
|
+
blank=True,
|
|
73
|
+
)
|
|
67
74
|
netbox_base_url = models.CharField(
|
|
68
75
|
max_length=1024,
|
|
69
76
|
validators=[URLValidator()],
|
{netbox_docker_plugin-5.1.1 → netbox_docker_plugin-5.3.0}/netbox_docker_plugin/models/image.py
RENAMED
|
@@ -8,6 +8,7 @@ from django.core.validators import (
|
|
|
8
8
|
MinValueValidator,
|
|
9
9
|
MaxValueValidator,
|
|
10
10
|
)
|
|
11
|
+
from tenancy.models import Tenant, TenantGroup
|
|
11
12
|
from netbox.models import NetBoxModel
|
|
12
13
|
from .host import Host
|
|
13
14
|
from .registry import Registry
|
|
@@ -16,6 +17,20 @@ from .registry import Registry
|
|
|
16
17
|
class Image(NetBoxModel):
|
|
17
18
|
"""Image definition class"""
|
|
18
19
|
|
|
20
|
+
tenant_group = models.ForeignKey(
|
|
21
|
+
TenantGroup,
|
|
22
|
+
on_delete=models.SET_NULL,
|
|
23
|
+
related_name="images",
|
|
24
|
+
blank=True,
|
|
25
|
+
null=True,
|
|
26
|
+
)
|
|
27
|
+
tenant = models.ForeignKey(
|
|
28
|
+
Tenant,
|
|
29
|
+
on_delete=models.SET_NULL,
|
|
30
|
+
related_name="images",
|
|
31
|
+
blank=True,
|
|
32
|
+
null=True,
|
|
33
|
+
)
|
|
19
34
|
host = models.ForeignKey(Host, on_delete=models.CASCADE, related_name="images")
|
|
20
35
|
registry = models.ForeignKey(
|
|
21
36
|
Registry,
|
|
@@ -26,6 +26,7 @@ class HostTable(NetBoxTable):
|
|
|
26
26
|
"""Host Table definition class"""
|
|
27
27
|
|
|
28
28
|
name = tables.Column(linkify=True)
|
|
29
|
+
virtual_machine = tables.Column(linkify=True, verbose_name="Virtual Machine")
|
|
29
30
|
image_count = columns.LinkedCountColumn(
|
|
30
31
|
viewname="plugins:netbox_docker_plugin:image_list",
|
|
31
32
|
url_params={"host_id": "pk"},
|
|
@@ -62,6 +63,7 @@ class HostTable(NetBoxTable):
|
|
|
62
63
|
"name",
|
|
63
64
|
"endpoint",
|
|
64
65
|
"state",
|
|
66
|
+
"virtual_machine",
|
|
65
67
|
"agent_version",
|
|
66
68
|
"docker_api_version",
|
|
67
69
|
"image_count",
|
|
@@ -139,6 +141,8 @@ class MinRegistryTable(NetBoxTable):
|
|
|
139
141
|
class ImageTable(NetBoxTable):
|
|
140
142
|
"""Image Table definition class"""
|
|
141
143
|
|
|
144
|
+
tenant_group = tables.Column(linkify=True)
|
|
145
|
+
tenant = tables.Column(linkify=True)
|
|
142
146
|
host = tables.Column(linkify=True)
|
|
143
147
|
registry = tables.Column(linkify=True)
|
|
144
148
|
name = tables.Column(linkify=True)
|
|
@@ -160,6 +164,8 @@ class ImageTable(NetBoxTable):
|
|
|
160
164
|
fields = (
|
|
161
165
|
"pk",
|
|
162
166
|
"id",
|
|
167
|
+
"tenant_group",
|
|
168
|
+
"tenant",
|
|
163
169
|
"host",
|
|
164
170
|
"name",
|
|
165
171
|
"version",
|
|
@@ -170,6 +176,8 @@ class ImageTable(NetBoxTable):
|
|
|
170
176
|
"tags",
|
|
171
177
|
)
|
|
172
178
|
default_columns = (
|
|
179
|
+
"tenant_group",
|
|
180
|
+
"tenant",
|
|
173
181
|
"host",
|
|
174
182
|
"name",
|
|
175
183
|
"version",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Template modifications definitions"""
|
|
2
|
+
|
|
3
|
+
# pylint: disable=W0223
|
|
4
|
+
|
|
5
|
+
from netbox.plugins import PluginTemplateExtension
|
|
6
|
+
from .models import Host
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class VirtualMachineHostTable(PluginTemplateExtension):
|
|
10
|
+
"""Virtual machine object template"""
|
|
11
|
+
|
|
12
|
+
models = ["virtualization.virtualmachine"]
|
|
13
|
+
|
|
14
|
+
def right_page(self):
|
|
15
|
+
return self.render(
|
|
16
|
+
"netbox_docker_plugin/virtual_machine_host_table.html",
|
|
17
|
+
extra_context={
|
|
18
|
+
"Host": Host.objects.filter(virtual_machine=self.context["object"])
|
|
19
|
+
},
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
template_extensions = [VirtualMachineHostTable]
|
|
@@ -27,6 +27,17 @@
|
|
|
27
27
|
<th scope="row">Endpoint</th>
|
|
28
28
|
<td>{{ object.endpoint|remove_password }}</td>
|
|
29
29
|
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<th scope="row">Virtual Machine</th>
|
|
32
|
+
<td>
|
|
33
|
+
{% if object.virtual_machine %}
|
|
34
|
+
<a href="{% url 'virtualization:virtualmachine' pk=object.virtual_machine.pk %}">
|
|
35
|
+
{{ object.virtual_machine|placeholder }}</a>
|
|
36
|
+
{% else %}
|
|
37
|
+
{{ object.virtual_machine|placeholder }}</a>
|
|
38
|
+
{% endif %}
|
|
39
|
+
</td>
|
|
40
|
+
</tr>
|
|
30
41
|
<tr>
|
|
31
42
|
<th scope="row">State</th>
|
|
32
43
|
<td>{{ object.get_state_display }}</td>
|
|
@@ -103,6 +103,31 @@
|
|
|
103
103
|
</tr>
|
|
104
104
|
</table>
|
|
105
105
|
</div>
|
|
106
|
+
<div class="card">
|
|
107
|
+
<h2 class="card-header">Tenancy</h2>
|
|
108
|
+
<table class="table table-hover attr-table">
|
|
109
|
+
<tr>
|
|
110
|
+
<th scope="row">Tenant Group</th>
|
|
111
|
+
<td>
|
|
112
|
+
{% if object.tenant_group %}
|
|
113
|
+
<a href="{{ object.tenant_group.get_absolute_url }}">{{ object.tenant_group }}</a>
|
|
114
|
+
{% else %}
|
|
115
|
+
{{ None|placeholder }}
|
|
116
|
+
{% endif %}
|
|
117
|
+
</td>
|
|
118
|
+
</tr>
|
|
119
|
+
<tr>
|
|
120
|
+
<th scope="row">Tenant</th>
|
|
121
|
+
<td>
|
|
122
|
+
{% if object.tenant %}
|
|
123
|
+
<a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
|
|
124
|
+
{% else %}
|
|
125
|
+
{{ None|placeholder }}
|
|
126
|
+
{% endif %}
|
|
127
|
+
</td>
|
|
128
|
+
</tr>
|
|
129
|
+
</table>
|
|
130
|
+
</div>
|
|
106
131
|
{% include 'inc/panels/custom_fields.html' %}
|
|
107
132
|
{% include 'inc/panels/tags.html' %}
|
|
108
133
|
{% plugin_left_page object %}
|
|
@@ -70,8 +70,18 @@ class ContainerApiTestCase(
|
|
|
70
70
|
host=host2, name="registry2", serveraddress="http://localhost:8082"
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
image1 = Image.objects.create(
|
|
74
|
-
|
|
73
|
+
image1 = Image.objects.create(
|
|
74
|
+
host=host1,
|
|
75
|
+
name="image1",
|
|
76
|
+
registry=registry1,
|
|
77
|
+
ImageID="sha256:abc123",
|
|
78
|
+
)
|
|
79
|
+
image2 = Image.objects.create(
|
|
80
|
+
host=host2,
|
|
81
|
+
name="image2",
|
|
82
|
+
registry=registry2,
|
|
83
|
+
ImageID="sha256:abc456",
|
|
84
|
+
)
|
|
75
85
|
|
|
76
86
|
network1 = Network.objects.create(host=host1, name="network1")
|
|
77
87
|
network2 = Network.objects.create(host=host2, name="network2")
|
|
@@ -244,6 +254,7 @@ class ContainerApiTestCase(
|
|
|
244
254
|
host=host3,
|
|
245
255
|
name="image3",
|
|
246
256
|
registry=registry3,
|
|
257
|
+
ImageID="sha256:abc789",
|
|
247
258
|
)
|
|
248
259
|
container11 = Container.objects.create(
|
|
249
260
|
host=host3,
|
|
@@ -330,8 +341,18 @@ class ContainerApiTestCase(
|
|
|
330
341
|
host=host2, name="registry5", serveraddress="http://localhost:8082"
|
|
331
342
|
)
|
|
332
343
|
|
|
333
|
-
image1 = Image.objects.create(
|
|
334
|
-
|
|
344
|
+
image1 = Image.objects.create(
|
|
345
|
+
host=host1,
|
|
346
|
+
name="image",
|
|
347
|
+
registry=registry1,
|
|
348
|
+
ImageID="sha256:abc101112",
|
|
349
|
+
)
|
|
350
|
+
image2 = Image.objects.create(
|
|
351
|
+
host=host2,
|
|
352
|
+
name="image",
|
|
353
|
+
registry=registry2,
|
|
354
|
+
ImageID="sha256:abc131415",
|
|
355
|
+
)
|
|
335
356
|
|
|
336
357
|
container = Container.objects.create(host=host1, image=image1, name="container")
|
|
337
358
|
|
|
@@ -28,7 +28,12 @@ class ContainerApiExecTestCase(BaseAPITestCase):
|
|
|
28
28
|
host=host1, name="registry1", serveraddress="http://localhost:8080"
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
image1 = Image.objects.create(
|
|
31
|
+
image1 = Image.objects.create(
|
|
32
|
+
host=host1,
|
|
33
|
+
name="image1",
|
|
34
|
+
registry=registry1,
|
|
35
|
+
ImageID="sha256:abc123",
|
|
36
|
+
)
|
|
32
37
|
|
|
33
38
|
container = Container.objects.create(
|
|
34
39
|
host=host1,
|
|
@@ -86,11 +91,11 @@ class ContainerApiExecTestCase(BaseAPITestCase):
|
|
|
86
91
|
m.put(
|
|
87
92
|
"http://localhost:8080/api/engine/containers/1234/exec",
|
|
88
93
|
text="Error",
|
|
89
|
-
status_code=
|
|
94
|
+
status_code=500,
|
|
90
95
|
)
|
|
91
96
|
|
|
92
97
|
response = self.client.post(
|
|
93
98
|
self.endpoint, **self.header, data={"cmd": ["ls"]}, format="json"
|
|
94
99
|
)
|
|
95
100
|
self.assertHttpStatus(response, status.HTTP_502_BAD_GATEWAY)
|
|
96
|
-
self.assertEqual(response.data,
|
|
101
|
+
self.assertEqual(response.data, "Error")
|
|
@@ -257,8 +257,12 @@ class ContainerViewsTestCase(BaseModelViewTestCase, ModelViewTestCase):
|
|
|
257
257
|
host=host2, name="registry2", serveraddress="http://localhost:8082"
|
|
258
258
|
)
|
|
259
259
|
|
|
260
|
-
image1 = Image.objects.create(
|
|
261
|
-
|
|
260
|
+
image1 = Image.objects.create(
|
|
261
|
+
host=host1, name="image1", registry=registry1, ImageID="sha256:abc123"
|
|
262
|
+
)
|
|
263
|
+
image2 = Image.objects.create(
|
|
264
|
+
host=host2, name="image2", registry=registry2, ImageID="sha256:abc456"
|
|
265
|
+
)
|
|
262
266
|
|
|
263
267
|
Container.objects.create(
|
|
264
268
|
host=host1,
|