infrahub-server 1.4.9__py3-none-any.whl → 1.4.10__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.
@@ -44,7 +44,7 @@ CALL (source_artifact) {
44
44
  MATCH (source_artifact)-[r:IS_PART_OF]->(:Root)
45
45
  WHERE %(source_branch_filter)s
46
46
  RETURN r AS root_rel
47
- ORDER BY r.branch_level DESC, r.from DESC
47
+ ORDER BY r.branch_level DESC, r.from DESC, r.status ASC
48
48
  LIMIT 1
49
49
  }
50
50
  WITH source_artifact, root_rel
@@ -61,7 +61,7 @@ CALL (source_artifact) {
61
61
  target_node,
62
62
  (rrel1.status = "active" AND rrel2.status = "active") AS target_is_active,
63
63
  $source_branch_name IN [rrel1.branch, rrel2.branch] AS target_on_source_branch
64
- ORDER BY rrel1.branch_level DESC, rrel1.branch_level DESC, rrel1.from DESC, rrel2.from DESC
64
+ ORDER BY rrel1.branch_level DESC, rrel2.branch_level DESC, rrel1.from DESC, rrel2.from DESC, rrel1.status ASC, rrel2.status ASC
65
65
  LIMIT 1
66
66
  }
67
67
  // -----------------------
@@ -75,7 +75,7 @@ CALL (source_artifact) {
75
75
  definition_node,
76
76
  (rrel1.status = "active" AND rrel2.status = "active") AS definition_is_active,
77
77
  $source_branch_name IN [rrel1.branch, rrel2.branch] AS definition_on_source_branch
78
- ORDER BY rrel1.branch_level DESC, rrel1.branch_level DESC, rrel1.from DESC, rrel2.from DESC
78
+ ORDER BY rrel1.branch_level DESC, rrel2.branch_level DESC, rrel1.from DESC, rrel2.from DESC, rrel1.status ASC, rrel2.status ASC
79
79
  LIMIT 1
80
80
  }
81
81
  // -----------------------
@@ -89,7 +89,8 @@ CALL (source_artifact) {
89
89
  attr_val.value AS checksum,
90
90
  (attr_rel.status = "active" AND value_rel.status = "active") AS checksum_is_active,
91
91
  $source_branch_name IN [attr_rel.branch, value_rel.branch] AS checksum_on_source_branch
92
- ORDER BY value_rel.branch_level DESC, attr_rel.branch_level DESC, value_rel.from DESC, attr_rel.from DESC
92
+ ORDER BY value_rel.branch_level DESC, attr_rel.branch_level DESC, value_rel.from DESC, attr_rel.from DESC,
93
+ value_rel.status ASC, attr_rel.status ASC
93
94
  LIMIT 1
94
95
  }
95
96
  // -----------------------
@@ -103,7 +104,8 @@ CALL (source_artifact) {
103
104
  attr_val.value AS storage_id,
104
105
  (attr_rel.status = "active" AND value_rel.status = "active") AS storage_id_is_active,
105
106
  $source_branch_name IN [attr_rel.branch, value_rel.branch] AS storage_id_on_source_branch
106
- ORDER BY value_rel.branch_level DESC, attr_rel.branch_level DESC, value_rel.from DESC, attr_rel.from DESC
107
+ ORDER BY value_rel.branch_level DESC, attr_rel.branch_level DESC, value_rel.from DESC, attr_rel.from DESC,
108
+ value_rel.status ASC, attr_rel.status ASC
107
109
  LIMIT 1
108
110
  }
109
111
  WITH target_node, target_is_active, target_on_source_branch,
@@ -147,7 +149,8 @@ CALL (target_node, definition_node){
147
149
  RETURN
148
150
  target_artifact,
149
151
  (trel1.status = "active" AND trel2.status = "active" AND drel1.status = "active" AND drel1.status = "active") AS artifact_is_active
150
- ORDER BY trel1.from DESC, trel2.from DESC, drel1.from DESC, drel2.from DESC
152
+ ORDER BY trel1.from DESC, trel2.from DESC, drel1.from DESC, drel2.from DESC,
153
+ trel1.status ASC, trel2.status ASC, drel1.status ASC, drel2.status ASC
151
154
  LIMIT 1
152
155
  }
153
156
  WITH CASE
@@ -163,7 +166,7 @@ CALL (target_node, definition_node){
163
166
  AND attr_rel.branch = $target_branch_name
164
167
  AND value_rel.branch = $target_branch_name
165
168
  RETURN attr_val.value AS checksum, (attr_rel.status = "active" AND value_rel.status = "active") AS checksum_is_active
166
- ORDER BY value_rel.from DESC, attr_rel.from DESC
169
+ ORDER BY value_rel.from DESC, attr_rel.from DESC, value_rel.status ASC, attr_rel.status ASC
167
170
  LIMIT 1
168
171
  }
