infrahub-server 1.2.6__py3-none-any.whl → 1.2.8__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.
- infrahub/api/transformation.py +1 -0
- infrahub/artifacts/models.py +4 -0
- infrahub/cli/db.py +3 -1
- infrahub/cli/patch.py +153 -0
- infrahub/computed_attribute/models.py +81 -1
- infrahub/computed_attribute/tasks.py +35 -53
- infrahub/config.py +2 -1
- infrahub/constants/__init__.py +0 -0
- infrahub/core/constants/__init__.py +1 -0
- infrahub/core/graph/index.py +3 -1
- infrahub/core/manager.py +16 -5
- infrahub/core/migrations/graph/m014_remove_index_attr_value.py +7 -8
- infrahub/core/node/__init__.py +4 -1
- infrahub/core/protocols.py +1 -0
- infrahub/core/query/ipam.py +7 -5
- infrahub/core/query/node.py +96 -29
- infrahub/core/schema/definitions/core/builtin.py +2 -4
- infrahub/core/schema/definitions/core/transform.py +1 -0
- infrahub/core/validators/aggregated_checker.py +2 -2
- infrahub/core/validators/uniqueness/query.py +8 -3
- infrahub/database/__init__.py +2 -10
- infrahub/database/index.py +1 -1
- infrahub/database/memgraph.py +2 -1
- infrahub/database/neo4j.py +1 -1
- infrahub/git/integrator.py +27 -3
- infrahub/git/models.py +4 -0
- infrahub/git/tasks.py +3 -0
- infrahub/git_credential/helper.py +2 -2
- infrahub/message_bus/operations/requests/proposed_change.py +6 -0
- infrahub/message_bus/types.py +3 -0
- infrahub/patch/__init__.py +0 -0
- infrahub/patch/constants.py +13 -0
- infrahub/patch/edge_adder.py +64 -0
- infrahub/patch/edge_deleter.py +33 -0
- infrahub/patch/edge_updater.py +28 -0
- infrahub/patch/models.py +98 -0
- infrahub/patch/plan_reader.py +107 -0
- infrahub/patch/plan_writer.py +92 -0
- infrahub/patch/queries/__init__.py +0 -0
- infrahub/patch/queries/base.py +17 -0
- infrahub/patch/queries/consolidate_duplicated_nodes.py +109 -0
- infrahub/patch/queries/delete_duplicated_edges.py +138 -0
- infrahub/patch/runner.py +254 -0
- infrahub/patch/vertex_adder.py +61 -0
- infrahub/patch/vertex_deleter.py +33 -0
- infrahub/patch/vertex_updater.py +28 -0
- infrahub/proposed_change/tasks.py +1 -0
- infrahub/server.py +3 -1
- infrahub/transformations/models.py +3 -0
- infrahub/transformations/tasks.py +1 -0
- infrahub/webhook/models.py +3 -0
- infrahub_sdk/checks.py +1 -1
- infrahub_sdk/client.py +4 -4
- infrahub_sdk/config.py +17 -0
- infrahub_sdk/ctl/cli_commands.py +9 -3
- infrahub_sdk/ctl/generator.py +2 -2
- infrahub_sdk/ctl/menu.py +56 -13
- infrahub_sdk/ctl/object.py +55 -5
- infrahub_sdk/ctl/utils.py +22 -1
- infrahub_sdk/exceptions.py +19 -1
- infrahub_sdk/generator.py +12 -66
- infrahub_sdk/node.py +42 -26
- infrahub_sdk/operation.py +80 -0
- infrahub_sdk/protocols.py +12 -0
- infrahub_sdk/protocols_generator/__init__.py +0 -0
- infrahub_sdk/protocols_generator/constants.py +28 -0
- infrahub_sdk/{code_generator.py → protocols_generator/generator.py} +47 -34
- infrahub_sdk/protocols_generator/template.j2 +114 -0
- infrahub_sdk/recorder.py +3 -0
- infrahub_sdk/schema/__init__.py +110 -74
- infrahub_sdk/schema/main.py +36 -2
- infrahub_sdk/schema/repository.py +6 -0
- infrahub_sdk/spec/menu.py +3 -3
- infrahub_sdk/spec/object.py +522 -41
- infrahub_sdk/testing/docker.py +4 -5
- infrahub_sdk/testing/schemas/animal.py +7 -0
- infrahub_sdk/transforms.py +15 -27
- infrahub_sdk/yaml.py +63 -7
- {infrahub_server-1.2.6.dist-info → infrahub_server-1.2.8.dist-info}/METADATA +2 -2
- {infrahub_server-1.2.6.dist-info → infrahub_server-1.2.8.dist-info}/RECORD +85 -64
- infrahub_testcontainers/docker-compose.test.yml +2 -0
- infrahub_sdk/ctl/constants.py +0 -115
- /infrahub/{database/constants.py → constants/database.py} +0 -0
- {infrahub_server-1.2.6.dist-info → infrahub_server-1.2.8.dist-info}/LICENSE.txt +0 -0
- {infrahub_server-1.2.6.dist-info → infrahub_server-1.2.8.dist-info}/WHEEL +0 -0
- {infrahub_server-1.2.6.dist-info → infrahub_server-1.2.8.dist-info}/entry_points.txt +0 -0
infrahub_sdk/ctl/constants.py
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
PROTOCOLS_TEMPLATE = """#
|
|
2
|
-
# Generated by "infrahubctl protocols"
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
|
-
from typing import TYPE_CHECKING, Optional
|
|
8
|
-
|
|
9
|
-
from infrahub_sdk.protocols import CoreNode, {{ base_protocols | join(', ') }}
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
{% if sync %}
|
|
13
|
-
from infrahub_sdk.node import RelatedNodeSync, RelationshipManagerSync
|
|
14
|
-
{% else %}
|
|
15
|
-
from infrahub_sdk.node import RelatedNode, RelationshipManager
|
|
16
|
-
{% endif %}
|
|
17
|
-
from infrahub_sdk.protocols_base import (
|
|
18
|
-
AnyAttribute,
|
|
19
|
-
AnyAttributeOptional,
|
|
20
|
-
String,
|
|
21
|
-
StringOptional,
|
|
22
|
-
Integer,
|
|
23
|
-
IntegerOptional,
|
|
24
|
-
Boolean,
|
|
25
|
-
BooleanOptional,
|
|
26
|
-
DateTime,
|
|
27
|
-
DateTimeOptional,
|
|
28
|
-
Dropdown,
|
|
29
|
-
DropdownOptional,
|
|
30
|
-
HashedPassword,
|
|
31
|
-
HashedPasswordOptional,
|
|
32
|
-
MacAddress,
|
|
33
|
-
MacAddressOptional,
|
|
34
|
-
IPHost,
|
|
35
|
-
IPHostOptional,
|
|
36
|
-
IPNetwork,
|
|
37
|
-
IPNetworkOptional,
|
|
38
|
-
JSONAttribute,
|
|
39
|
-
JSONAttributeOptional,
|
|
40
|
-
ListAttribute,
|
|
41
|
-
ListAttributeOptional,
|
|
42
|
-
URL,
|
|
43
|
-
URLOptional,
|
|
44
|
-
)
|
|
45
|
-
{% for generic in generics %}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class {{ generic.namespace + generic.name }}(CoreNode):
|
|
49
|
-
{% if not generic.attributes|default([]) and not generic.relationships|default([]) %}
|
|
50
|
-
pass
|
|
51
|
-
{% endif %}
|
|
52
|
-
{% for attribute in generic.attributes|default([]) %}
|
|
53
|
-
{{ attribute | render_attribute }}
|
|
54
|
-
{% endfor %}
|
|
55
|
-
{% for relationship in generic.relationships|default([]) %}
|
|
56
|
-
{{ relationship | render_relationship(sync) }}
|
|
57
|
-
{% endfor %}
|
|
58
|
-
{% if generic.hierarchical | default(false) %}
|
|
59
|
-
{% if sync %}
|
|
60
|
-
parent: RelatedNodeSync
|
|
61
|
-
children: RelationshipManagerSync
|
|
62
|
-
{% else %}
|
|
63
|
-
parent: RelatedNode
|
|
64
|
-
children: RelationshipManager
|
|
65
|
-
{% endif %}
|
|
66
|
-
{% endif %}
|
|
67
|
-
{% endfor %}
|
|
68
|
-
{% for node in nodes %}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or "CoreNode" }}):
|
|
72
|
-
{% if not node.attributes|default([]) and not node.relationships|default([]) %}
|
|
73
|
-
pass
|
|
74
|
-
{% endif %}
|
|
75
|
-
{% for attribute in node.attributes|default([]) %}
|
|
76
|
-
{{ attribute | render_attribute }}
|
|
77
|
-
{% endfor %}
|
|
78
|
-
{% for relationship in node.relationships|default([]) %}
|
|
79
|
-
{{ relationship | render_relationship(sync) }}
|
|
80
|
-
{% endfor %}
|
|
81
|
-
{% if node.hierarchical | default(false) %}
|
|
82
|
-
{% if sync %}
|
|
83
|
-
parent: RelatedNodeSync
|
|
84
|
-
children: RelationshipManagerSync
|
|
85
|
-
{% else %}
|
|
86
|
-
parent: RelatedNode
|
|
87
|
-
children: RelationshipManager
|
|
88
|
-
{% endif %}
|
|
89
|
-
{% endif %}
|
|
90
|
-
{% endfor %}
|
|
91
|
-
{% for node in profiles %}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or "CoreNode" }}):
|
|
95
|
-
{% if not node.attributes|default([]) and not node.relationships|default([]) %}
|
|
96
|
-
pass
|
|
97
|
-
{% endif %}
|
|
98
|
-
{% for attribute in node.attributes|default([]) %}
|
|
99
|
-
{{ attribute | render_attribute }}
|
|
100
|
-
{% endfor %}
|
|
101
|
-
{% for relationship in node.relationships|default([]) %}
|
|
102
|
-
{{ relationship | render_relationship(sync) }}
|
|
103
|
-
{% endfor %}
|
|
104
|
-
{% if node.hierarchical | default(false) %}
|
|
105
|
-
{% if sync %}
|
|
106
|
-
parent: RelatedNodeSync
|
|
107
|
-
children: RelationshipManagerSync
|
|
108
|
-
{% else %}
|
|
109
|
-
parent: RelatedNode
|
|
110
|
-
children: RelationshipManager
|
|
111
|
-
{% endif %}
|
|
112
|
-
{% endif %}
|
|
113
|
-
{% endfor %}
|
|
114
|
-
|
|
115
|
-
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|