ipfabric_netbox 4.2.1b3__py3-none-any.whl → 4.2.2__py3-none-any.whl
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.
Potentially problematic release.
This version of ipfabric_netbox might be problematic. Click here for more details.
- ipfabric_netbox/__init__.py +1 -1
- ipfabric_netbox/api/__init__.py +1 -0
- ipfabric_netbox/api/nested_serializers.py +78 -0
- ipfabric_netbox/api/serializers.py +90 -147
- ipfabric_netbox/api/urls.py +4 -4
- ipfabric_netbox/api/views.py +19 -18
- ipfabric_netbox/choices.py +12 -0
- ipfabric_netbox/filtersets.py +4 -67
- ipfabric_netbox/forms.py +140 -99
- ipfabric_netbox/models.py +10 -10
- ipfabric_netbox/tables.py +9 -30
- ipfabric_netbox/templates/ipfabric_netbox/ipfabricsource.html +1 -1
- ipfabric_netbox/templates/ipfabric_netbox/ipfabricsync_list.html +71 -0
- ipfabric_netbox/tests/test_models.py +11 -47
- ipfabric_netbox/utilities/ipfutils.py +23 -43
- ipfabric_netbox/views.py +13 -17
- {ipfabric_netbox-4.2.1b3.dist-info → ipfabric_netbox-4.2.2.dist-info}/METADATA +6 -6
- {ipfabric_netbox-4.2.1b3.dist-info → ipfabric_netbox-4.2.2.dist-info}/RECORD +19 -28
- ipfabric_netbox/graphql/__init__.py +0 -23
- ipfabric_netbox/graphql/enums.py +0 -35
- ipfabric_netbox/graphql/filters.py +0 -317
- ipfabric_netbox/graphql/schema.py +0 -101
- ipfabric_netbox/graphql/types.py +0 -216
- ipfabric_netbox/migrations/0016_tags_and_changelog_for_snapshots.py +0 -31
- ipfabric_netbox/migrations/0017_ipfabricsync_update_custom_fields.py +0 -17
- ipfabric_netbox/migrations/0018_remove_type_field.py +0 -17
- ipfabric_netbox/tests/api/__init__.py +0 -0
- ipfabric_netbox/tests/api/test_api.py +0 -879
- ipfabric_netbox/tests/test_forms.py +0 -1440
- {ipfabric_netbox-4.2.1b3.dist-info → ipfabric_netbox-4.2.2.dist-info}/WHEEL +0 -0
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import strawberry
|
|
2
|
-
import strawberry_django
|
|
3
|
-
|
|
4
|
-
from .types import IPFabricDataType
|
|
5
|
-
from .types import IPFabricIngestionIssueType
|
|
6
|
-
from .types import IPFabricIngestionType
|
|
7
|
-
from .types import IPFabricRelationshipFieldType
|
|
8
|
-
from .types import IPFabricSnapshotType
|
|
9
|
-
from .types import IPFabricSourceType
|
|
10
|
-
from .types import IPFabricSyncType
|
|
11
|
-
from .types import IPFabricTransformFieldType
|
|
12
|
-
from .types import IPFabricTransformMapGroupType
|
|
13
|
-
from .types import IPFabricTransformMapType
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__all__ = (
|
|
17
|
-
"IPFabricTransformMapGroupQuery",
|
|
18
|
-
"IPFabricTransformMapQuery",
|
|
19
|
-
"IPFabricSyncQuery",
|
|
20
|
-
"IPFabricTransformFieldQuery",
|
|
21
|
-
"IPFabricRelationshipFieldQuery",
|
|
22
|
-
"IPFabricSourceQuery",
|
|
23
|
-
"IPFabricSnapshotQuery",
|
|
24
|
-
"IPFabricIngestionQuery",
|
|
25
|
-
"IPFabricIngestionIssueQuery",
|
|
26
|
-
"IPFabricDataQuery",
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@strawberry.type(name="Query")
|
|
31
|
-
class IPFabricTransformMapGroupQuery:
|
|
32
|
-
ipfabric_transform_map_group: IPFabricTransformMapGroupType = (
|
|
33
|
-
strawberry_django.field()
|
|
34
|
-
)
|
|
35
|
-
ipfabric_transform_map_group_list: list[
|
|
36
|
-
IPFabricTransformMapGroupType
|
|
37
|
-
] = strawberry_django.field()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@strawberry.type(name="Query")
|
|
41
|
-
class IPFabricTransformMapQuery:
|
|
42
|
-
ipfabric_transform_map: IPFabricTransformMapType = strawberry_django.field()
|
|
43
|
-
ipfabric_transform_map_list: list[
|
|
44
|
-
IPFabricTransformMapType
|
|
45
|
-
] = strawberry_django.field()
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
@strawberry.type(name="Query")
|
|
49
|
-
class IPFabricTransformFieldQuery:
|
|
50
|
-
ipfabric_transform_field: IPFabricTransformFieldType = strawberry_django.field()
|
|
51
|
-
ipfabric_transform_field_list: list[
|
|
52
|
-
IPFabricTransformFieldType
|
|
53
|
-
] = strawberry_django.field()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@strawberry.type(name="Query")
|
|
57
|
-
class IPFabricRelationshipFieldQuery:
|
|
58
|
-
ipfabric_relationship_field: IPFabricRelationshipFieldType = (
|
|
59
|
-
strawberry_django.field()
|
|
60
|
-
)
|
|
61
|
-
ipfabric_relationship_field_list: list[
|
|
62
|
-
IPFabricRelationshipFieldType
|
|
63
|
-
] = strawberry_django.field()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
@strawberry.type(name="Query")
|
|
67
|
-
class IPFabricSourceQuery:
|
|
68
|
-
ipfabric_source: IPFabricSourceType = strawberry_django.field()
|
|
69
|
-
ipfabric_source_list: list[IPFabricSourceType] = strawberry_django.field()
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
@strawberry.type(name="Query")
|
|
73
|
-
class IPFabricSnapshotQuery:
|
|
74
|
-
ipfabric_snapshot: IPFabricSnapshotType = strawberry_django.field()
|
|
75
|
-
ipfabric_snapshot_list: list[IPFabricSnapshotType] = strawberry_django.field()
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
@strawberry.type(name="Query")
|
|
79
|
-
class IPFabricSyncQuery:
|
|
80
|
-
ipfabric_sync: IPFabricSyncType = strawberry_django.field()
|
|
81
|
-
ipfabric_sync_list: list[IPFabricSyncType] = strawberry_django.field()
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
@strawberry.type(name="Query")
|
|
85
|
-
class IPFabricIngestionQuery:
|
|
86
|
-
ipfabric_ingestion: IPFabricIngestionType = strawberry_django.field()
|
|
87
|
-
ipfabric_ingestion_list: list[IPFabricIngestionType] = strawberry_django.field()
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
@strawberry.type(name="Query")
|
|
91
|
-
class IPFabricIngestionIssueQuery:
|
|
92
|
-
ipfabric_ingestion_issue: IPFabricIngestionIssueType = strawberry_django.field()
|
|
93
|
-
ipfabric_ingestion_issue_list: list[
|
|
94
|
-
IPFabricIngestionIssueType
|
|
95
|
-
] = strawberry_django.field()
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
@strawberry.type(name="Query")
|
|
99
|
-
class IPFabricDataQuery:
|
|
100
|
-
ipfabric_data: IPFabricDataType = strawberry_django.field()
|
|
101
|
-
ipfabric_data_list: list[IPFabricDataType] = strawberry_django.field()
|
ipfabric_netbox/graphql/types.py
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
from typing import Annotated
|
|
2
|
-
|
|
3
|
-
import strawberry
|
|
4
|
-
import strawberry_django
|
|
5
|
-
from core.graphql.mixins import ChangelogMixin
|
|
6
|
-
from core.models import Job
|
|
7
|
-
from extras.graphql.mixins import TagsMixin
|
|
8
|
-
from netbox.graphql.types import BaseObjectType
|
|
9
|
-
from netbox.graphql.types import ContentTypeType
|
|
10
|
-
from netbox.graphql.types import NetBoxObjectType
|
|
11
|
-
from netbox.graphql.types import OrganizationalObjectType
|
|
12
|
-
from netbox_branching.models import Branch
|
|
13
|
-
from strawberry.scalars import JSON
|
|
14
|
-
from users.graphql.types import UserType
|
|
15
|
-
|
|
16
|
-
from .filters import BranchFilter
|
|
17
|
-
from .filters import IPFabricDataFilter
|
|
18
|
-
from .filters import IPFabricIngestionFilter
|
|
19
|
-
from .filters import IPFabricIngestionIssueFilter
|
|
20
|
-
from .filters import IPFabricRelationshipFieldFilter
|
|
21
|
-
from .filters import IPFabricSnapshotFilter
|
|
22
|
-
from .filters import IPFabricSourceFilter
|
|
23
|
-
from .filters import IPFabricSyncFilter
|
|
24
|
-
from .filters import IPFabricTransformFieldFilter
|
|
25
|
-
from .filters import IPFabricTransformMapFilter
|
|
26
|
-
from .filters import IPFabricTransformMapGroupFilter
|
|
27
|
-
from .filters import JobFilter
|
|
28
|
-
from ipfabric_netbox import models
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
__all__ = (
|
|
32
|
-
"IPFabricTransformMapGroupType",
|
|
33
|
-
"IPFabricTransformMapType",
|
|
34
|
-
"IPFabricTransformFieldType",
|
|
35
|
-
"IPFabricRelationshipFieldType",
|
|
36
|
-
"IPFabricSourceType",
|
|
37
|
-
"IPFabricSnapshotType",
|
|
38
|
-
"IPFabricSyncType",
|
|
39
|
-
"IPFabricIngestionType",
|
|
40
|
-
"IPFabricIngestionIssueType",
|
|
41
|
-
"IPFabricDataType",
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@strawberry_django.type(
|
|
46
|
-
models.IPFabricTransformMapGroup,
|
|
47
|
-
fields="__all__",
|
|
48
|
-
filters=IPFabricTransformMapGroupFilter,
|
|
49
|
-
)
|
|
50
|
-
class IPFabricTransformMapGroupType(NetBoxObjectType):
|
|
51
|
-
name: str
|
|
52
|
-
description: str | None
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@strawberry_django.type(
|
|
56
|
-
models.IPFabricTransformMap, fields="__all__", filters=IPFabricTransformMapFilter
|
|
57
|
-
)
|
|
58
|
-
class IPFabricTransformMapType(NetBoxObjectType):
|
|
59
|
-
name: str
|
|
60
|
-
source_model: str
|
|
61
|
-
target_model: (
|
|
62
|
-
Annotated[
|
|
63
|
-
"ContentTypeType",
|
|
64
|
-
strawberry.lazy("netbox.graphql.types"),
|
|
65
|
-
]
|
|
66
|
-
| None
|
|
67
|
-
)
|
|
68
|
-
group: (
|
|
69
|
-
Annotated[
|
|
70
|
-
"IPFabricTransformMapGroupType",
|
|
71
|
-
strawberry.lazy("ipfabric_netbox.graphql.types"),
|
|
72
|
-
]
|
|
73
|
-
| None
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
@strawberry_django.type(
|
|
78
|
-
models.IPFabricTransformField,
|
|
79
|
-
fields="__all__",
|
|
80
|
-
filters=IPFabricTransformFieldFilter,
|
|
81
|
-
)
|
|
82
|
-
class IPFabricTransformFieldType(BaseObjectType):
|
|
83
|
-
transform_map: (
|
|
84
|
-
Annotated[
|
|
85
|
-
"IPFabricTransformMapType", strawberry.lazy("ipfabric_netbox.graphql.types")
|
|
86
|
-
]
|
|
87
|
-
| None
|
|
88
|
-
)
|
|
89
|
-
source_field: str
|
|
90
|
-
target_field: str
|
|
91
|
-
coalesce: bool
|
|
92
|
-
template: str
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
@strawberry_django.type(
|
|
96
|
-
models.IPFabricRelationshipField,
|
|
97
|
-
fields="__all__",
|
|
98
|
-
filters=IPFabricRelationshipFieldFilter,
|
|
99
|
-
)
|
|
100
|
-
class IPFabricRelationshipFieldType(BaseObjectType):
|
|
101
|
-
transform_map: (
|
|
102
|
-
Annotated[
|
|
103
|
-
"IPFabricTransformMapType", strawberry.lazy("ipfabric_netbox.graphql.types")
|
|
104
|
-
]
|
|
105
|
-
| None
|
|
106
|
-
)
|
|
107
|
-
source_model: Annotated["ContentTypeType", strawberry.lazy("netbox.graphql.types")]
|
|
108
|
-
target_field: str
|
|
109
|
-
coalesce: bool
|
|
110
|
-
template: str
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
@strawberry_django.type(
|
|
114
|
-
models.IPFabricSource, fields="__all__", filters=IPFabricSourceFilter
|
|
115
|
-
)
|
|
116
|
-
class IPFabricSourceType(OrganizationalObjectType):
|
|
117
|
-
name: str
|
|
118
|
-
type: str
|
|
119
|
-
url: str
|
|
120
|
-
status: str
|
|
121
|
-
parameters: JSON
|
|
122
|
-
last_synced: str
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
@strawberry_django.type(
|
|
126
|
-
models.IPFabricSnapshot, fields="__all__", filters=IPFabricSnapshotFilter
|
|
127
|
-
)
|
|
128
|
-
class IPFabricSnapshotType(ChangelogMixin, TagsMixin, BaseObjectType):
|
|
129
|
-
source: (
|
|
130
|
-
Annotated[
|
|
131
|
-
"IPFabricSourceType", strawberry.lazy("ipfabric_netbox.graphql.types")
|
|
132
|
-
]
|
|
133
|
-
| None
|
|
134
|
-
)
|
|
135
|
-
name: str
|
|
136
|
-
snapshot_id: str
|
|
137
|
-
data: JSON
|
|
138
|
-
status: str
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
@strawberry_django.type(
|
|
142
|
-
models.IPFabricSync, fields="__all__", filters=IPFabricSyncFilter
|
|
143
|
-
)
|
|
144
|
-
class IPFabricSyncType(ChangelogMixin, TagsMixin, BaseObjectType):
|
|
145
|
-
name: str
|
|
146
|
-
snapshot_data: (
|
|
147
|
-
Annotated[
|
|
148
|
-
"IPFabricSnapshotType", strawberry.lazy("ipfabric_netbox.graphql.types")
|
|
149
|
-
]
|
|
150
|
-
| None
|
|
151
|
-
)
|
|
152
|
-
status: str
|
|
153
|
-
parameters: JSON
|
|
154
|
-
auto_merge: bool
|
|
155
|
-
last_synced: str | None
|
|
156
|
-
scheduled: str | None
|
|
157
|
-
interval: int | None
|
|
158
|
-
user: Annotated["UserType", strawberry.lazy("users.graphql.types")] | None
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
@strawberry_django.type(Branch, fields="__all__", filters=BranchFilter)
|
|
162
|
-
class BranchType(OrganizationalObjectType):
|
|
163
|
-
name: str
|
|
164
|
-
description: str | None
|
|
165
|
-
owner: Annotated["UserType", strawberry.lazy("users.graphql.types")]
|
|
166
|
-
merged_by: Annotated["UserType", strawberry.lazy("users.graphql.types")]
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
@strawberry_django.type(Job, fields="__all__", filters=JobFilter)
|
|
170
|
-
class JobType(BaseObjectType):
|
|
171
|
-
name: str
|
|
172
|
-
user: Annotated["UserType", strawberry.lazy("users.graphql.types")]
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
@strawberry_django.type(
|
|
176
|
-
models.IPFabricIngestion, fields="__all__", filters=IPFabricIngestionFilter
|
|
177
|
-
)
|
|
178
|
-
class IPFabricIngestionType(BaseObjectType):
|
|
179
|
-
sync: (
|
|
180
|
-
Annotated["IPFabricSyncType", strawberry.lazy("ipfabric_netbox.graphql.types")]
|
|
181
|
-
| None
|
|
182
|
-
)
|
|
183
|
-
job: Annotated["JobType", strawberry.lazy("ipfabric_netbox.graphql.types")] | None
|
|
184
|
-
branch: (
|
|
185
|
-
Annotated["BranchType", strawberry.lazy("ipfabric_netbox.graphql.types")] | None
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
@strawberry_django.type(
|
|
190
|
-
models.IPFabricIngestionIssue,
|
|
191
|
-
fields="__all__",
|
|
192
|
-
filters=IPFabricIngestionIssueFilter,
|
|
193
|
-
)
|
|
194
|
-
class IPFabricIngestionIssueType(BaseObjectType):
|
|
195
|
-
ingestion: (
|
|
196
|
-
Annotated[
|
|
197
|
-
"IPFabricIngestionType", strawberry.lazy("ipfabric_netbox.graphql.types")
|
|
198
|
-
]
|
|
199
|
-
| None
|
|
200
|
-
)
|
|
201
|
-
timestamp: str
|
|
202
|
-
model: str | None
|
|
203
|
-
message: str
|
|
204
|
-
raw_data: str
|
|
205
|
-
coalesce_fields: str
|
|
206
|
-
defaults: str
|
|
207
|
-
exception: str
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
@strawberry_django.type(
|
|
211
|
-
models.IPFabricData, fields="__all__", filters=IPFabricDataFilter
|
|
212
|
-
)
|
|
213
|
-
class IPFabricDataType(BaseObjectType):
|
|
214
|
-
snapshot_data: Annotated[
|
|
215
|
-
"IPFabricSnapshotType", strawberry.lazy("ipfabric_netbox.graphql.types")
|
|
216
|
-
]
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.2.5 on 2025-08-21 11:21
|
|
2
|
-
import taggit.managers
|
|
3
|
-
from django.db import migrations
|
|
4
|
-
from django.db import models
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Migration(migrations.Migration):
|
|
8
|
-
dependencies = [
|
|
9
|
-
("extras", "0128_tableconfig"),
|
|
10
|
-
("ipfabric_netbox", "0015_ipfabricingestionissue"),
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
operations = [
|
|
14
|
-
migrations.AddField(
|
|
15
|
-
model_name="ipfabricsnapshot",
|
|
16
|
-
name="tags",
|
|
17
|
-
field=taggit.managers.TaggableManager(
|
|
18
|
-
through="extras.TaggedItem", to="extras.Tag"
|
|
19
|
-
),
|
|
20
|
-
),
|
|
21
|
-
migrations.AlterField(
|
|
22
|
-
model_name="ipfabricsnapshot",
|
|
23
|
-
name="created",
|
|
24
|
-
field=models.DateTimeField(auto_now_add=True, null=True),
|
|
25
|
-
),
|
|
26
|
-
migrations.AlterField(
|
|
27
|
-
model_name="ipfabricsnapshot",
|
|
28
|
-
name="last_updated",
|
|
29
|
-
field=models.DateTimeField(auto_now=True, null=True),
|
|
30
|
-
),
|
|
31
|
-
]
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.2.5 on 2025-08-22 12:32
|
|
2
|
-
from django.db import migrations
|
|
3
|
-
from django.db import models
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Migration(migrations.Migration):
|
|
7
|
-
dependencies = [
|
|
8
|
-
("ipfabric_netbox", "0016_tags_and_changelog_for_snapshots"),
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
operations = [
|
|
12
|
-
migrations.AddField(
|
|
13
|
-
model_name="ipfabricsync",
|
|
14
|
-
name="update_custom_fields",
|
|
15
|
-
field=models.BooleanField(default=True),
|
|
16
|
-
),
|
|
17
|
-
]
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.2 on 2025-08-25 12:53
|
|
2
|
-
from django.db import migrations
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Migration(migrations.Migration):
|
|
6
|
-
dependencies = [
|
|
7
|
-
(
|
|
8
|
-
"ipfabric_netbox",
|
|
9
|
-
"0017_ipfabricsync_update_custom_fields",
|
|
10
|
-
),
|
|
11
|
-
]
|
|
12
|
-
operations = [
|
|
13
|
-
migrations.RemoveField(
|
|
14
|
-
model_name="ipfabricsync",
|
|
15
|
-
name="type",
|
|
16
|
-
),
|
|
17
|
-
]
|
|
File without changes
|