169
172
  // -----------------------
@@ -175,7 +178,7 @@ CALL (target_node, definition_node){
175
178
  AND attr_rel.branch = $target_branch_name
176
179
  AND value_rel.branch = $target_branch_name
177
180
  RETURN attr_val.value AS storage_id, (attr_rel.status = "active" AND value_rel.status = "active") AS storage_id_is_active
178
- ORDER BY value_rel.from DESC, attr_rel.from DESC
181
+ ORDER BY value_rel.from DESC, attr_rel.from DESC, value_rel.status ASC, attr_rel.status ASC
179
182
  LIMIT 1
180
183
  }
181
184
  RETURN target_artifact,
@@ -408,7 +408,9 @@ class Node(BaseNode, metaclass=BaseNodeMeta):
408
408
  for attribute_name in template._attributes:
409
409
  if attribute_name in list(fields) + [OBJECT_TEMPLATE_NAME_ATTR]:
410
410
  continue
411
- fields[attribute_name] = {"value": getattr(template, attribute_name).value, "source": template.id}
411
+ attr_value = getattr(template, attribute_name).value
412
+ if attr_value is not None:
413
+ fields[attribute_name] = {"value": attr_value, "source": template.id}
412
414
 
413
415
  for relationship_name in template._relationships:
414
416
  relationship_schema = template._schema.get_relationship(name=relationship_name)
@@ -41,10 +41,19 @@ async def extract_peer_data(
41
41
  ) -> Mapping[str, Any]:
42
42
  obj_peer_data: dict[str, Any] = {}
43
43
 
44
- for attr in template_peer.get_schema().attribute_names:
45
- if attr not in obj_peer_schema.attribute_names:
44
+ for attr_name in template_peer.get_schema().attribute_names:
45
+ template_attr = getattr(template_peer, attr_name)
46
+ if template_attr.value is None:
46
47
  continue
47
- obj_peer_data[attr] = {"value": getattr(template_peer, attr).value, "source": template_peer.id}
48
+ if template_attr.is_default:
49
+ # if template attr is_default and the value matches the object schema, then do not set the source
50
+ try:
51
+ if obj_peer_schema.get_attribute(name=attr_name).default_value == template_attr.value:
52
+ continue
53
+ except ValueError:
54
+ pass
55
+
56
+ obj_peer_data[attr_name] = {"value": template_attr.value, "source": template_peer.id}
48
57
 
49
58
  for rel in template_peer.get_schema().relationship_names:
50
59
  rel_manager: RelationshipManager = getattr(template_peer, rel)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: infrahub-server
3
- Version: 1.4.9
3
+ Version: 1.4.10
4
4
  Summary: Infrahub is taking a new approach to Infrastructure Management by providing a new generation of datastore to organize and control all the data that defines how an infrastructure should run.
5
5
  License: Apache-2.0
6
6
  Author: OpsMill
@@ -66,42 +66,41 @@ Description-Content-Type: text/markdown
66
66
  <h1 align="center">
67
67
  <a href=""><img src="docs/static/img/infrahub-hori.svg" alt="Infrahub" width="350"></a>
68
68
  </h1>
69
- <h3 align="center">Simplify Infrastructure Automation</h2>
70
69
 
71
70
  <p align="center">
72
71
  <a href="https://www.linkedin.com/company/opsmill">
73
- <img src="https://img.shields.io/badge/linkedin-blue?logo=linkedin"/>
72
+ <img src="https://img.shields.io/badge/linkedin-blue?logo=LinkedIn"/>
74
73
  </a>
75
74
  <a href="https://discord.gg/opsmill">
76
75
  <img src="https://img.shields.io/badge/Discord-7289DA?&logo=discord&logoColor=white"/>
77
76
  </a>
78
77
  </p>
79
78
 
80
- Infrahub from [OpsMill](https://opsmill.com) is taking a new approach to Infrastructure Management by providing a new generation of datastore to organize and control all the data that defines how an infrastructure should run. Infrahub offers a central hub to manage the data, templates and playbooks that powers your infrastructure by combining the version control and branch management capabilities similar to Git with the flexible data model and UI of a graph database.
79
+ Infrahub is a graph-based data management platform with built-in version control, CI workflows, peer review, and API access. It's purpose-built to power network, data center, and cloud automation.
81
80
 
82
- If you just want to try Infrahub out, you can use our [Infrahub Sandbox](https://sandbox.infrahub.app/) to get started.
81
+ ## The data foundation for modern automation
83
82
 
84
- ![infrahub screenshot](docs/docs/media/infrahub-readme.gif)
83
+ Infrahub provides a single platform that unifies infrastructure data with business logic, enforces consistency, and integrates with automation tools and AI workflows.
85
84
 
86
- ## Why Use Infrahub?
85
+ With Infrahub as the data foundation in your automation stack, you can move faster, reduce risk, and deliver infrastructure as a reliable service.
87
86
 
88
- **Unified Source of Truth** - Infrahub is a single source of truth for all your infrastructure and network data. It provides a unified view of your infrastructure, allowing you to manage your infrastructure in a more efficient and effective way. Infrahub allows unidirectional and bi-directional [data synchronization](https://docs.infrahub.app/sync/sync/) between other internal systems and Infrahub. The data can be accessed via WebUI, API and SDK, along with SSO and RBAC for access control.
87
+ ## Top ways to use Infrahub
89
88
 
90
- **Flexible Schema** - Infrahub provides a flexible schema for your infrastructure data and related business information, allowing you to define your own data model and customize it to your needs. Get started quickly with our [schema library](https://github.com/opsmill/schema-library) or build your own.
89
+ ### Unify infrastructure data
91
90
 
92
- **Version Control** - Infrahub provides a version control system for your infrastructure data, allowing you to track changes and revert to previous versions if needed. Immutable history of all changes to the data and artifacts is maintained, allowing you to audit and review changes to your infrastructure.
91
+ Sync network and infrastructure device, service, and policy data into a unified source of truth, with rich metadata and robust UI and API access.
93
92
 
94
- **CI Pipeline and Validation** - Infrahub provides a CI pipeline and validation system for your infrastructure data, allowing you to ensure that your infrastructure is always in a valid state. Infrahub was designed with infrastructure-as-code workflows in mind, removing fragility and complexity of combining together multiple tools and projects to achieve the same goal.
93
+ ### Automate at scale
95
94
 
96
- ## Infrahub Use Cases
95
+ Generate, validate, and deploy configurations with unified data. Support full lifecycle management—provisioning, upgrades, decommissioning—across vendors and sites.
97
96
 
98
- **Service Catalog** - Infrahub acts as the underlying system to provide infrastructure-as-a-service, allowing you to manage your services and lifecycle them as the services evolve.
97
+ ### Enable self-service
99
98
 
100
- **Infrastructure Automation** - Provide infrastructure and network automation workflows with Infrahub rendering configurations and artifacts via Jinja2 and python,then passing to deployment tools such as [Nornir](https://www.opsmill.com/simplifying-network-automation-workflows-with-infrahub-nornir-and-jinja2/), [Ansible](https://docs.infrahub.app/ansible), Terraform, or vendor-specific tools.
99
+ Expose automation through catalogs and APIs so application, platform, and ops teams can request infrastructure directly. Speed time to delivery, reduce errors, and make infrastructure more responsive to the business.
101
100
 
102
- **Inventory Management** - Infrahub serves as a centralized inventory system for your infrastructure, allowing you to manage your inventory and track changes to your infrastructure. It provides a WebUI and API for other teams to self-service the information needed to allow the organization to operate.
101
+ ### Build an AIOps knowledge graph
103
102
 
104
- **DCIM and IPAM** - Infrahub provides centralized DCIM and IPAM systems for your infrastructure, capable of handling complex cases such as overlapping IP addresses and VLANs, automation-friendly, branch-aware allocation of resources via Infrahub's [Resource Manager](https://docs.infrahub.app/python-sdk/guides/resource-manager), and more.
103
+ Model dependencies and relationships across infrastructure. Provide the data foundation for AI-driven reasoning, troubleshooting, and predictive operations.
105
104
 
106
105
  ## Quick Start
107
106
 
@@ -116,7 +116,7 @@ infrahub/core/diff/parent_node_adder.py,sha256=AFq2KJHGgUVem4WCg-9Qi9h6TTwt-JID1
116
116
  infrahub/core/diff/payload_builder.py,sha256=5R_QuPM5P_uQONmTDbtpIjhshs_OJCcXLnVYjWw-78Q,2094
117
117
  infrahub/core/diff/query/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
118
  infrahub/core/diff/query/all_conflicts.py,sha256=gWLwkCR2AK0IJccnhcE8vkSHu5ugZfKTDhCoFi4yAJo,3058
119
- infrahub/core/diff/query/artifact.py,sha256=wAlqqvcj1Vdw78tfPLvhvbiFrZLAXZ6vkkWn2VeilIs,8732
119
+ infrahub/core/diff/query/artifact.py,sha256=aYoLeFjFsSYkmHBhIlHMBnil2DkHawpxZ2aHokwn6eQ,9098
120
120
  infrahub/core/diff/query/delete_query.py,sha256=KMZ-HbSz2RKYqqMZ1Lj0mZBlWvkBYOyOvab2UCki1eo,1021
121
121
  infrahub/core/diff/query/diff_get.py,sha256=SzlJAF5DNKcbavgVOxLKJ-o8EsuImTGE2uNPg9hcMq0,7438
122
122
  infrahub/core/diff/query/diff_summary.py,sha256=sypXfK4EO_BZBuohlv419AjgL5ZeRwMiwnI7IIlh0KE,3841
@@ -217,13 +217,13 @@ infrahub/core/migrations/schema/placeholder_dummy.py,sha256=3T3dBwC_ZyehOJr2KRKF
217
217
  infrahub/core/migrations/schema/tasks.py,sha256=2J8gHGSP-WhxSi4GYhOc9xAJOg_S1ONm3YE4_ukLKxw,4164
218
218
  infrahub/core/migrations/shared.py,sha256=G72VIHtH4DOM09UOXZE2zfILGDej7nPKdvdfrPRMp7M,7921
219
219
  infrahub/core/models.py,sha256=xwEeXSTD4j13hbyZAjZAlrhXk1hHvWl9I7ve7uUbR7U,26649
220
- infrahub/core/node/__init__.py,sha256=6qtg-hzuH-hTxX4hJrhAB_lUmcIx404wyn35WhiMgZo,42435
220
+ infrahub/core/node/__init__.py,sha256=mFoAxo1SYHmQ3Vp5KaHdsF584mnz75aCJfxzOEGNkn0,42514
221
221
  infrahub/core/node/base.py,sha256=BAowVRCK_WC50yXym1kCyUppJDJnrODGU5uoj1s0Yd4,2564
222
222
  infrahub/core/node/constraints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  infrahub/core/node/constraints/attribute_uniqueness.py,sha256=9MThTmuqZ7RgK71ZZARlw1k1x3ARn1U67g2_Gatd6rE,2099
224
224
  infrahub/core/node/constraints/grouped_uniqueness.py,sha256=F5pmnXVuQNlVmdZY5FRxSGK4gGi1BK1IRgw4emCTlLw,9506
225
225
  infrahub/core/node/constraints/interface.py,sha256=fwB32pRLxteQyKRArqekQ0RXlrDkyzp7Vmq03vSpUEo,291
226
- infrahub/core/node/create.py,sha256=1mAFaMLqRmuONIwL549JQLFbOpEbP3rBQEb1D2VArcc,7752
226
+ infrahub/core/node/create.py,sha256=-Yy81om_gARdeCs1mNNag-WMijVX8S27uBIN08BdEqQ,8138
227
227
  infrahub/core/node/delete_validator.py,sha256=mj_HQXkTeP_A3po65-R5bCJnDM9CmFFmcUQIxwPlofc,10559
228
228
  infrahub/core/node/ipam.py,sha256=NWb3TUlVQOGAzq1VvDwISLh61HML0jnalsJ7QojqGwQ,2669
229
229
  infrahub/core/node/permissions.py,sha256=uQzQ62IHcSly6fzPre0nQzlrkCIKzH4HyQkODKB3ZWM,2207
@@ -828,8 +828,8 @@ infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe
828
828
  infrahub_testcontainers/performance_test.py,sha256=hvwiy6tc_lWniYqGkqfOXVGAmA_IV15VOZqbiD9ezno,6149
829
829
  infrahub_testcontainers/plugin.py,sha256=I3RuZQ0dARyKHuqCf0y1Yj731P2Mwf3BJUehRJKeWrs,5645
830
830
  infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
831
- infrahub_server-1.4.9.dist-info/LICENSE.txt,sha256=7GQO7kxVoQYnZtFrjZBKLRXbrGwwwimHPPOJtqXsozQ,11340
832
- infrahub_server-1.4.9.dist-info/METADATA,sha256=8IccC-o3SIdkcjcI9izHZN10hsoSgLlqhquqpG5y26g,8277
833
- infrahub_server-1.4.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
834
- infrahub_server-1.4.9.dist-info/entry_points.txt,sha256=UXIeFWDsrV-4IllNvUEd6KieYGzQfn9paga2YyABOQI,393
835
- infrahub_server-1.4.9.dist-info/RECORD,,
831
+ infrahub_server-1.4.10.dist-info/LICENSE.txt,sha256=7GQO7kxVoQYnZtFrjZBKLRXbrGwwwimHPPOJtqXsozQ,11340
832
+ infrahub_server-1.4.10.dist-info/METADATA,sha256=0kkkcbzuPM3vb9EnfBvIQGjm_t9Ow2qHs3pf0O_pCHk,6210
833
+ infrahub_server-1.4.10.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
834
+ infrahub_server-1.4.10.dist-info/entry_points.txt,sha256=UXIeFWDsrV-4IllNvUEd6KieYGzQfn9paga2YyABOQI,393
835
+ infrahub_server-1.4.10.dist-info/RECORD,,