-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow plugin models to be reported. (#68)
- Loading branch information
1 parent
2d82b1a
commit 0c09bf9
Showing
9 changed files
with
88 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Plugin declaration for nautobot_capacity_metrics.test_models. | ||
Why is this here? In order to test the plugin model count metric mechanics, a plugin metric had to be introduced. | ||
This was put into a separate app so that it is not installed whenever this plugin is installed, rather just when tests | ||
are ran within this plugins development environment. | ||
""" | ||
|
||
__version__ = "1.0.0" | ||
|
||
from nautobot.extras.plugins import PluginConfig | ||
|
||
|
||
class TestConfig(PluginConfig): | ||
"""Plugin configuration for the nautobot_capacity_metrics plugin.""" | ||
|
||
name = "nautobot_capacity_metrics.test_models" | ||
verbose_name = "Metrics & Monitoring Extension Test Model Plugin" | ||
version = __version__ | ||
author = "Network to Code, LLC" | ||
author_email = "[email protected]" | ||
description = "Plugin that exists solely to test nautobot_capacity_metrics, don't install.." | ||
base_url = "capacity-metrics-test" | ||
required_settings = [] | ||
min_version = "2.0.0" | ||
max_version = "2.99.99" | ||
default_settings = {} | ||
caching_config = {} | ||
|
||
|
||
config = TestConfig # pylint:disable=invalid-name |
29 changes: 29 additions & 0 deletions
29
nautobot_capacity_metrics/test_models/migrations/0001_initial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 3.2.16 on 2022-12-20 13:24 | ||
|
||
from django.db import migrations, models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="TestModel", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True | ||
), | ||
), | ||
("name", models.CharField(max_length=20)), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""Models for the testing plugin.""" | ||
|
||
from django.db.models import CharField | ||
from nautobot.core.models import BaseModel | ||
|
||
|
||
class TestModel(BaseModel): | ||
"""This is a model solely used for the testing of the capacity metrics plugin.""" | ||
|
||
name = CharField(max_length=20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters