infrahub-server 1.1.6__py3-none-any.whl → 1.2.0b1__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.
Files changed (407) hide show
  1. infrahub/api/artifact.py +16 -4
  2. infrahub/api/dependencies.py +8 -0
  3. infrahub/api/oauth2.py +0 -1
  4. infrahub/api/oidc.py +0 -1
  5. infrahub/api/query.py +18 -7
  6. infrahub/api/schema.py +32 -6
  7. infrahub/api/transformation.py +12 -5
  8. infrahub/{message_bus/messages/check_artifact_create.py → artifacts/models.py} +5 -3
  9. infrahub/{message_bus/operations/check/artifact.py → artifacts/tasks.py} +26 -25
  10. infrahub/cli/__init__.py +0 -2
  11. infrahub/cli/db.py +6 -7
  12. infrahub/cli/events.py +8 -3
  13. infrahub/cli/git_agent.py +9 -7
  14. infrahub/cli/tasks.py +4 -6
  15. infrahub/computed_attribute/models.py +1 -1
  16. infrahub/computed_attribute/tasks.py +64 -17
  17. infrahub/computed_attribute/triggers.py +90 -0
  18. infrahub/config.py +1 -1
  19. infrahub/context.py +39 -0
  20. infrahub/core/account.py +5 -8
  21. infrahub/core/attribute.py +54 -22
  22. infrahub/core/branch/models.py +4 -4
  23. infrahub/core/branch/tasks.py +137 -129
  24. infrahub/core/changelog/__init__.py +0 -0
  25. infrahub/core/changelog/diff.py +283 -0
  26. infrahub/core/changelog/models.py +499 -0
  27. infrahub/core/constants/__init__.py +43 -2
  28. infrahub/core/constants/infrahubkind.py +1 -0
  29. infrahub/core/constants/schema.py +2 -0
  30. infrahub/core/diff/combiner.py +12 -8
  31. infrahub/core/diff/coordinator.py +49 -70
  32. infrahub/core/diff/data_check_synchronizer.py +86 -7
  33. infrahub/core/diff/enricher/aggregated.py +3 -3
  34. infrahub/core/diff/enricher/cardinality_one.py +7 -7
  35. infrahub/core/diff/enricher/hierarchy.py +22 -7
  36. infrahub/core/diff/enricher/labels.py +19 -4
  37. infrahub/core/diff/enricher/path_identifier.py +7 -9
  38. infrahub/core/diff/enricher/summary_counts.py +3 -1
  39. infrahub/core/diff/merger/merger.py +8 -4
  40. infrahub/core/diff/model/path.py +76 -35
  41. infrahub/core/diff/parent_node_adder.py +78 -0
  42. infrahub/core/diff/payload_builder.py +13 -2
  43. infrahub/core/diff/query/all_conflicts.py +6 -3
  44. infrahub/core/diff/query/artifact.py +1 -1
  45. infrahub/core/diff/query/delete_query.py +1 -1
  46. infrahub/core/diff/query/diff_get.py +3 -2
  47. infrahub/core/diff/query/diff_summary.py +1 -1
  48. infrahub/core/diff/query/field_specifiers.py +3 -1
  49. infrahub/core/diff/query/field_summary.py +3 -2
  50. infrahub/core/diff/query/filters.py +14 -3
  51. infrahub/core/diff/query/get_conflict_query.py +1 -1
  52. infrahub/core/diff/query/has_conflicts_query.py +6 -3
  53. infrahub/core/diff/query/merge.py +3 -3
  54. infrahub/core/diff/query/{drop_tracking_id.py → merge_tracking_id.py} +4 -4
  55. infrahub/core/diff/query/roots_metadata.py +9 -2
  56. infrahub/core/diff/query/save.py +233 -142
  57. infrahub/core/diff/query/summary_counts_enricher.py +267 -0
  58. infrahub/core/diff/query/time_range_query.py +3 -2
  59. infrahub/core/diff/query/update_conflict_query.py +1 -1
  60. infrahub/core/diff/query_parser.py +49 -24
  61. infrahub/core/diff/repository/deserializer.py +32 -28
  62. infrahub/core/diff/repository/repository.py +215 -41
  63. infrahub/core/diff/tasks.py +13 -12
  64. infrahub/core/enums.py +1 -1
  65. infrahub/core/graph/__init__.py +1 -1
  66. infrahub/core/graph/index.py +3 -0
  67. infrahub/core/integrity/object_conflict/conflict_recorder.py +1 -1
  68. infrahub/core/ipam/reconciler.py +1 -1
  69. infrahub/core/ipam/tasks.py +2 -3
  70. infrahub/core/manager.py +20 -15
  71. infrahub/core/merge.py +5 -2
  72. infrahub/core/migrations/graph/__init__.py +4 -0
  73. infrahub/core/migrations/graph/m001_add_version_to_graph.py +1 -1
  74. infrahub/core/migrations/graph/m002_attribute_is_default.py +2 -2
  75. infrahub/core/migrations/graph/m003_relationship_parent_optional.py +2 -2
  76. infrahub/core/migrations/graph/m004_add_attr_documentation.py +1 -1
  77. infrahub/core/migrations/graph/m005_add_rel_read_only.py +1 -1
  78. infrahub/core/migrations/graph/m006_add_rel_on_delete.py +1 -1
  79. infrahub/core/migrations/graph/m007_add_rel_allow_override.py +1 -1
  80. infrahub/core/migrations/graph/m008_add_human_friendly_id.py +1 -1
  81. infrahub/core/migrations/graph/m009_add_generate_profile_attr.py +1 -1
  82. infrahub/core/migrations/graph/m010_add_generate_profile_attr_generic.py +1 -1
  83. infrahub/core/migrations/graph/m011_remove_profile_relationship_schema.py +2 -2
  84. infrahub/core/migrations/graph/m012_convert_account_generic.py +12 -23
  85. infrahub/core/migrations/graph/m013_convert_git_password_credential.py +7 -11
  86. infrahub/core/migrations/graph/m014_remove_index_attr_value.py +2 -2
  87. infrahub/core/migrations/graph/m015_diff_format_update.py +1 -1
  88. infrahub/core/migrations/graph/m016_diff_delete_bug_fix.py +1 -1
  89. infrahub/core/migrations/graph/m017_add_core_profile.py +1 -1
  90. infrahub/core/migrations/graph/m018_uniqueness_nulls.py +2 -2
  91. infrahub/core/migrations/graph/m019_restore_rels_to_time.py +256 -0
  92. infrahub/core/migrations/graph/m020_add_generate_template_attr.py +48 -0
  93. infrahub/core/migrations/query/attribute_add.py +1 -1
  94. infrahub/core/migrations/query/attribute_rename.py +1 -1
  95. infrahub/core/migrations/query/delete_element_in_schema.py +1 -1
  96. infrahub/core/migrations/query/node_duplicate.py +39 -19
  97. infrahub/core/migrations/query/relationship_duplicate.py +1 -1
  98. infrahub/core/migrations/query/schema_attribute_update.py +1 -1
  99. infrahub/core/migrations/schema/node_attribute_remove.py +1 -1
  100. infrahub/core/migrations/schema/node_remove.py +27 -13
  101. infrahub/core/migrations/schema/tasks.py +5 -5
  102. infrahub/core/migrations/shared.py +4 -4
  103. infrahub/core/models.py +7 -8
  104. infrahub/core/node/__init__.py +170 -46
  105. infrahub/core/node/base.py +1 -1
  106. infrahub/core/node/constraints/grouped_uniqueness.py +9 -2
  107. infrahub/core/node/delete_validator.py +4 -4
  108. infrahub/core/node/ipam.py +13 -8
  109. infrahub/core/node/permissions.py +4 -0
  110. infrahub/core/node/resource_manager/ip_prefix_pool.py +8 -5
  111. infrahub/core/node/standard.py +3 -5
  112. infrahub/core/property.py +1 -1
  113. infrahub/core/protocols.py +6 -0
  114. infrahub/core/protocols_base.py +4 -2
  115. infrahub/core/query/__init__.py +2 -5
  116. infrahub/core/query/attribute.py +9 -9
  117. infrahub/core/query/branch.py +5 -5
  118. infrahub/core/query/delete.py +1 -1
  119. infrahub/core/query/diff.py +45 -7
  120. infrahub/core/query/ipam.py +4 -4
  121. infrahub/core/query/node.py +19 -14
  122. infrahub/core/query/relationship.py +213 -26
  123. infrahub/core/query/resource_manager.py +13 -11
  124. infrahub/core/query/standard_node.py +6 -6
  125. infrahub/core/query/task.py +3 -3
  126. infrahub/core/query/task_log.py +1 -1
  127. infrahub/core/query/utils.py +5 -5
  128. infrahub/core/registry.py +0 -2
  129. infrahub/core/relationship/constraints/count.py +1 -1
  130. infrahub/core/relationship/constraints/peer_kind.py +1 -1
  131. infrahub/core/relationship/model.py +76 -38
  132. infrahub/core/schema/__init__.py +6 -4
  133. infrahub/core/schema/attribute_schema.py +8 -0
  134. infrahub/core/schema/basenode_schema.py +13 -3
  135. infrahub/core/schema/definitions/core/__init__.py +153 -0
  136. infrahub/core/schema/definitions/core/account.py +168 -0
  137. infrahub/core/schema/definitions/core/artifact.py +127 -0
  138. infrahub/core/schema/definitions/core/builtin.py +21 -0
  139. infrahub/core/schema/definitions/core/check.py +60 -0
  140. infrahub/core/schema/definitions/core/generator.py +96 -0
  141. infrahub/core/schema/definitions/core/graphql_query.py +77 -0
  142. infrahub/core/schema/definitions/core/group.py +105 -0
  143. infrahub/core/schema/definitions/core/ipam.py +252 -0
  144. infrahub/core/schema/definitions/core/lineage.py +17 -0
  145. infrahub/core/schema/definitions/core/menu.py +46 -0
  146. infrahub/core/schema/definitions/core/permission.py +161 -0
  147. infrahub/core/schema/definitions/core/profile.py +29 -0
  148. infrahub/core/schema/definitions/core/propose_change.py +88 -0
  149. infrahub/core/schema/definitions/core/propose_change_comment.py +188 -0
  150. infrahub/core/schema/definitions/core/propose_change_validator.py +326 -0
  151. infrahub/core/schema/definitions/core/repository.py +280 -0
  152. infrahub/core/schema/definitions/core/resource_pool.py +180 -0
  153. infrahub/core/schema/definitions/core/template.py +12 -0
  154. infrahub/core/schema/definitions/core/transform.py +87 -0
  155. infrahub/core/schema/definitions/core/webhook.py +108 -0
  156. infrahub/core/schema/definitions/internal.py +16 -0
  157. infrahub/core/schema/generated/genericnode_schema.py +5 -0
  158. infrahub/core/schema/generated/node_schema.py +5 -0
  159. infrahub/core/schema/generic_schema.py +5 -1
  160. infrahub/core/schema/manager.py +45 -42
  161. infrahub/core/schema/node_schema.py +4 -0
  162. infrahub/core/schema/profile_schema.py +4 -0
  163. infrahub/core/schema/relationship_schema.py +10 -2
  164. infrahub/core/schema/schema_branch.py +260 -16
  165. infrahub/core/schema/template_schema.py +36 -0
  166. infrahub/core/task/user_task.py +7 -5
  167. infrahub/core/timestamp.py +3 -3
  168. infrahub/core/utils.py +3 -2
  169. infrahub/core/validators/attribute/choices.py +1 -1
  170. infrahub/core/validators/attribute/enum.py +1 -1
  171. infrahub/core/validators/attribute/kind.py +1 -1
  172. infrahub/core/validators/attribute/length.py +1 -1
  173. infrahub/core/validators/attribute/optional.py +1 -1
  174. infrahub/core/validators/attribute/regex.py +1 -1
  175. infrahub/core/validators/attribute/unique.py +1 -1
  176. infrahub/core/validators/checks_runner.py +37 -0
  177. infrahub/core/validators/node/generate_profile.py +1 -1
  178. infrahub/core/validators/node/hierarchy.py +1 -1
  179. infrahub/core/validators/query.py +1 -1
  180. infrahub/core/validators/relationship/count.py +1 -1
  181. infrahub/core/validators/relationship/optional.py +1 -1
  182. infrahub/core/validators/relationship/peer.py +1 -1
  183. infrahub/core/validators/tasks.py +8 -6
  184. infrahub/core/validators/uniqueness/query.py +20 -17
  185. infrahub/database/__init__.py +16 -2
  186. infrahub/database/memgraph.py +1 -1
  187. infrahub/dependencies/builder/constraint/grouped/node_runner.py +0 -2
  188. infrahub/dependencies/builder/diff/combiner.py +1 -1
  189. infrahub/dependencies/builder/diff/conflicts_enricher.py +1 -1
  190. infrahub/dependencies/builder/diff/coordinator.py +0 -2
  191. infrahub/dependencies/builder/diff/deserializer.py +4 -2
  192. infrahub/dependencies/builder/diff/enricher/hierarchy.py +3 -1
  193. infrahub/dependencies/builder/diff/enricher/summary_counts.py +1 -1
  194. infrahub/dependencies/builder/diff/parent_node_adder.py +8 -0
  195. infrahub/events/artifact_action.py +76 -0
  196. infrahub/events/branch_action.py +50 -21
  197. infrahub/events/group_action.py +117 -0
  198. infrahub/events/models.py +164 -51
  199. infrahub/events/node_action.py +70 -8
  200. infrahub/events/repository_action.py +8 -8
  201. infrahub/events/schema_action.py +21 -8
  202. infrahub/exceptions.py +9 -0
  203. infrahub/generators/models.py +1 -0
  204. infrahub/generators/tasks.py +34 -15
  205. infrahub/git/base.py +3 -5
  206. infrahub/git/constants.py +0 -1
  207. infrahub/git/integrator.py +60 -36
  208. infrahub/git/models.py +80 -1
  209. infrahub/git/repository.py +7 -8
  210. infrahub/git/tasks.py +432 -112
  211. infrahub/git_credential/helper.py +2 -3
  212. infrahub/graphql/analyzer.py +572 -11
  213. infrahub/graphql/app.py +34 -26
  214. infrahub/graphql/auth/query_permission_checker/anonymous_checker.py +5 -5
  215. infrahub/graphql/auth/query_permission_checker/default_branch_checker.py +4 -4
  216. infrahub/graphql/auth/query_permission_checker/merge_operation_checker.py +4 -4
  217. infrahub/graphql/auth/query_permission_checker/object_permission_checker.py +28 -35
  218. infrahub/graphql/auth/query_permission_checker/super_admin_checker.py +5 -5
  219. infrahub/graphql/context.py +33 -0
  220. infrahub/graphql/enums.py +1 -1
  221. infrahub/graphql/initialization.py +5 -1
  222. infrahub/graphql/loaders/node.py +2 -2
  223. infrahub/graphql/manager.py +63 -63
  224. infrahub/graphql/mutations/account.py +20 -13
  225. infrahub/graphql/mutations/artifact_definition.py +16 -12
  226. infrahub/graphql/mutations/branch.py +86 -40
  227. infrahub/graphql/mutations/computed_attribute.py +24 -13
  228. infrahub/graphql/mutations/diff.py +54 -14
  229. infrahub/graphql/mutations/diff_conflict.py +14 -8
  230. infrahub/graphql/mutations/generator.py +83 -0
  231. infrahub/graphql/mutations/graphql_query.py +19 -11
  232. infrahub/graphql/mutations/ipam.py +25 -23
  233. infrahub/graphql/mutations/main.py +243 -50
  234. infrahub/graphql/mutations/menu.py +10 -10
  235. infrahub/graphql/mutations/proposed_change.py +36 -28
  236. infrahub/graphql/mutations/relationship.py +343 -104
  237. infrahub/graphql/mutations/repository.py +41 -35
  238. infrahub/graphql/mutations/resource_manager.py +26 -26
  239. infrahub/graphql/mutations/schema.py +66 -33
  240. infrahub/graphql/mutations/tasks.py +16 -10
  241. infrahub/graphql/parser.py +1 -1
  242. infrahub/graphql/permissions.py +3 -10
  243. infrahub/graphql/queries/account.py +22 -18
  244. infrahub/graphql/queries/branch.py +6 -4
  245. infrahub/graphql/queries/diff/tree.py +63 -52
  246. infrahub/graphql/queries/event.py +115 -0
  247. infrahub/graphql/queries/internal.py +3 -3
  248. infrahub/graphql/queries/ipam.py +23 -18
  249. infrahub/graphql/queries/relationship.py +11 -10
  250. infrahub/graphql/queries/resource_manager.py +43 -27
  251. infrahub/graphql/queries/search.py +9 -8
  252. infrahub/graphql/queries/status.py +12 -9
  253. infrahub/graphql/queries/task.py +11 -9
  254. infrahub/graphql/resolvers/resolver.py +69 -43
  255. infrahub/graphql/resolvers/single_relationship.py +16 -10
  256. infrahub/graphql/schema.py +4 -0
  257. infrahub/graphql/subscription/__init__.py +1 -1
  258. infrahub/graphql/subscription/events.py +1 -1
  259. infrahub/graphql/subscription/graphql_query.py +8 -8
  260. infrahub/graphql/types/branch.py +2 -2
  261. infrahub/graphql/types/common.py +6 -1
  262. infrahub/graphql/types/context.py +12 -0
  263. infrahub/graphql/types/enums.py +2 -0
  264. infrahub/graphql/types/event.py +158 -0
  265. infrahub/graphql/types/interface.py +2 -2
  266. infrahub/graphql/types/node.py +3 -3
  267. infrahub/graphql/types/permission.py +2 -2
  268. infrahub/graphql/types/relationship.py +3 -3
  269. infrahub/graphql/types/standard_node.py +9 -11
  270. infrahub/graphql/utils.py +28 -182
  271. infrahub/groups/tasks.py +2 -3
  272. infrahub/lock.py +21 -21
  273. infrahub/menu/generator.py +0 -1
  274. infrahub/menu/menu.py +116 -138
  275. infrahub/menu/models.py +4 -4
  276. infrahub/message_bus/__init__.py +11 -13
  277. infrahub/message_bus/messages/__init__.py +0 -14
  278. infrahub/message_bus/messages/check_generator_run.py +1 -3
  279. infrahub/message_bus/messages/event_branch_merge.py +3 -0
  280. infrahub/message_bus/messages/proposed_change/request_proposedchange_refreshartifacts.py +6 -0
  281. infrahub/message_bus/messages/request_proposedchange_pipeline.py +2 -0
  282. infrahub/message_bus/messages/send_echo_request.py +1 -1
  283. infrahub/message_bus/operations/__init__.py +4 -13
  284. infrahub/message_bus/operations/check/__init__.py +2 -2
  285. infrahub/message_bus/operations/check/generator.py +1 -3
  286. infrahub/message_bus/operations/event/branch.py +7 -3
  287. infrahub/message_bus/operations/event/schema.py +1 -1
  288. infrahub/message_bus/operations/event/worker.py +0 -3
  289. infrahub/message_bus/operations/finalize/validator.py +1 -1
  290. infrahub/message_bus/operations/git/file.py +2 -2
  291. infrahub/message_bus/operations/git/repository.py +1 -1
  292. infrahub/message_bus/operations/requests/__init__.py +0 -4
  293. infrahub/message_bus/operations/requests/generator_definition.py +2 -4
  294. infrahub/message_bus/operations/requests/proposed_change.py +37 -20
  295. infrahub/message_bus/operations/send/echo.py +1 -1
  296. infrahub/message_bus/types.py +1 -1
  297. infrahub/permissions/__init__.py +2 -1
  298. infrahub/permissions/globals.py +15 -0
  299. infrahub/permissions/types.py +26 -0
  300. infrahub/pools/prefix.py +29 -165
  301. infrahub/prefect_server/__init__.py +0 -0
  302. infrahub/prefect_server/app.py +18 -0
  303. infrahub/prefect_server/database.py +20 -0
  304. infrahub/prefect_server/events.py +28 -0
  305. infrahub/prefect_server/models.py +46 -0
  306. infrahub/proposed_change/models.py +18 -1
  307. infrahub/proposed_change/tasks.py +195 -53
  308. infrahub/pytest_plugin.py +4 -4
  309. infrahub/server.py +13 -12
  310. infrahub/services/__init__.py +148 -63
  311. infrahub/services/adapters/cache/__init__.py +11 -11
  312. infrahub/services/adapters/cache/nats.py +42 -25
  313. infrahub/services/adapters/cache/redis.py +3 -11
  314. infrahub/services/adapters/event/__init__.py +10 -18
  315. infrahub/services/adapters/http/__init__.py +0 -5
  316. infrahub/services/adapters/http/httpx.py +22 -15
  317. infrahub/services/adapters/message_bus/__init__.py +25 -8
  318. infrahub/services/adapters/message_bus/local.py +9 -7
  319. infrahub/services/adapters/message_bus/nats.py +14 -8
  320. infrahub/services/adapters/message_bus/rabbitmq.py +23 -10
  321. infrahub/services/adapters/workflow/__init__.py +11 -8
  322. infrahub/services/adapters/workflow/local.py +27 -6
  323. infrahub/services/adapters/workflow/worker.py +23 -7
  324. infrahub/services/component.py +43 -40
  325. infrahub/services/protocols.py +7 -7
  326. infrahub/services/scheduler.py +30 -29
  327. infrahub/storage.py +2 -4
  328. infrahub/task_manager/constants.py +1 -1
  329. infrahub/task_manager/event.py +261 -0
  330. infrahub/task_manager/models.py +147 -3
  331. infrahub/task_manager/task.py +1 -1
  332. infrahub/tasks/artifact.py +19 -18
  333. infrahub/tasks/registry.py +1 -1
  334. infrahub/tasks/telemetry.py +13 -14
  335. infrahub/transformations/tasks.py +3 -5
  336. infrahub/trigger/__init__.py +0 -0
  337. infrahub/trigger/catalogue.py +16 -0
  338. infrahub/trigger/constants.py +9 -0
  339. infrahub/trigger/models.py +105 -0
  340. infrahub/trigger/tasks.py +91 -0
  341. infrahub/types.py +1 -1
  342. infrahub/utils.py +1 -1
  343. infrahub/webhook/constants.py +0 -2
  344. infrahub/webhook/models.py +161 -40
  345. infrahub/webhook/tasks.py +123 -202
  346. infrahub/webhook/triggers.py +27 -0
  347. infrahub/workers/infrahub_async.py +36 -25
  348. infrahub/workers/utils.py +63 -0
  349. infrahub/workflows/catalogue.py +71 -52
  350. infrahub/workflows/initialization.py +14 -8
  351. infrahub/workflows/models.py +28 -4
  352. infrahub/workflows/utils.py +1 -1
  353. infrahub_sdk/client.py +8 -0
  354. infrahub_sdk/ctl/branch.py +3 -2
  355. infrahub_sdk/ctl/check.py +3 -3
  356. infrahub_sdk/ctl/cli_commands.py +16 -11
  357. infrahub_sdk/ctl/exceptions.py +0 -6
  358. infrahub_sdk/ctl/exporter.py +1 -1
  359. infrahub_sdk/ctl/generator.py +5 -5
  360. infrahub_sdk/ctl/importer.py +3 -2
  361. infrahub_sdk/ctl/menu.py +1 -1
  362. infrahub_sdk/ctl/object.py +1 -1
  363. infrahub_sdk/ctl/repository.py +23 -15
  364. infrahub_sdk/ctl/schema.py +2 -2
  365. infrahub_sdk/ctl/utils.py +4 -19
  366. infrahub_sdk/ctl/validate.py +2 -1
  367. infrahub_sdk/exceptions.py +12 -0
  368. infrahub_sdk/generator.py +3 -0
  369. infrahub_sdk/node.py +4 -4
  370. infrahub_sdk/protocols.py +21 -8
  371. infrahub_sdk/schema/__init__.py +14 -2
  372. infrahub_sdk/schema/main.py +7 -0
  373. infrahub_sdk/task/__init__.py +1 -0
  374. infrahub_sdk/task/constants.py +3 -0
  375. infrahub_sdk/task/exceptions.py +25 -0
  376. infrahub_sdk/task/manager.py +545 -0
  377. infrahub_sdk/task/models.py +74 -0
  378. infrahub_sdk/timestamp.py +134 -33
  379. infrahub_sdk/utils.py +39 -1
  380. infrahub_sdk/yaml.py +2 -3
  381. {infrahub_server-1.1.6.dist-info → infrahub_server-1.2.0b1.dist-info}/METADATA +47 -12
  382. infrahub_server-1.2.0b1.dist-info/RECORD +725 -0
  383. infrahub_testcontainers/container.py +14 -6
  384. infrahub_testcontainers/docker-compose.test.yml +24 -5
  385. infrahub_testcontainers/haproxy.cfg +43 -0
  386. infrahub_testcontainers/helpers.py +85 -1
  387. infrahub/core/branch/constants.py +0 -2
  388. infrahub/core/schema/definitions/core.py +0 -2274
  389. infrahub/graphql/query.py +0 -52
  390. infrahub/message_bus/messages/check_repository_checkdefinition.py +0 -20
  391. infrahub/message_bus/messages/check_repository_mergeconflicts.py +0 -16
  392. infrahub/message_bus/messages/check_repository_usercheck.py +0 -26
  393. infrahub/message_bus/messages/request_artifactdefinition_check.py +0 -17
  394. infrahub/message_bus/messages/request_repository_checks.py +0 -12
  395. infrahub/message_bus/messages/request_repository_userchecks.py +0 -18
  396. infrahub/message_bus/operations/check/repository.py +0 -293
  397. infrahub/message_bus/operations/requests/artifact_definition.py +0 -148
  398. infrahub/message_bus/operations/requests/repository.py +0 -133
  399. infrahub/schema/constants.py +0 -1
  400. infrahub/schema/tasks.py +0 -76
  401. infrahub/services/adapters/database/__init__.py +0 -9
  402. infrahub_sdk/ctl/_file.py +0 -13
  403. infrahub_server-1.1.6.dist-info/RECORD +0 -681
  404. /infrahub/{schema → artifacts}/__init__.py +0 -0
  405. {infrahub_server-1.1.6.dist-info → infrahub_server-1.2.0b1.dist-info}/LICENSE.txt +0 -0
  406. {infrahub_server-1.1.6.dist-info → infrahub_server-1.2.0b1.dist-info}/WHEEL +0 -0
  407. {infrahub_server-1.1.6.dist-info → infrahub_server-1.2.0b1.dist-info}/entry_points.txt +0 -0
@@ -1,2274 +0,0 @@
1
- from typing import Any
2
-
3
- from infrahub.core.constants import (
4
- DEFAULT_KIND_MAX_LENGTH,
5
- DEFAULT_KIND_MIN_LENGTH,
6
- NAMESPACE_REGEX,
7
- AccountStatus,
8
- AccountType,
9
- AllowOverrideType,
10
- ArtifactStatus,
11
- BranchConflictKeep,
12
- BranchSupportType,
13
- ContentType,
14
- GeneratorInstanceStatus,
15
- GlobalPermissions,
16
- InfrahubKind,
17
- PermissionAction,
18
- PermissionDecision,
19
- RelationshipDeleteBehavior,
20
- RepositoryInternalStatus,
21
- RepositoryOperationalStatus,
22
- RepositorySyncStatus,
23
- Severity,
24
- ValidatorConclusion,
25
- ValidatorState,
26
- )
27
- from infrahub.proposed_change.constants import ProposedChangeState
28
-
29
- # pylint: disable=too-many-lines
30
-
31
- core_profile_schema_definition: dict[str, Any] = {
32
- "name": "Profile",
33
- "namespace": "Core",
34
- "include_in_menu": False,
35
- "icon": "mdi:shape-plus-outline",
36
- "description": "Base Profile in Infrahub.",
37
- "label": "Profile",
38
- "display_labels": ["profile_name__value"],
39
- "default_filter": "profile_name__value",
40
- "uniqueness_constraints": [["profile_name__value"]],
41
- "attributes": [
42
- {
43
- "name": "profile_name",
44
- "kind": "Text",
45
- "min_length": 3,
46
- "max_length": 32,
47
- "optional": False,
48
- "unique": True,
49
- },
50
- {
51
- "name": "profile_priority",
52
- "kind": "Number",
53
- "default_value": 1000,
54
- "optional": True,
55
- },
56
- ],
57
- }
58
-
59
- # -----------------------------------------------
60
- # Menu Items
61
- # -----------------------------------------------
62
- generic_menu_item: dict[str, Any] = {
63
- "name": "Menu",
64
- "namespace": "Core",
65
- "include_in_menu": False,
66
- "description": "Element of the Menu",
67
- "label": "Menu",
68
- "hierarchical": True,
69
- "human_friendly_id": ["namespace__value", "name__value"],
70
- "display_labels": ["label__value"],
71
- "generate_profile": False,
72
- "attributes": [
73
- {"name": "namespace", "kind": "Text", "regex": NAMESPACE_REGEX, "order_weight": 1000},
74
- {"name": "name", "kind": "Text", "order_weight": 1000},
75
- {"name": "label", "kind": "Text", "optional": True, "order_weight": 2000},
76
- {"name": "kind", "kind": "Text", "optional": True, "order_weight": 2500},
77
- {"name": "path", "kind": "Text", "optional": True, "order_weight": 2500},
78
- {"name": "description", "kind": "Text", "optional": True, "order_weight": 3000},
79
- {"name": "icon", "kind": "Text", "optional": True, "order_weight": 4000},
80
- {"name": "protected", "kind": "Boolean", "default_value": False, "read_only": True, "order_weight": 5000},
81
- {"name": "order_weight", "kind": "Number", "default_value": 2000, "order_weight": 6000},
82
- {"name": "required_permissions", "kind": "List", "optional": True, "order_weight": 7000},
83
- {
84
- "name": "section",
85
- "kind": "Text",
86
- "enum": ["object", "internal"],
87
- "default_value": "object",
88
- "order_weight": 8000,
89
- },
90
- ],
91
- }
92
-
93
- menu_item: dict[str, Any] = {
94
- "name": "MenuItem",
95
- "namespace": "Core",
96
- "include_in_menu": False,
97
- "description": "Menu Item",
98
- "label": "Menu Item",
99
- "inherit_from": ["CoreMenu"],
100
- "generate_profile": False,
101
- }
102
-
103
- core_models: dict[str, Any] = {
104
- "generics": [
105
- {
106
- "name": "Node",
107
- "namespace": "Core",
108
- "include_in_menu": False,
109
- "description": "Base Node in Infrahub.",
110
- "label": "Node",
111
- },
112
- {
113
- "name": "Owner",
114
- "namespace": "Lineage",
115
- "description": "Any Entities that is responsible for some data.",
116
- "label": "Owner",
117
- "include_in_menu": False,
118
- "documentation": "/topics/metadata",
119
- },
120
- core_profile_schema_definition,
121
- {
122
- "name": "Source",
123
- "namespace": "Lineage",
124
- "description": "Any Entities that stores or produces data.",
125
- "label": "Source",
126
- "include_in_menu": False,
127
- "documentation": "/topics/metadata",
128
- },
129
- {
130
- "name": "Comment",
131
- "namespace": "Core",
132
- "description": "A comment on a Proposed Change",
133
- "label": "Comment",
134
- "display_labels": ["text__value"],
135
- "order_by": ["created_at__value"],
136
- "include_in_menu": False,
137
- "branch": BranchSupportType.AGNOSTIC.value,
138
- "attributes": [
139
- {"name": "text", "kind": "TextArea", "unique": False, "optional": False},
140
- {"name": "created_at", "kind": "DateTime", "optional": True},
141
- ],
142
- "relationships": [
143
- {
144
- "name": "created_by",
145
- "peer": InfrahubKind.GENERICACCOUNT,
146
- "optional": True,
147
- "branch": BranchSupportType.AGNOSTIC.value,
148
- "cardinality": "one",
149
- "identifier": "comment__account",
150
- },
151
- ],
152
- },
153
- {
154
- "name": "Thread",
155
- "namespace": "Core",
156
- "description": "A thread on a Proposed Change",
157
- "label": "Thread",
158
- "order_by": ["created_at__value"],
159
- "branch": BranchSupportType.AGNOSTIC.value,
160
- "include_in_menu": False,
161
- "attributes": [
162
- {"name": "label", "kind": "Text", "optional": True},
163
- {"name": "resolved", "kind": "Boolean", "default_value": False},
164
- {"name": "created_at", "kind": "DateTime", "optional": True},
165
- ],
166
- "relationships": [
167
- {
168
- "name": "change",
169
- "peer": InfrahubKind.PROPOSEDCHANGE,
170
- "identifier": "proposedchange__thread",
171
- "kind": "Parent",
172
- "optional": False,
173
- "cardinality": "one",
174
- },
175
- {
176
- "name": "comments",
177
- "peer": InfrahubKind.THREADCOMMENT,
178
- "identifier": "thread__threadcomment",
179
- "kind": "Component",
180
- "optional": True,
181
- "cardinality": "many",
182
- "on_delete": RelationshipDeleteBehavior.CASCADE,
183
- },
184
- {
185
- "name": "created_by",
186
- "peer": InfrahubKind.GENERICACCOUNT,
187
- "identifier": "thread__account",
188
- "optional": True,
189
- "branch": BranchSupportType.AGNOSTIC.value,
190
- "cardinality": "one",
191
- },
192
- ],
193
- },
194
- {
195
- "name": "Group",
196
- "namespace": "Core",
197
- "description": "Generic Group Object.",
198
- "label": "Group",
199
- "default_filter": "name__value",
200
- "order_by": ["name__value"],
201
- "display_labels": ["label__value"],
202
- "include_in_menu": False,
203
- "icon": "mdi:group",
204
- "hierarchical": True,
205
- "branch": BranchSupportType.AWARE.value,
206
- "uniqueness_constraints": [["name__value"]],
207
- "attributes": [
208
- {"name": "name", "kind": "Text", "unique": True},
209
- {"name": "label", "kind": "Text", "optional": True},
210
- {"name": "description", "kind": "Text", "optional": True},
211
- {
212
- "name": "group_type",
213
- "kind": "Text",
214
- "enum": ["default", "internal"],
215
- "default_value": "default",
216
- "optional": False,
217
- },
218
- ],
219
- "relationships": [
220
- {
221
- "name": "members",
222
- "peer": InfrahubKind.NODE,
223
- "optional": True,
224
- "identifier": "group_member",
225
- "cardinality": "many",
226
- },
227
- {
228
- "name": "subscribers",
229
- "peer": InfrahubKind.NODE,
230
- "optional": True,
231
- "identifier": "group_subscriber",
232
- "cardinality": "many",
233
- },
234
- ],
235
- },
236
- {
237
- "name": "Validator",
238
- "namespace": "Core",
239
- "description": "",
240
- "include_in_menu": False,
241
- "label": "Validator",
242
- "order_by": ["started_at__value"],
243
- "display_labels": ["label__value"],
244
- "branch": BranchSupportType.AGNOSTIC.value,
245
- "attributes": [
246
- {"name": "label", "kind": "Text", "optional": True},
247
- {
248
- "name": "state",
249
- "kind": "Text",
250
- "enum": ValidatorState.available_types(),
251
- "default_value": ValidatorState.QUEUED.value,
252
- },
253
- {
254
- "name": "conclusion",
255
- "kind": "Text",
256
- "enum": ValidatorConclusion.available_types(),
257
- "default_value": ValidatorConclusion.UNKNOWN.value,
258
- },
259
- {"name": "completed_at", "kind": "DateTime", "optional": True},
260
- {"name": "started_at", "kind": "DateTime", "optional": True},
261
- ],
262
- "relationships": [
263
- {
264
- "name": "proposed_change",
265
- "peer": InfrahubKind.PROPOSEDCHANGE,
266
- "kind": "Parent",
267
- "optional": False,
268
- "cardinality": "one",
269
- "identifier": "proposed_change__validator",
270
- },
271
- {
272
- "name": "checks",
273
- "peer": "CoreCheck",
274
- "kind": "Component",
275
- "optional": True,
276
- "cardinality": "many",
277
- "identifier": "validator__check",
278
- "on_delete": RelationshipDeleteBehavior.CASCADE,
279
- },
280
- ],
281
- },
282
- {
283
- "name": "Check",
284
- "namespace": "Core",
285
- "description": "",
286
- "display_labels": ["label__value"],
287
- "include_in_menu": False,
288
- "label": "Check",
289
- "branch": BranchSupportType.AGNOSTIC.value,
290
- "attributes": [
291
- {"name": "name", "kind": "Text", "optional": True},
292
- {"name": "label", "kind": "Text", "optional": True},
293
- {"name": "origin", "kind": "Text", "optional": False},
294
- {
295
- "name": "kind",
296
- "kind": "Text",
297
- "regex": "^[A-Z][a-zA-Z0-9]+$",
298
- "optional": False,
299
- "min_length": DEFAULT_KIND_MIN_LENGTH,
300
- "max_length": DEFAULT_KIND_MAX_LENGTH,
301
- },
302
- {"name": "message", "kind": "TextArea", "optional": True},
303
- {
304
- "name": "conclusion",
305
- "kind": "Text",
306
- "enum": ValidatorConclusion.available_types(),
307
- "default_value": ValidatorConclusion.UNKNOWN.value,
308
- "optional": True,
309
- },
310
- {
311
- "name": "severity",
312
- "kind": "Text",
313
- "enum": Severity.available_types(),
314
- "default_value": Severity.INFO.value,
315
- "optional": True,
316
- },
317
- {"name": "created_at", "kind": "DateTime", "optional": True},
318
- ],
319
- "relationships": [
320
- {
321
- "name": "validator",
322
- "peer": InfrahubKind.VALIDATOR,
323
- "identifier": "validator__check",
324
- "kind": "Parent",
325
- "optional": False,
326
- "cardinality": "one",
327
- },
328
- ],
329
- },
330
- {
331
- "name": "Transformation",
332
- "namespace": "Core",
333
- "description": "Generic Transformation Object.",
334
- "include_in_menu": False,
335
- "icon": "mdi:cog-transfer",
336
- "label": "Transformation",
337
- "default_filter": "name__value",
338
- "order_by": ["name__value"],
339
- "display_labels": ["label__value"],
340
- "branch": BranchSupportType.AWARE.value,
341
- "documentation": "/topics/proposed-change",
342
- "uniqueness_constraints": [["name__value"]],
343
- "attributes": [
344
- {"name": "name", "kind": "Text", "unique": True},
345
- {"name": "label", "kind": "Text", "optional": True},
346
- {"name": "description", "kind": "Text", "optional": True},
347
- {"name": "timeout", "kind": "Number", "default_value": 10},
348
- ],
349
- "relationships": [
350
- {
351
- "name": "query",
352
- "peer": InfrahubKind.GRAPHQLQUERY,
353
- "identifier": "graphql_query__transformation",
354
- "kind": "Attribute",
355
- "cardinality": "one",
356
- "optional": False,
357
- },
358
- {
359
- "name": "repository",
360
- "peer": InfrahubKind.GENERICREPOSITORY,
361
- "kind": "Attribute",
362
- "cardinality": "one",
363
- "identifier": "repository__transformation",
364
- "optional": False,
365
- },
366
- {
367
- "name": "tags",
368
- "peer": InfrahubKind.TAG,
369
- "kind": "Attribute",
370
- "optional": True,
371
- "cardinality": "many",
372
- },
373
- ],
374
- },
375
- {
376
- "name": "ArtifactTarget",
377
- "include_in_menu": False,
378
- "namespace": "Core",
379
- "description": "Extend a node to be associated with artifacts",
380
- "label": "Artifact Target",
381
- "relationships": [
382
- {
383
- "name": "artifacts",
384
- "peer": InfrahubKind.ARTIFACT,
385
- "optional": True,
386
- "cardinality": "many",
387
- "kind": "Generic",
388
- "identifier": "artifact__node",
389
- },
390
- ],
391
- },
392
- {
393
- "name": "TaskTarget",
394
- "include_in_menu": False,
395
- "namespace": "Core",
396
- "description": "Extend a node to be associated with tasks",
397
- "label": "Task Target",
398
- },
399
- {
400
- "name": "Webhook",
401
- "namespace": "Core",
402
- "description": "A webhook that connects to an external integration",
403
- "label": "Webhook",
404
- "default_filter": "name__value",
405
- "order_by": ["name__value"],
406
- "display_labels": ["name__value"],
407
- "include_in_menu": False,
408
- "branch": BranchSupportType.AGNOSTIC.value,
409
- "uniqueness_constraints": [["name__value"]],
410
- "attributes": [
411
- {"name": "name", "kind": "Text", "unique": True, "order_weight": 1000},
412
- {"name": "description", "kind": "Text", "optional": True, "order_weight": 2000},
413
- {"name": "url", "kind": "URL", "order_weight": 3000},
414
- {
415
- "name": "validate_certificates",
416
- "kind": "Boolean",
417
- "default_value": True,
418
- "optional": True,
419
- "order_weight": 5000,
420
- },
421
- ],
422
- },
423
- {
424
- "name": "GenericRepository",
425
- "namespace": "Core",
426
- "label": "Git Repository",
427
- "description": "A Git Repository integrated with Infrahub",
428
- "include_in_menu": False,
429
- "default_filter": "name__value",
430
- "order_by": ["name__value"],
431
- "display_labels": ["name__value"],
432
- "icon": "mdi:source-repository",
433
- "branch": BranchSupportType.AGNOSTIC.value,
434
- "uniqueness_constraints": [["name__value"], ["location__value"]],
435
- "documentation": "/topics/repository",
436
- "attributes": [
437
- {
438
- "name": "name",
439
- "regex": "^[^/]*$",
440
- "kind": "Text",
441
- "unique": True,
442
- "branch": BranchSupportType.AGNOSTIC.value,
443
- "order_weight": 1000,
444
- "allow_override": AllowOverrideType.NONE,
445
- },
446
- {
447
- "name": "description",
448
- "kind": "Text",
449
- "optional": True,
450
- "branch": BranchSupportType.AGNOSTIC.value,
451
- "order_weight": 2000,
452
- "allow_override": AllowOverrideType.NONE,
453
- },
454
- {
455
- "name": "location",
456
- "kind": "Text",
457
- "unique": True,
458
- "branch": BranchSupportType.AGNOSTIC.value,
459
- "order_weight": 3000,
460
- "allow_override": AllowOverrideType.NONE,
461
- },
462
- {
463
- "name": "internal_status",
464
- "kind": "Dropdown",
465
- "choices": [
466
- {
467
- "name": RepositoryInternalStatus.STAGING.value,
468
- "label": "Staging",
469
- "description": "Repository was recently added to this branch.",
470
- "color": "#fef08a",
471
- },
472
- {
473
- "name": RepositoryInternalStatus.ACTIVE.value,
474
- "label": "Active",
475
- "description": "Repository is actively being synced for this branch",
476
- "color": "#86efac",
477
- },
478
- {
479
- "name": RepositoryInternalStatus.INACTIVE.value,
480
- "label": "Inactive",
481
- "description": "Repository is not active on this branch.",
482
- "color": "#e5e7eb",
483
- },
484
- ],
485
- "default_value": "inactive",
486
- "optional": False,
487
- "branch": BranchSupportType.LOCAL.value,
488
- "order_weight": 7000,
489
- "allow_override": AllowOverrideType.NONE,
490
- },
491
- {
492
- "name": "operational_status",
493
- "kind": "Dropdown",
494
- "choices": [
495
- {
496
- "name": RepositoryOperationalStatus.UNKNOWN.value,
497
- "label": "Unknown",
498
- "description": "Status of the repository is unknown and mostlikely because it hasn't been synced yet",
499
- "color": "#9ca3af",
500
- },
501
- {
502
- "name": RepositoryOperationalStatus.ONLINE.value,
503
- "label": "Online",
504
- "description": "Repository connection is working",
505
- "color": "#86efac",
506
- },
507
- {
508
- "name": RepositoryOperationalStatus.ERROR_CRED.value,
509
- "label": "Credential Error",
510
- "description": "Repository can't be synced due to some credential error(s)",
511
- "color": "#f87171",
512
- },
513
- {
514
- "name": RepositoryOperationalStatus.ERROR_CONNECTION.value,
515
- "label": "Connectivity Error",
516
- "description": "Repository can't be synced due to some connectivity error(s)",
517
- "color": "#f87171",
518
- },
519
- {
520
- "name": RepositoryOperationalStatus.ERROR.value,
521
- "label": "Error",
522
- "description": "Repository can't be synced due to an unknown error",
523
- "color": "#ef4444",
524
- },
525
- ],
526
- "optional": False,
527
- "branch": BranchSupportType.AGNOSTIC.value,
528
- "default_value": RepositoryOperationalStatus.UNKNOWN.value,
529
- "order_weight": 5000,
530
- },
531
- {
532
- "name": "sync_status",
533
- "kind": "Dropdown",
534
- "choices": [
535
- {
536
- "name": RepositorySyncStatus.UNKNOWN.value,
537
- "label": "Unknown",
538
- "description": "Status of the repository is unknown and mostlikely because it hasn't been synced yet",
539
- "color": "#9ca3af",
540
- },
541
- {
542
- "name": RepositorySyncStatus.ERROR_IMPORT.value,
543
- "label": "Import Error",
544
- "description": "Repository import error observed",
545
- "color": "#f87171",
546
- },
547
- {
548
- "name": RepositorySyncStatus.IN_SYNC.value,
549
- "label": "In Sync",
550
- "description": "The repository is syncing correctly",
551
- "color": "#60a5fa",
552
- },
553
- {
554
- "name": RepositorySyncStatus.SYNCING.value,
555
- "label": "Syncing",
556
- "description": "A sync job is currently running against the repository.",
557
- "color": "#a855f7",
558
- },
559
- ],
560
- "optional": False,
561
- "branch": BranchSupportType.LOCAL.value,
562
- "default_value": RepositorySyncStatus.UNKNOWN.value,
563
- "order_weight": 6000,
564
- },
565
- ],
566
- "relationships": [
567
- {
568
- "name": "credential",
569
- "peer": InfrahubKind.CREDENTIAL,
570
- "identifier": "gitrepository__credential",
571
- "kind": "Attribute",
572
- "optional": True,
573
- "cardinality": "one",
574
- "order_weight": 4000,
575
- },
576
- {
577
- "name": "tags",
578
- "peer": InfrahubKind.TAG,
579
- "kind": "Attribute",
580
- "optional": True,
581
- "cardinality": "many",
582
- "order_weight": 8000,
583
- },
584
- {
585
- "name": "transformations",
586
- "peer": InfrahubKind.TRANSFORM,
587
- "identifier": "repository__transformation",
588
- "optional": True,
589
- "cardinality": "many",
590
- "order_weight": 10000,
591
- },
592
- {
593
- "name": "queries",
594
- "peer": InfrahubKind.GRAPHQLQUERY,
595
- "identifier": "graphql_query__repository",
596
- "optional": True,
597
- "cardinality": "many",
598
- "order_weight": 9000,
599
- },
600
- {
601
- "name": "checks",
602
- "peer": InfrahubKind.CHECKDEFINITION,
603
- "identifier": "check_definition__repository",
604
- "optional": True,
605
- "cardinality": "many",
606
- "order_weight": 11000,
607
- },
608
- {
609
- "name": "generators",
610
- "peer": InfrahubKind.GENERATORDEFINITION,
611
- "identifier": "generator_definition__repository",
612
- "optional": True,
613
- "cardinality": "many",
614
- "order_weight": 12000,
615
- },
616
- ],
617
- },
618
- {
619
- "name": "IPNamespace",
620
- "namespace": "Builtin",
621
- "label": "IP Namespace",
622
- "description": "A generic container for IP prefixes and IP addresses",
623
- "include_in_menu": False,
624
- "default_filter": "name__value",
625
- "order_by": ["name__value"],
626
- "display_labels": ["name__value"],
627
- "icon": "mdi:format-list-group",
628
- "branch": BranchSupportType.AWARE.value,
629
- "uniqueness_constraints": [["name__value"]],
630
- "generate_profile": False,
631
- "attributes": [
632
- {
633
- "name": "name",
634
- "kind": "Text",
635
- "unique": True,
636
- "branch": BranchSupportType.AWARE.value,
637
- "order_weight": 1000,
638
- },
639
- {
640
- "name": "description",
641
- "kind": "Text",
642
- "optional": True,
643
- "branch": BranchSupportType.AWARE.value,
644
- "order_weight": 2000,
645
- },
646
- ],
647
- "relationships": [
648
- {
649
- "name": "ip_prefixes",
650
- "label": "IP Prefixes",
651
- "peer": InfrahubKind.IPPREFIX,
652
- "identifier": "ip_namespace__ip_prefix",
653
- "optional": True,
654
- "cardinality": "many",
655
- "on_delete": RelationshipDeleteBehavior.CASCADE,
656
- "allow_override": AllowOverrideType.NONE,
657
- },
658
- {
659
- "name": "ip_addresses",
660
- "label": "IP Addresses",
661
- "peer": InfrahubKind.IPADDRESS,
662
- "identifier": "ip_namespace__ip_address",
663
- "optional": True,
664
- "cardinality": "many",
665
- "on_delete": RelationshipDeleteBehavior.CASCADE,
666
- "allow_override": AllowOverrideType.NONE,
667
- },
668
- ],
669
- },
670
- {
671
- "name": "IPPrefix",
672
- "label": "IP Prefix",
673
- "namespace": "Builtin",
674
- "description": "IPv6 or IPv4 prefix also referred as network",
675
- "include_in_menu": False,
676
- "default_filter": "prefix__value",
677
- "order_by": ["prefix__version", "prefix__binary_address", "prefix__prefixlen"],
678
- "display_labels": ["prefix__value"],
679
- "icon": "mdi:ip-network",
680
- "branch": BranchSupportType.AWARE.value,
681
- "hierarchical": True,
682
- "attributes": [
683
- {
684
- "name": "prefix",
685
- "kind": "IPNetwork",
686
- "branch": BranchSupportType.AWARE.value,
687
- "order_weight": 1000,
688
- },
689
- {
690
- "name": "description",
691
- "kind": "Text",
692
- "optional": True,
693
- "branch": BranchSupportType.AWARE.value,
694
- "order_weight": 2000,
695
- },
696
- {
697
- "name": "member_type",
698
- "kind": "Dropdown",
699
- "choices": [
700
- {
701
- "name": "prefix",
702
- "label": "Prefix",
703
- "description": "Prefix serves as container for other prefixes",
704
- },
705
- {
706
- "name": "address",
707
- "label": "Address",
708
- "description": "Prefix serves as subnet for IP addresses",
709
- },
710
- ],
711
- "branch": BranchSupportType.AWARE.value,
712
- "default_value": "address",
713
- "order_weight": 3000,
714
- },
715
- {
716
- "name": "is_pool",
717
- "kind": "Boolean",
718
- "branch": BranchSupportType.AWARE.value,
719
- "default_value": False,
720
- "order_weight": 4000,
721
- "description": "All IP addresses within this prefix are considered usable",
722
- },
723
- {
724
- "name": "is_top_level",
725
- "kind": "Boolean",
726
- "read_only": True,
727
- "optional": True,
728
- "allow_override": AllowOverrideType.NONE,
729
- },
730
- {
731
- "name": "utilization",
732
- "kind": "Number",
733
- "read_only": True,
734
- "optional": True,
735
- "allow_override": AllowOverrideType.NONE,
736
- },
737
- {
738
- "name": "netmask",
739
- "kind": "Text",
740
- "read_only": True,
741
- "optional": True,
742
- "allow_override": AllowOverrideType.NONE,
743
- },
744
- {
745
- "name": "hostmask",
746
- "kind": "Text",
747
- "read_only": True,
748
- "optional": True,
749
- "allow_override": AllowOverrideType.NONE,
750
- },
751
- {
752
- "name": "network_address",
753
- "kind": "Text",
754
- "read_only": True,
755
- "optional": True,
756
- "allow_override": AllowOverrideType.NONE,
757
- },
758
- {
759
- "name": "broadcast_address",
760
- "kind": "Text",
761
- "read_only": True,
762
- "optional": True,
763
- "allow_override": AllowOverrideType.NONE,
764
- },
765
- ],
766
- "relationships": [
767
- {
768
- "name": "ip_namespace",
769
- "label": "IP Namespace",
770
- "peer": InfrahubKind.IPNAMESPACE,
771
- "identifier": "ip_namespace__ip_prefix",
772
- "optional": True,
773
- "cardinality": "one",
774
- "allow_override": AllowOverrideType.NONE,
775
- },
776
- {
777
- "name": "ip_addresses",
778
- "label": "IP Addresses",
779
- "peer": InfrahubKind.IPADDRESS,
780
- "identifier": "ip_prefix__ip_address",
781
- "optional": True,
782
- "cardinality": "many",
783
- "allow_override": AllowOverrideType.NONE,
784
- "read_only": True,
785
- },
786
- {
787
- "name": "resource_pool",
788
- "peer": "CoreIPAddressPool",
789
- "identifier": "ipaddresspool__resource",
790
- "cardinality": "many",
791
- "branch": BranchSupportType.AGNOSTIC.value,
792
- "optional": True,
793
- "read_only": True,
794
- },
795
- ],
796
- },
797
- {
798
- "name": "IPAddress",
799
- "label": "IP Address",
800
- "namespace": "Builtin",
801
- "description": "IPv6 or IPv4 address",
802
- "include_in_menu": False,
803
- "default_filter": "address__value",
804
- "order_by": ["address__version", "address__binary_address"],
805
- "display_labels": ["address__value"],
806
- "icon": "mdi:ip-outline",
807
- "branch": BranchSupportType.AWARE.value,
808
- "attributes": [
809
- {
810
- "name": "address",
811
- "kind": "IPHost",
812
- "branch": BranchSupportType.AWARE.value,
813
- "order_weight": 1000,
814
- },
815
- {
816
- "name": "description",
817
- "kind": "Text",
818
- "optional": True,
819
- "branch": BranchSupportType.AWARE.value,
820
- "order_weight": 2000,
821
- },
822
- ],
823
- "relationships": [
824
- {
825
- "name": "ip_namespace",
826
- "label": "IP Namespace",
827
- "peer": InfrahubKind.IPNAMESPACE,
828
- "identifier": "ip_namespace__ip_address",
829
- "optional": True,
830
- "cardinality": "one",
831
- "allow_override": AllowOverrideType.NONE,
832
- },
833
- {
834
- "name": "ip_prefix",
835
- "label": "IP Prefix",
836
- "peer": InfrahubKind.IPPREFIX,
837
- "identifier": "ip_prefix__ip_address",
838
- "optional": True,
839
- "cardinality": "one",
840
- "allow_override": AllowOverrideType.NONE,
841
- "read_only": True,
842
- },
843
- ],
844
- },
845
- {
846
- "name": "ResourcePool",
847
- "namespace": "Core",
848
- "label": "Resource Pool",
849
- "description": "The resource manager contains pools of resources to allow for automatic assignments.",
850
- "include_in_menu": False,
851
- "default_filter": "name__value",
852
- "order_by": ["name__value"],
853
- "display_labels": ["name__value"],
854
- "human_friendly_id": ["name__value"],
855
- "icon": "mdi:view-grid-outline",
856
- "branch": BranchSupportType.AGNOSTIC.value,
857
- "uniqueness_constraints": [["name__value"]],
858
- "generate_profile": False,
859
- "attributes": [
860
- {
861
- "name": "name",
862
- "kind": "Text",
863
- "order_weight": 1000,
864
- "unique": True,
865
- },
866
- {
867
- "name": "description",
868
- "kind": "Text",
869
- "optional": True,
870
- "order_weight": 2000,
871
- },
872
- ],
873
- },
874
- {
875
- "name": "GenericAccount",
876
- "namespace": "Core",
877
- "description": "User Account for Infrahub",
878
- "include_in_menu": False,
879
- "label": "Account",
880
- "icon": "mdi:account",
881
- "default_filter": "name__value",
882
- "order_by": ["name__value"],
883
- "display_labels": ["label__value"],
884
- "human_friendly_id": ["name__value"],
885
- "branch": BranchSupportType.AGNOSTIC.value,
886
- "documentation": "/topics/auth",
887
- "uniqueness_constraints": [["name__value"]],
888
- "attributes": [
889
- {"name": "name", "kind": "Text", "unique": True},
890
- {"name": "password", "kind": "HashedPassword", "unique": False},
891
- {"name": "label", "kind": "Text", "optional": True},
892
- {"name": "description", "kind": "Text", "optional": True},
893
- {
894
- "name": "account_type",
895
- "kind": "Text",
896
- "default_value": AccountType.USER.value,
897
- "enum": AccountType.available_types(),
898
- },
899
- {
900
- "name": "status",
901
- "kind": "Dropdown",
902
- "choices": [
903
- {
904
- "name": AccountStatus.ACTIVE.value,
905
- "label": "Active",
906
- "description": "Account is allowed to login",
907
- "color": "#52be80",
908
- },
909
- {
910
- "name": AccountStatus.INACTIVE.value,
911
- "label": "Inactive",
912
- "description": "Account is not allowed to login",
913
- "color": "#e74c3c",
914
- },
915
- ],
916
- "default_value": AccountStatus.ACTIVE.value,
917
- },
918
- ],
919
- "relationships": [
920
- {"name": "tokens", "peer": InfrahubKind.ACCOUNTTOKEN, "optional": True, "cardinality": "many"}
921
- ],
922
- },
923
- {
924
- "name": "BasePermission",
925
- "namespace": "Core",
926
- "description": "A permission grants right to an account",
927
- "label": "Base permission",
928
- "icon": "mdi:user-key",
929
- "include_in_menu": False,
930
- "generate_profile": False,
931
- "attributes": [
932
- {"name": "description", "kind": "Text", "optional": True},
933
- {
934
- "name": "identifier",
935
- "kind": "Text",
936
- "read_only": True,
937
- "optional": True,
938
- "allow_override": AllowOverrideType.NONE,
939
- },
940
- ],
941
- "relationships": [
942
- {
943
- "name": "roles",
944
- "peer": InfrahubKind.ACCOUNTROLE,
945
- "optional": True,
946
- "identifier": "role__permissions",
947
- "cardinality": "many",
948
- "kind": "Attribute",
949
- }
950
- ],
951
- },
952
- {
953
- "name": "Credential",
954
- "namespace": "Core",
955
- "description": "A credential that could be referenced to access external services.",
956
- "include_in_menu": False,
957
- "label": "Credential",
958
- "default_filter": "name__value",
959
- "order_by": ["name__value"],
960
- "display_labels": ["label__value"],
961
- "icon": "mdi:key-variant",
962
- "human_friendly_id": ["name__value"],
963
- "branch": BranchSupportType.AGNOSTIC.value,
964
- "uniqueness_constraints": [["name__value"]],
965
- "documentation": "/topics/auth",
966
- "attributes": [
967
- {"name": "name", "kind": "Text", "unique": True, "order_weight": 1000},
968
- {"name": "label", "kind": "Text", "optional": True, "order_weight": 2000},
969
- {"name": "description", "kind": "Text", "optional": True, "order_weight": 3000},
970
- ],
971
- },
972
- generic_menu_item,
973
- ],
974
- "nodes": [
975
- menu_item,
976
- {
977
- "name": "StandardGroup",
978
- "namespace": "Core",
979
- "description": "Group of nodes of any kind.",
980
- "include_in_menu": False,
981
- "icon": "mdi:account-group",
982
- "label": "Standard Group",
983
- "default_filter": "name__value",
984
- "order_by": ["name__value"],
985
- "display_labels": ["name__value"],
986
- "branch": BranchSupportType.AWARE.value,
987
- "inherit_from": [InfrahubKind.GENERICGROUP],
988
- "generate_profile": False,
989
- },
990
- {
991
- "name": "GeneratorGroup",
992
- "namespace": "Core",
993
- "description": "Group of nodes that are created by a generator.",
994
- "include_in_menu": False,
995
- "icon": "mdi:state-machine",
996
- "label": "Generator Group",
997
- "default_filter": "name__value",
998
- "order_by": ["name__value"],
999
- "display_labels": ["name__value"],
1000
- "branch": BranchSupportType.LOCAL.value,
1001
- "inherit_from": [InfrahubKind.GENERICGROUP],
1002
- "generate_profile": False,
1003
- },
1004
- {
1005
- "name": "GraphQLQueryGroup",
1006
- "namespace": "Core",
1007
- "description": "Group of nodes associated with a given GraphQLQuery.",
1008
- "include_in_menu": False,
1009
- "icon": "mdi:account-group",
1010
- "label": "GraphQL Query Group",
1011
- "default_filter": "name__value",
1012
- "order_by": ["name__value"],
1013
- "display_labels": ["name__value"],
1014
- "branch": BranchSupportType.LOCAL.value,
1015
- "inherit_from": [InfrahubKind.GENERICGROUP],
1016
- "generate_profile": False,
1017
- "attributes": [
1018
- {"name": "parameters", "kind": "JSON", "optional": True},
1019
- ],
1020
- "relationships": [
1021
- {
1022
- "name": "query",
1023
- "peer": InfrahubKind.GRAPHQLQUERY,
1024
- "optional": False,
1025
- "cardinality": "one",
1026
- "kind": "Attribute",
1027
- },
1028
- ],
1029
- },
1030
- {
1031
- "name": "Tag",
1032
- "namespace": "Builtin",
1033
- "description": "Standard Tag object to attached to other objects to provide some context.",
1034
- "include_in_menu": True,
1035
- "icon": "mdi:tag-multiple",
1036
- "label": "Tag",
1037
- "default_filter": "name__value",
1038
- "order_by": ["name__value"],
1039
- "display_labels": ["name__value"],
1040
- "branch": BranchSupportType.AWARE.value,
1041
- "uniqueness_constraints": [["name__value"]],
1042
- "attributes": [
1043
- {"name": "name", "kind": "Text", "unique": True},
1044
- {"name": "description", "kind": "Text", "optional": True},
1045
- ],
1046
- },
1047
- {
1048
- "name": "Account",
1049
- "namespace": "Core",
1050
- "description": "User Account for Infrahub",
1051
- "include_in_menu": False,
1052
- "label": "Account",
1053
- "icon": "mdi:account",
1054
- "default_filter": "name__value",
1055
- "order_by": ["name__value"],
1056
- "display_labels": ["label__value"],
1057
- "generate_profile": False,
1058
- "branch": BranchSupportType.AGNOSTIC.value,
1059
- "inherit_from": [InfrahubKind.LINEAGEOWNER, InfrahubKind.LINEAGESOURCE, InfrahubKind.GENERICACCOUNT],
1060
- },
1061
- {
1062
- "name": "AccountToken",
1063
- "namespace": "Internal",
1064
- "description": "Token for User Account",
1065
- "include_in_menu": False,
1066
- "label": "Account Token",
1067
- "default_filter": "token__value",
1068
- "display_labels": ["token__value"],
1069
- "generate_profile": False,
1070
- "branch": BranchSupportType.AGNOSTIC.value,
1071
- "uniqueness_constraints": [["token__value"]],
1072
- "documentation": "/topics/auth",
1073
- "attributes": [
1074
- {"name": "name", "kind": "Text", "optional": True},
1075
- {"name": "token", "kind": "Text", "unique": True},
1076
- {"name": "expiration", "kind": "DateTime", "optional": True},
1077
- ],
1078
- "relationships": [
1079
- {
1080
- "name": "account",
1081
- "peer": InfrahubKind.GENERICACCOUNT,
1082
- "optional": False,
1083
- "cardinality": "one",
1084
- "identifier": "account__token",
1085
- },
1086
- ],
1087
- },
1088
- {
1089
- "name": "PasswordCredential",
1090
- "namespace": "Core",
1091
- "description": "Username/Password based credential",
1092
- "include_in_menu": False,
1093
- "label": "Username / Password",
1094
- "generate_profile": False,
1095
- "branch": BranchSupportType.AGNOSTIC.value,
1096
- "inherit_from": [InfrahubKind.CREDENTIAL],
1097
- "attributes": [
1098
- {
1099
- "name": "username",
1100
- "kind": "Text",
1101
- "optional": True,
1102
- "branch": BranchSupportType.AGNOSTIC.value,
1103
- "order_weight": 6000,
1104
- },
1105
- {
1106
- "name": "password",
1107
- "kind": "Password",
1108
- "optional": True,
1109
- "branch": BranchSupportType.AGNOSTIC.value,
1110
- "order_weight": 7000,
1111
- },
1112
- ],
1113
- },
1114
- {
1115
- "name": "RefreshToken",
1116
- "namespace": "Internal",
1117
- "description": "Refresh Token",
1118
- "include_in_menu": False,
1119
- "label": "Refresh Token",
1120
- "display_labels": [],
1121
- "generate_profile": False,
1122
- "branch": BranchSupportType.AGNOSTIC.value,
1123
- "attributes": [
1124
- {"name": "expiration", "kind": "DateTime", "optional": False},
1125
- ],
1126
- "relationships": [
1127
- {
1128
- "name": "account",
1129
- "peer": InfrahubKind.GENERICACCOUNT,
1130
- "optional": False,
1131
- "cardinality": "one",
1132
- "identifier": "account__refreshtoken",
1133
- },
1134
- ],
1135
- },
1136
- {
1137
- "name": "ProposedChange",
1138
- "namespace": "Core",
1139
- "description": "Metadata related to a proposed change",
1140
- "include_in_menu": False,
1141
- "icon": "mdi:file-replace-outline",
1142
- "label": "Proposed Change",
1143
- "default_filter": "name__value",
1144
- "display_labels": ["name__value"],
1145
- "generate_profile": False,
1146
- "branch": BranchSupportType.AGNOSTIC.value,
1147
- "inherit_from": [InfrahubKind.TASKTARGET],
1148
- "documentation": "/topics/proposed-change",
1149
- "attributes": [
1150
- {"name": "name", "kind": "Text", "optional": False},
1151
- {"name": "description", "kind": "TextArea", "optional": True},
1152
- {"name": "source_branch", "kind": "Text", "optional": False},
1153
- {"name": "destination_branch", "kind": "Text", "optional": False},
1154
- {
1155
- "name": "state",
1156
- "kind": "Text",
1157
- "enum": ProposedChangeState.available_types(),
1158
- "default_value": ProposedChangeState.OPEN.value,
1159
- "optional": True,
1160
- },
1161
- ],
1162
- "relationships": [
1163
- {
1164
- "name": "approved_by",
1165
- "peer": InfrahubKind.GENERICACCOUNT,
1166
- "optional": True,
1167
- "cardinality": "many",
1168
- "kind": "Attribute",
1169
- "branch": BranchSupportType.AGNOSTIC.value,
1170
- "identifier": "coreaccount__proposedchange_approved_by",
1171
- },
1172
- {
1173
- "name": "reviewers",
1174
- "peer": InfrahubKind.GENERICACCOUNT,
1175
- "optional": True,
1176
- "kind": "Attribute",
1177
- "cardinality": "many",
1178
- "branch": BranchSupportType.AGNOSTIC.value,
1179
- "identifier": "coreaccount__proposedchange_reviewed_by",
1180
- },
1181
- {
1182
- "name": "created_by",
1183
- "peer": InfrahubKind.GENERICACCOUNT,
1184
- "optional": True,
1185
- "cardinality": "one",
1186
- "branch": BranchSupportType.AGNOSTIC.value,
1187
- "identifier": "coreaccount__proposedchange_created_by",
1188
- },
1189
- {
1190
- "name": "comments",
1191
- "peer": InfrahubKind.CHANGECOMMENT,
1192
- "kind": "Component",
1193
- "optional": True,
1194
- "cardinality": "many",
1195
- "on_delete": RelationshipDeleteBehavior.CASCADE,
1196
- },
1197
- {
1198
- "name": "threads",
1199
- "peer": InfrahubKind.THREAD,
1200
- "identifier": "proposedchange__thread",
1201
- "kind": "Component",
1202
- "optional": True,
1203
- "cardinality": "many",
1204
- "on_delete": RelationshipDeleteBehavior.CASCADE,
1205
- },
1206
- {
1207
- "name": "validations",
1208
- "peer": InfrahubKind.VALIDATOR,
1209
- "kind": "Component",
1210
- "identifier": "proposed_change__validator",
1211
- "optional": True,
1212
- "cardinality": "many",
1213
- "on_delete": RelationshipDeleteBehavior.CASCADE,
1214
- },
1215
- ],
1216
- },
1217
- {
1218
- "name": "ChangeThread",
1219
- "namespace": "Core",
1220
- "description": "A thread on proposed change",
1221
- "include_in_menu": False,
1222
- "label": "Change Thread",
1223
- "branch": BranchSupportType.AGNOSTIC.value,
1224
- "inherit_from": [InfrahubKind.THREAD],
1225
- "generate_profile": False,
1226
- "attributes": [],
1227
- "relationships": [],
1228
- },
1229
- {
1230
- "name": "FileThread",
1231
- "namespace": "Core",
1232
- "description": "A thread related to a file on a proposed change",
1233
- "include_in_menu": False,
1234
- "label": "Thread - File",
1235
- "branch": BranchSupportType.AGNOSTIC.value,
1236
- "inherit_from": [InfrahubKind.THREAD],
1237
- "generate_profile": False,
1238
- "attributes": [
1239
- {"name": "file", "kind": "Text", "optional": True},
1240
- {"name": "commit", "kind": "Text", "optional": True},
1241
- {"name": "line_number", "kind": "Number", "optional": True},
1242
- ],
1243
- "relationships": [
1244
- {
1245
- "name": "repository",
1246
- "peer": InfrahubKind.REPOSITORY,
1247
- "optional": False,
1248
- "cardinality": "one",
1249
- "branch": BranchSupportType.AGNOSTIC.value,
1250
- },
1251
- ],
1252
- },
1253
- {
1254
- "name": "ArtifactThread",
1255
- "namespace": "Core",
1256
- "description": "A thread related to an artifact on a proposed change",
1257
- "include_in_menu": False,
1258
- "label": "Thread - Artifact",
1259
- "branch": BranchSupportType.AGNOSTIC.value,
1260
- "inherit_from": [InfrahubKind.THREAD],
1261
- "generate_profile": False,
1262
- "attributes": [
1263
- {"name": "artifact_id", "kind": "Text", "optional": True},
1264
- {"name": "storage_id", "kind": "Text", "optional": True},
1265
- {"name": "line_number", "kind": "Number", "optional": True},
1266
- ],
1267
- "relationships": [],
1268
- },
1269
- {
1270
- "name": "ObjectThread",
1271
- "namespace": "Core",
1272
- "description": "A thread related to an object on a proposed change",
1273
- "include_in_menu": False,
1274
- "label": "Thread - Object",
1275
- "branch": BranchSupportType.AGNOSTIC.value,
1276
- "inherit_from": [InfrahubKind.THREAD],
1277
- "generate_profile": False,
1278
- "attributes": [
1279
- {"name": "object_path", "kind": "Text", "optional": False},
1280
- ],
1281
- "relationships": [],
1282
- },
1283
- {
1284
- "name": "ChangeComment",
1285
- "namespace": "Core",
1286
- "description": "A comment on proposed change",
1287
- "include_in_menu": False,
1288
- "label": "Change Comment",
1289
- "default_filter": "text__value",
1290
- "display_labels": ["text__value"],
1291
- "branch": BranchSupportType.AGNOSTIC.value,
1292
- "inherit_from": [InfrahubKind.COMMENT],
1293
- "generate_profile": False,
1294
- "relationships": [
1295
- {
1296
- "name": "change",
1297
- "kind": "Parent",
1298
- "peer": InfrahubKind.PROPOSEDCHANGE,
1299
- "cardinality": "one",
1300
- "optional": False,
1301
- },
1302
- ],
1303
- },
1304
- {
1305
- "name": "ThreadComment",
1306
- "namespace": "Core",
1307
- "description": "A comment on thread within a Proposed Change",
1308
- "include_in_menu": False,
1309
- "label": "Thread Comment",
1310
- "default_filter": "text__value",
1311
- "display_labels": ["text__value"],
1312
- "branch": BranchSupportType.AGNOSTIC.value,
1313
- "inherit_from": [InfrahubKind.COMMENT],
1314
- "generate_profile": False,
1315
- "attributes": [],
1316
- "relationships": [
1317
- {
1318
- "name": "thread",
1319
- "peer": InfrahubKind.THREAD,
1320
- "kind": "Parent",
1321
- "identifier": "thread__threadcomment",
1322
- "cardinality": "one",
1323
- "optional": False,
1324
- },
1325
- ],
1326
- },
1327
- {
1328
- "name": "Repository",
1329
- "namespace": "Core",
1330
- "description": "A Git Repository integrated with Infrahub",
1331
- "include_in_menu": False,
1332
- "icon": "mdi:source-repository",
1333
- "label": "Repository",
1334
- "default_filter": "name__value",
1335
- "order_by": ["name__value"],
1336
- "display_labels": ["name__value"],
1337
- "generate_profile": False,
1338
- "branch": BranchSupportType.AGNOSTIC.value,
1339
- "inherit_from": [
1340
- InfrahubKind.LINEAGEOWNER,
1341
- InfrahubKind.LINEAGESOURCE,
1342
- InfrahubKind.GENERICREPOSITORY,
1343
- InfrahubKind.TASKTARGET,
1344
- ],
1345
- "documentation": "/topics/repository",
1346
- "attributes": [
1347
- {"name": "default_branch", "kind": "Text", "default_value": "main", "order_weight": 6000},
1348
- {
1349
- "name": "commit",
1350
- "kind": "Text",
1351
- "optional": True,
1352
- "branch": BranchSupportType.LOCAL.value,
1353
- "order_weight": 7000,
1354
- },
1355
- ],
1356
- },
1357
- {
1358
- "name": "ReadOnlyRepository",
1359
- "namespace": "Core",
1360
- "description": "A Git Repository integrated with Infrahub, Git-side will not be updated",
1361
- "include_in_menu": False,
1362
- "label": "Read-Only Repository",
1363
- "default_filter": "name__value",
1364
- "order_by": ["name__value"],
1365
- "display_labels": ["name__value"],
1366
- "generate_profile": False,
1367
- "branch": BranchSupportType.AGNOSTIC.value,
1368
- "inherit_from": [
1369
- InfrahubKind.LINEAGEOWNER,
1370
- InfrahubKind.LINEAGESOURCE,
1371
- InfrahubKind.GENERICREPOSITORY,
1372
- InfrahubKind.TASKTARGET,
1373
- ],
1374
- "documentation": "/topics/repository",
1375
- "attributes": [
1376
- {
1377
- "name": "ref",
1378
- "kind": "Text",
1379
- "default_value": "main",
1380
- "branch": BranchSupportType.AWARE.value,
1381
- "order_weight": 6000,
1382
- },
1383
- {
1384
- "name": "commit",
1385
- "kind": "Text",
1386
- "optional": True,
1387
- "branch": BranchSupportType.AWARE.value,
1388
- "order_weight": 7000,
1389
- },
1390
- ],
1391
- },
1392
- {
1393
- "name": "TransformJinja2",
1394
- "namespace": "Core",
1395
- "description": "A file rendered from a Jinja2 template",
1396
- "include_in_menu": False,
1397
- "label": "Transform Jinja2",
1398
- "default_filter": "name__value",
1399
- "order_by": ["name__value"],
1400
- "display_labels": ["name__value"],
1401
- "inherit_from": [InfrahubKind.TRANSFORM],
1402
- "generate_profile": False,
1403
- "branch": BranchSupportType.AWARE.value,
1404
- "documentation": "/topics/transformation",
1405
- "attributes": [
1406
- {"name": "template_path", "kind": "Text"},
1407
- ],
1408
- },
1409
- {
1410
- "name": "DataCheck",
1411
- "namespace": "Core",
1412
- "description": "A check related to some Data",
1413
- "include_in_menu": False,
1414
- "label": "Data Check",
1415
- "display_labels": ["label__value"],
1416
- "inherit_from": ["CoreCheck"],
1417
- "generate_profile": False,
1418
- "branch": BranchSupportType.AGNOSTIC.value,
1419
- "attributes": [
1420
- {"name": "conflicts", "kind": "JSON"},
1421
- {"name": "keep_branch", "enum": BranchConflictKeep.available_types(), "kind": "Text", "optional": True},
1422
- {"name": "enriched_conflict_id", "kind": "Text", "optional": True},
1423
- ],
1424
- },
1425
- {
1426
- "name": "StandardCheck",
1427
- "namespace": "Core",
1428
- "description": "A standard check",
1429
- "include_in_menu": False,
1430
- "label": "Standard Check",
1431
- "display_labels": ["label__value"],
1432
- "inherit_from": ["CoreCheck"],
1433
- "generate_profile": False,
1434
- "branch": BranchSupportType.AGNOSTIC.value,
1435
- },
1436
- {
1437
- "name": "SchemaCheck",
1438
- "namespace": "Core",
1439
- "description": "A check related to the schema",
1440
- "include_in_menu": False,
1441
- "label": "Schema Check",
1442
- "display_labels": ["label__value"],
1443
- "inherit_from": ["CoreCheck"],
1444
- "generate_profile": False,
1445
- "branch": BranchSupportType.AGNOSTIC.value,
1446
- "attributes": [
1447
- {"name": "conflicts", "kind": "JSON"},
1448
- {"name": "enriched_conflict_id", "kind": "Text", "optional": True},
1449
- ],
1450
- },
1451
- {
1452
- "name": "FileCheck",
1453
- "namespace": "Core",
1454
- "description": "A check related to a file in a Git Repository",
1455
- "include_in_menu": False,
1456
- "label": "File Check",
1457
- "display_labels": ["label__value"],
1458
- "inherit_from": ["CoreCheck"],
1459
- "generate_profile": False,
1460
- "branch": BranchSupportType.AGNOSTIC.value,
1461
- "attributes": [
1462
- {"name": "files", "kind": "List", "optional": True},
1463
- {"name": "commit", "kind": "Text", "optional": True},
1464
- ],
1465
- },
1466
- {
1467
- "name": "ArtifactCheck",
1468
- "namespace": "Core",
1469
- "description": "A check related to an artifact",
1470
- "include_in_menu": False,
1471
- "label": "Artifact Check",
1472
- "display_labels": ["label__value"],
1473
- "inherit_from": ["CoreCheck"],
1474
- "generate_profile": False,
1475
- "branch": BranchSupportType.AGNOSTIC.value,
1476
- "attributes": [
1477
- {"name": "changed", "kind": "Boolean", "optional": True},
1478
- {"name": "checksum", "kind": "Text", "optional": True},
1479
- {"name": "artifact_id", "kind": "Text", "optional": True},
1480
- {"name": "storage_id", "kind": "Text", "optional": True},
1481
- {"name": "line_number", "kind": "Number", "optional": True},
1482
- ],
1483
- },
1484
- {
1485
- "name": "GeneratorCheck",
1486
- "namespace": "Core",
1487
- "description": "A check related to a Generator instance",
1488
- "include_in_menu": False,
1489
- "label": "Generator Check",
1490
- "display_labels": ["label__value"],
1491
- "inherit_from": ["CoreCheck"],
1492
- "generate_profile": False,
1493
- "branch": BranchSupportType.AGNOSTIC.value,
1494
- "attributes": [
1495
- {
1496
- "name": "instance",
1497
- "kind": "Text",
1498
- "optional": False,
1499
- },
1500
- ],
1501
- },
1502
- {
1503
- "name": "DataValidator",
1504
- "namespace": "Core",
1505
- "description": "A check to validate the data integrity between two branches",
1506
- "include_in_menu": False,
1507
- "label": "Data Validator",
1508
- "display_labels": ["label__value"],
1509
- "inherit_from": [InfrahubKind.VALIDATOR],
1510
- "generate_profile": False,
1511
- "branch": BranchSupportType.AGNOSTIC.value,
1512
- },
1513
- {
1514
- "name": "RepositoryValidator",
1515
- "namespace": "Core",
1516
- "description": "A Validator related to a specific repository",
1517
- "include_in_menu": False,
1518
- "label": "Repository Validator",
1519
- "display_labels": ["label__value"],
1520
- "inherit_from": [InfrahubKind.VALIDATOR],
1521
- "generate_profile": False,
1522
- "branch": BranchSupportType.AGNOSTIC.value,
1523
- "relationships": [
1524
- {
1525
- "name": "repository",
1526
- "peer": InfrahubKind.GENERICREPOSITORY,
1527
- "kind": "Attribute",
1528
- "optional": False,
1529
- "cardinality": "one",
1530
- "branch": BranchSupportType.AGNOSTIC.value,
1531
- },
1532
- ],
1533
- },
1534
- {
1535
- "name": "UserValidator",
1536
- "namespace": "Core",
1537
- "description": "A Validator related to a user defined checks in a repository",
1538
- "include_in_menu": False,
1539
- "label": "User Validator",
1540
- "display_labels": ["label__value"],
1541
- "inherit_from": [InfrahubKind.VALIDATOR],
1542
- "generate_profile": False,
1543
- "branch": BranchSupportType.AGNOSTIC.value,
1544
- "relationships": [
1545
- {
1546
- "name": "check_definition",
1547
- "peer": InfrahubKind.CHECKDEFINITION,
1548
- "kind": "Attribute",
1549
- "optional": False,
1550
- "cardinality": "one",
1551
- "branch": BranchSupportType.AGNOSTIC.value,
1552
- },
1553
- {
1554
- "name": "repository",
1555
- "peer": InfrahubKind.GENERICREPOSITORY,
1556
- "kind": "Attribute",
1557
- "optional": False,
1558
- "cardinality": "one",
1559
- "branch": BranchSupportType.AGNOSTIC.value,
1560
- },
1561
- ],
1562
- },
1563
- {
1564
- "name": "SchemaValidator",
1565
- "namespace": "Core",
1566
- "description": "A validator related to the schema",
1567
- "include_in_menu": False,
1568
- "label": "Schema Validator",
1569
- "display_labels": ["label__value"],
1570
- "generate_profile": False,
1571
- "inherit_from": [InfrahubKind.VALIDATOR],
1572
- "branch": BranchSupportType.AGNOSTIC.value,
1573
- },
1574
- {
1575
- "name": "ArtifactValidator",
1576
- "namespace": "Core",
1577
- "description": "A validator related to the artifacts",
1578
- "include_in_menu": False,
1579
- "label": "Artifact Validator",
1580
- "display_labels": ["label__value"],
1581
- "inherit_from": [InfrahubKind.VALIDATOR],
1582
- "generate_profile": False,
1583
- "branch": BranchSupportType.AGNOSTIC.value,
1584
- "relationships": [
1585
- {
1586
- "name": "definition",
1587
- "peer": InfrahubKind.ARTIFACTDEFINITION,
1588
- "kind": "Attribute",
1589
- "optional": False,
1590
- "cardinality": "one",
1591
- "branch": BranchSupportType.AGNOSTIC.value,
1592
- },
1593
- ],
1594
- },
1595
- {
1596
- "name": "GeneratorValidator",
1597
- "namespace": "Core",
1598
- "description": "A validator related to generators",
1599
- "include_in_menu": False,
1600
- "label": "Generator Validator",
1601
- "display_labels": ["label__value"],
1602
- "inherit_from": [InfrahubKind.VALIDATOR],
1603
- "generate_profile": False,
1604
- "branch": BranchSupportType.AGNOSTIC.value,
1605
- "relationships": [
1606
- {
1607
- "name": "definition",
1608
- "peer": InfrahubKind.GENERATORDEFINITION,
1609
- "kind": "Attribute",
1610
- "optional": False,
1611
- "cardinality": "one",
1612
- "branch": BranchSupportType.AGNOSTIC.value,
1613
- },
1614
- ],
1615
- },
1616
- {
1617
- "name": "CheckDefinition",
1618
- "namespace": "Core",
1619
- "include_in_menu": False,
1620
- "icon": "mdi:check-all",
1621
- "label": "Check Definition",
1622
- "default_filter": "name__value",
1623
- "order_by": ["name__value"],
1624
- "display_labels": ["name__value"],
1625
- "branch": BranchSupportType.AWARE.value,
1626
- "uniqueness_constraints": [["name__value"]],
1627
- "generate_profile": False,
1628
- "inherit_from": [InfrahubKind.TASKTARGET],
1629
- "attributes": [
1630
- {"name": "name", "kind": "Text", "unique": True},
1631
- {"name": "description", "kind": "Text", "optional": True},
1632
- {"name": "file_path", "kind": "Text"},
1633
- {"name": "class_name", "kind": "Text"},
1634
- {"name": "timeout", "kind": "Number", "default_value": 10},
1635
- {"name": "parameters", "kind": "JSON", "optional": True},
1636
- ],
1637
- "relationships": [
1638
- {
1639
- "name": "repository",
1640
- "peer": InfrahubKind.GENERICREPOSITORY,
1641
- "kind": "Attribute",
1642
- "cardinality": "one",
1643
- "identifier": "check_definition__repository",
1644
- "optional": False,
1645
- },
1646
- {
1647
- "name": "query",
1648
- "peer": InfrahubKind.GRAPHQLQUERY,
1649
- "kind": "Attribute",
1650
- "identifier": "check_definition__graphql_query",
1651
- "cardinality": "one",
1652
- "optional": True,
1653
- },
1654
- {
1655
- "name": "targets",
1656
- "peer": InfrahubKind.GENERICGROUP,
1657
- "kind": "Attribute",
1658
- "identifier": "check_definition___group",
1659
- "cardinality": "one",
1660
- "optional": True,
1661
- },
1662
- {
1663
- "name": "tags",
1664
- "peer": InfrahubKind.TAG,
1665
- "kind": "Attribute",
1666
- "optional": True,
1667
- "cardinality": "many",
1668
- },
1669
- ],
1670
- },
1671
- {
1672
- "name": "TransformPython",
1673
- "namespace": "Core",
1674
- "description": "A transform function written in Python",
1675
- "include_in_menu": False,
1676
- "label": "Transform Python",
1677
- "default_filter": "name__value",
1678
- "order_by": ["name__value"],
1679
- "display_labels": ["name__value"],
1680
- "inherit_from": [InfrahubKind.TRANSFORM],
1681
- "generate_profile": False,
1682
- "branch": BranchSupportType.AWARE.value,
1683
- "documentation": "/topics/transformation",
1684
- "attributes": [
1685
- {"name": "file_path", "kind": "Text"},
1686
- {"name": "class_name", "kind": "Text"},
1687
- ],
1688
- },
1689
- {
1690
- "name": "GraphQLQuery",
1691
- "namespace": "Core",
1692
- "description": "A pre-defined GraphQL Query",
1693
- "include_in_menu": False,
1694
- "icon": "mdi:graphql",
1695
- "label": "GraphQL Query",
1696
- "default_filter": "name__value",
1697
- "order_by": ["name__value"],
1698
- "display_labels": ["name__value"],
1699
- "generate_profile": False,
1700
- "branch": BranchSupportType.AWARE.value,
1701
- "uniqueness_constraints": [["name__value"]],
1702
- "documentation": "/topics/graphql",
1703
- "attributes": [
1704
- {"name": "name", "kind": "Text", "unique": True},
1705
- {"name": "description", "kind": "Text", "optional": True},
1706
- {"name": "query", "kind": "TextArea"},
1707
- {
1708
- "name": "variables",
1709
- "kind": "JSON",
1710
- "description": "variables in use in the query",
1711
- "optional": True,
1712
- "read_only": True,
1713
- },
1714
- {
1715
- "name": "operations",
1716
- "kind": "List",
1717
- "description": "Operations in use in the query, valid operations: 'query', 'mutation' or 'subscription'",
1718
- "read_only": True,
1719
- "optional": True,
1720
- },
1721
- {
1722
- "name": "models",
1723
- "kind": "List",
1724
- "description": "List of models associated with this query",
1725
- "read_only": True,
1726
- "optional": True,
1727
- },
1728
- {
1729
- "name": "depth",
1730
- "kind": "Number",
1731
- "description": "number of nested levels in the query",
1732
- "read_only": True,
1733
- "optional": True,
1734
- },
1735
- {
1736
- "name": "height",
1737
- "kind": "Number",
1738
- "description": "total number of fields requested in the query",
1739
- "read_only": True,
1740
- "optional": True,
1741
- },
1742
- ],
1743
- "relationships": [
1744
- {
1745
- "name": "repository",
1746
- "peer": InfrahubKind.GENERICREPOSITORY,
1747
- "kind": "Attribute",
1748
- "identifier": "graphql_query__repository",
1749
- "cardinality": "one",
1750
- "optional": True,
1751
- },
1752
- {
1753
- "name": "tags",
1754
- "peer": InfrahubKind.TAG,
1755
- "kind": "Attribute",
1756
- "optional": True,
1757
- "cardinality": "many",
1758
- },
1759
- ],
1760
- },
1761
- {
1762
- "name": "Artifact",
1763
- "namespace": "Core",
1764
- "label": "Artifact",
1765
- "include_in_menu": False,
1766
- "icon": "mdi:file-document-outline",
1767
- "default_filter": "name__value",
1768
- "order_by": ["name__value"],
1769
- "display_labels": ["name__value"],
1770
- "branch": BranchSupportType.LOCAL.value,
1771
- "generate_profile": False,
1772
- "inherit_from": [InfrahubKind.TASKTARGET],
1773
- "documentation": "/topics/artifact",
1774
- "attributes": [
1775
- {"name": "name", "kind": "Text"},
1776
- {
1777
- "name": "status",
1778
- "kind": "Text",
1779
- "enum": ArtifactStatus.available_types(),
1780
- },
1781
- {
1782
- "name": "content_type",
1783
- "kind": "Text",
1784
- "enum": ContentType.available_types(),
1785
- },
1786
- {
1787
- "name": "checksum",
1788
- "kind": "Text",
1789
- "optional": True,
1790
- },
1791
- {
1792
- "name": "storage_id",
1793
- "kind": "Text",
1794
- "optional": True,
1795
- "description": "ID of the file in the object store",
1796
- },
1797
- {"name": "parameters", "kind": "JSON", "optional": True},
1798
- ],
1799
- "relationships": [
1800
- {
1801
- "name": "object",
1802
- "peer": InfrahubKind.ARTIFACTTARGET,
1803
- "kind": "Attribute",
1804
- "identifier": "artifact__node",
1805
- "cardinality": "one",
1806
- "optional": False,
1807
- },
1808
- {
1809
- "name": "definition",
1810
- "peer": InfrahubKind.ARTIFACTDEFINITION,
1811
- "kind": "Attribute",
1812
- "identifier": "artifact__artifact_definition",
1813
- "cardinality": "one",
1814
- "optional": False,
1815
- },
1816
- ],
1817
- },
1818
- {
1819
- "name": "ArtifactDefinition",
1820
- "namespace": "Core",
1821
- "include_in_menu": False,
1822
- "icon": "mdi:file-document-multiple-outline",
1823
- "label": "Artifact Definition",
1824
- "default_filter": "name__value",
1825
- "order_by": ["name__value"],
1826
- "display_labels": ["name__value"],
1827
- "branch": BranchSupportType.AWARE.value,
1828
- "generate_profile": False,
1829
- "uniqueness_constraints": [["name__value"]],
1830
- "inherit_from": [InfrahubKind.TASKTARGET],
1831
- "documentation": "/topics/artifact",
1832
- "attributes": [
1833
- {"name": "name", "kind": "Text", "unique": True},
1834
- {"name": "artifact_name", "kind": "Text"},
1835
- {"name": "description", "kind": "Text", "optional": True},
1836
- {"name": "parameters", "kind": "JSON"},
1837
- {
1838
- "name": "content_type",
1839
- "kind": "Text",
1840
- "enum": ContentType.available_types(),
1841
- },
1842
- ],
1843
- "relationships": [
1844
- {
1845
- "name": "targets",
1846
- "peer": InfrahubKind.GENERICGROUP,
1847
- "kind": "Attribute",
1848
- "identifier": "artifact_definition___group",
1849
- "cardinality": "one",
1850
- "optional": False,
1851
- },
1852
- {
1853
- "name": "transformation",
1854
- "peer": InfrahubKind.TRANSFORM,
1855
- "kind": "Attribute",
1856
- "identifier": "artifact_definition___transformation",
1857
- "cardinality": "one",
1858
- "optional": False,
1859
- },
1860
- ],
1861
- },
1862
- {
1863
- "name": "GeneratorDefinition",
1864
- "namespace": "Core",
1865
- "include_in_menu": False,
1866
- "icon": "mdi:state-machine",
1867
- "label": "Generator Definition",
1868
- "default_filter": "name__value",
1869
- "order_by": ["name__value"],
1870
- "display_labels": ["name__value"],
1871
- "branch": BranchSupportType.AWARE.value,
1872
- "uniqueness_constraints": [["name__value"]],
1873
- "generate_profile": False,
1874
- "inherit_from": [InfrahubKind.TASKTARGET],
1875
- "documentation": "/topics/generator",
1876
- "attributes": [
1877
- {"name": "name", "kind": "Text", "unique": True},
1878
- {"name": "description", "kind": "Text", "optional": True},
1879
- {"name": "parameters", "kind": "JSON"},
1880
- {"name": "file_path", "kind": "Text"},
1881
- {"name": "class_name", "kind": "Text"},
1882
- {"name": "convert_query_response", "kind": "Boolean", "optional": True, "default_value": False},
1883
- ],
1884
- "relationships": [
1885
- {
1886
- "name": "query",
1887
- "peer": InfrahubKind.GRAPHQLQUERY,
1888
- "identifier": "generator_definition__graphql_query",
1889
- "kind": "Attribute",
1890
- "cardinality": "one",
1891
- "optional": False,
1892
- },
1893
- {
1894
- "name": "repository",
1895
- "peer": InfrahubKind.GENERICREPOSITORY,
1896
- "kind": "Attribute",
1897
- "cardinality": "one",
1898
- "identifier": "generator_definition__repository",
1899
- "optional": False,
1900
- },
1901
- {
1902
- "name": "targets",
1903
- "peer": InfrahubKind.GENERICGROUP,
1904
- "kind": "Attribute",
1905
- "identifier": "generator_definition___group",
1906
- "cardinality": "one",
1907
- "optional": False,
1908
- },
1909
- ],
1910
- },
1911
- {
1912
- "name": "GeneratorInstance",
1913
- "namespace": "Core",
1914
- "label": "Generator Instance",
1915
- "include_in_menu": False,
1916
- "icon": "mdi:file-document-outline",
1917
- "default_filter": "name__value",
1918
- "order_by": ["name__value"],
1919
- "display_labels": ["name__value"],
1920
- "branch": BranchSupportType.LOCAL.value,
1921
- "generate_profile": False,
1922
- "inherit_from": [InfrahubKind.TASKTARGET],
1923
- "documentation": "/topics/generator",
1924
- "attributes": [
1925
- {"name": "name", "kind": "Text"},
1926
- {
1927
- "name": "status",
1928
- "kind": "Text",
1929
- "enum": GeneratorInstanceStatus.available_types(),
1930
- },
1931
- ],
1932
- "relationships": [
1933
- {
1934
- "name": "object",
1935
- "peer": InfrahubKind.NODE,
1936
- "kind": "Attribute",
1937
- "identifier": "generator__node",
1938
- "cardinality": "one",
1939
- "optional": False,
1940
- },
1941
- {
1942
- "name": "definition",
1943
- "peer": InfrahubKind.GENERATORDEFINITION,
1944
- "kind": "Attribute",
1945
- "identifier": "generator__generator_definition",
1946
- "cardinality": "one",
1947
- "optional": False,
1948
- },
1949
- ],
1950
- },
1951
- {
1952
- "name": "StandardWebhook",
1953
- "namespace": "Core",
1954
- "description": "A webhook that connects to an external integration",
1955
- "label": "Standard Webhook",
1956
- "default_filter": "name__value",
1957
- "order_by": ["name__value"],
1958
- "display_labels": ["name__value"],
1959
- "include_in_menu": False,
1960
- "icon": "mdi:webhook",
1961
- "branch": BranchSupportType.AGNOSTIC.value,
1962
- "generate_profile": False,
1963
- "inherit_from": [InfrahubKind.WEBHOOK, InfrahubKind.TASKTARGET],
1964
- "attributes": [
1965
- {"name": "shared_key", "kind": "Password", "unique": False, "order_weight": 4000},
1966
- ],
1967
- },
1968
- {
1969
- "name": "CustomWebhook",
1970
- "namespace": "Core",
1971
- "description": "A webhook that connects to an external integration",
1972
- "label": "Custom Webhook",
1973
- "default_filter": "name__value",
1974
- "order_by": ["name__value"],
1975
- "display_labels": ["name__value"],
1976
- "include_in_menu": False,
1977
- "icon": "mdi:cog-outline",
1978
- "branch": BranchSupportType.AGNOSTIC.value,
1979
- "generate_profile": False,
1980
- "inherit_from": [InfrahubKind.WEBHOOK, InfrahubKind.TASKTARGET],
1981
- "attributes": [],
1982
- "relationships": [
1983
- {
1984
- "name": "transformation",
1985
- "peer": InfrahubKind.TRANSFORMPYTHON,
1986
- "kind": "Attribute",
1987
- "identifier": "webhook___transformation",
1988
- "cardinality": "one",
1989
- "optional": True,
1990
- "order_weight": 7000,
1991
- },
1992
- ],
1993
- },
1994
- {
1995
- "name": "Namespace",
1996
- "namespace": "Ipam",
1997
- "description": "A namespace that segments IPAM",
1998
- "label": "IPAM Namespace",
1999
- "default_filter": "name__value",
2000
- "human_friendly_id": ["name__value"],
2001
- "order_by": ["name__value"],
2002
- "display_labels": ["name__value"],
2003
- "include_in_menu": False,
2004
- "icon": "mdi:format-list-group",
2005
- "branch": BranchSupportType.AWARE.value,
2006
- "inherit_from": [InfrahubKind.IPNAMESPACE],
2007
- "attributes": [
2008
- {"name": "default", "kind": "Boolean", "optional": True, "read_only": True, "order_weight": 9000}
2009
- ],
2010
- },
2011
- {
2012
- "name": "IPPrefixPool",
2013
- "namespace": "Core",
2014
- "description": "A pool of IP prefix resources",
2015
- "label": "IP Prefix Pool",
2016
- "include_in_menu": False,
2017
- "branch": BranchSupportType.AGNOSTIC.value,
2018
- "generate_profile": False,
2019
- "inherit_from": [InfrahubKind.RESOURCEPOOL, InfrahubKind.LINEAGESOURCE],
2020
- "attributes": [
2021
- {
2022
- "name": "default_prefix_length",
2023
- "kind": "Number",
2024
- "description": "The default prefix length as an integer for prefixes allocated from this pool.",
2025
- "optional": True,
2026
- "order_weight": 5000,
2027
- },
2028
- {
2029
- "name": "default_member_type",
2030
- "kind": "Text",
2031
- "enum": ["prefix", "address"],
2032
- "default_value": "prefix",
2033
- "optional": True,
2034
- "order_weight": 3000,
2035
- },
2036
- {
2037
- "name": "default_prefix_type",
2038
- "kind": "Text",
2039
- "optional": True,
2040
- "order_weight": 4000,
2041
- },
2042
- ],
2043
- "relationships": [
2044
- {
2045
- "name": "resources",
2046
- "peer": "BuiltinIPPrefix",
2047
- "kind": "Attribute",
2048
- "identifier": "prefixpool__resource",
2049
- "cardinality": "many",
2050
- "branch": BranchSupportType.AGNOSTIC.value,
2051
- "optional": False,
2052
- "order_weight": 6000,
2053
- },
2054
- {
2055
- "name": "ip_namespace",
2056
- "peer": "BuiltinIPNamespace",
2057
- "kind": "Attribute",
2058
- "identifier": "prefixpool__ipnamespace",
2059
- "cardinality": "one",
2060
- "branch": BranchSupportType.AGNOSTIC.value,
2061
- "optional": False,
2062
- "order_weight": 7000,
2063
- },
2064
- ],
2065
- },
2066
- {
2067
- "name": "IPAddressPool",
2068
- "namespace": "Core",
2069
- "description": "A pool of IP address resources",
2070
- "label": "IP Address Pool",
2071
- "include_in_menu": False,
2072
- "branch": BranchSupportType.AGNOSTIC.value,
2073
- "generate_profile": False,
2074
- "inherit_from": [InfrahubKind.RESOURCEPOOL, InfrahubKind.LINEAGESOURCE],
2075
- "attributes": [
2076
- {
2077
- "name": "default_address_type",
2078
- "kind": "Text",
2079
- "optional": False,
2080
- "description": "The object type to create when reserving a resource in the pool",
2081
- "order_weight": 3000,
2082
- },
2083
- {
2084
- "name": "default_prefix_length",
2085
- "kind": "Number",
2086
- "description": "The default prefix length as an integer for addresses allocated from this pool.",
2087
- "optional": True,
2088
- "order_weight": 4000,
2089
- },
2090
- ],
2091
- "relationships": [
2092
- {
2093
- "name": "resources",
2094
- "peer": "BuiltinIPPrefix",
2095
- "kind": "Attribute",
2096
- "identifier": "ipaddresspool__resource",
2097
- "cardinality": "many",
2098
- "branch": BranchSupportType.AGNOSTIC.value,
2099
- "optional": False,
2100
- "order_weight": 5000,
2101
- },
2102
- {
2103
- "name": "ip_namespace",
2104
- "peer": "BuiltinIPNamespace",
2105
- "kind": "Attribute",
2106
- "identifier": "ipaddresspool__ipnamespace",
2107
- "cardinality": "one",
2108
- "branch": BranchSupportType.AGNOSTIC.value,
2109
- "optional": False,
2110
- "order_weight": 6000,
2111
- },
2112
- ],
2113
- },
2114
- {
2115
- "name": "NumberPool",
2116
- "namespace": "Core",
2117
- "description": "A pool of number resources",
2118
- "label": "Number Pool",
2119
- "include_in_menu": False,
2120
- "branch": BranchSupportType.AGNOSTIC.value,
2121
- "generate_profile": False,
2122
- "inherit_from": [InfrahubKind.RESOURCEPOOL, InfrahubKind.LINEAGESOURCE],
2123
- "attributes": [
2124
- {
2125
- "name": "node",
2126
- "kind": "Text",
2127
- "optional": False,
2128
- "description": "The model of the object that requires integers to be allocated",
2129
- "order_weight": 3000,
2130
- },
2131
- {
2132
- "name": "node_attribute",
2133
- "kind": "Text",
2134
- "description": "The attribute of the selected model",
2135
- "optional": False,
2136
- "order_weight": 4000,
2137
- },
2138
- {
2139
- "name": "start_range",
2140
- "kind": "Number",
2141
- "optional": False,
2142
- "description": "The start range for the pool",
2143
- "order_weight": 5000,
2144
- },
2145
- {
2146
- "name": "end_range",
2147
- "kind": "Number",
2148
- "optional": False,
2149
- "description": "The end range for the pool",
2150
- "order_weight": 6000,
2151
- },
2152
- ],
2153
- },
2154
- {
2155
- "name": "GlobalPermission",
2156
- "namespace": "Core",
2157
- "description": "A permission that grants global rights to perform actions in Infrahub",
2158
- "label": "Global permission",
2159
- "include_in_menu": False,
2160
- "order_by": ["action__value", "decision__value"],
2161
- "display_labels": ["action__value", "decision__value"],
2162
- "human_friendly_id": ["action__value", "decision__value"],
2163
- "generate_profile": False,
2164
- "inherit_from": [InfrahubKind.BASEPERMISSION],
2165
- "branch": BranchSupportType.AGNOSTIC.value,
2166
- "attributes": [
2167
- {
2168
- "name": "action",
2169
- "kind": "Dropdown",
2170
- "choices": [{"name": permission.value} for permission in GlobalPermissions],
2171
- "order_weight": 2000,
2172
- },
2173
- {
2174
- "name": "decision",
2175
- "kind": "Number",
2176
- "enum": PermissionDecision.available_types(),
2177
- "default_value": PermissionDecision.ALLOW_ALL.value,
2178
- "order_weight": 3000,
2179
- "description": "Decide to deny or allow the action at a global level",
2180
- },
2181
- ],
2182
- },
2183
- {
2184
- "name": "ObjectPermission",
2185
- "namespace": "Core",
2186
- "description": "A permission that grants rights to perform actions on objects",
2187
- "label": "Object permission",
2188
- "include_in_menu": False,
2189
- "order_by": ["namespace__value", "name__value", "action__value", "decision__value"],
2190
- "display_labels": ["namespace__value", "name__value", "action__value", "decision__value"],
2191
- "human_friendly_id": ["namespace__value", "name__value", "action__value", "decision__value"],
2192
- "uniqueness_constraints": [["namespace__value", "name__value", "action__value", "decision__value"]],
2193
- "generate_profile": False,
2194
- "inherit_from": [InfrahubKind.BASEPERMISSION],
2195
- "attributes": [
2196
- {"name": "namespace", "kind": "Text", "order_weight": 2000},
2197
- {"name": "name", "kind": "Text", "order_weight": 3000},
2198
- {
2199
- "name": "action",
2200
- "kind": "Text",
2201
- "enum": PermissionAction.available_types(),
2202
- "default_value": PermissionAction.ANY.value,
2203
- "order_weight": 4000,
2204
- },
2205
- {
2206
- "name": "decision",
2207
- "kind": "Number",
2208
- "enum": PermissionDecision.available_types(),
2209
- "default_value": PermissionDecision.ALLOW_ALL.value,
2210
- "order_weight": 5000,
2211
- "description": (
2212
- "Decide to deny or allow the action. If allowed, it can be configured for the default branch, any other branches or all "
2213
- "branches"
2214
- ),
2215
- },
2216
- ],
2217
- },
2218
- {
2219
- "name": "AccountRole",
2220
- "namespace": "Core",
2221
- "description": "A role defines a set of permissions to grant to a group of accounts",
2222
- "label": "Account role",
2223
- "icon": "mdi:user-badge",
2224
- "include_in_menu": False,
2225
- "order_by": ["name__value"],
2226
- "display_labels": ["name__value"],
2227
- "human_friendly_id": ["name__value"],
2228
- "generate_profile": False,
2229
- "attributes": [{"name": "name", "kind": "Text", "unique": True}],
2230
- "relationships": [
2231
- {
2232
- "name": "groups",
2233
- "peer": InfrahubKind.ACCOUNTGROUP,
2234
- "optional": True,
2235
- "identifier": "role__accountgroups",
2236
- "cardinality": "many",
2237
- "kind": "Attribute",
2238
- },
2239
- {
2240
- "name": "permissions",
2241
- "peer": InfrahubKind.BASEPERMISSION,
2242
- "optional": True,
2243
- "identifier": "role__permissions",
2244
- "cardinality": "many",
2245
- "kind": "Attribute",
2246
- },
2247
- ],
2248
- },
2249
- {
2250
- "name": "AccountGroup",
2251
- "namespace": "Core",
2252
- "description": "A group of users to manage common permissions",
2253
- "label": "Account group",
2254
- "icon": "mdi:account-group",
2255
- "include_in_menu": False,
2256
- "order_by": ["name__value"],
2257
- "display_labels": ["name__value"],
2258
- "human_friendly_id": ["name__value"],
2259
- "generate_profile": False,
2260
- "inherit_from": [InfrahubKind.LINEAGEOWNER, InfrahubKind.LINEAGESOURCE, InfrahubKind.GENERICGROUP],
2261
- "branch": BranchSupportType.AGNOSTIC.value,
2262
- "relationships": [
2263
- {
2264
- "name": "roles",
2265
- "peer": InfrahubKind.ACCOUNTROLE,
2266
- "optional": True,
2267
- "identifier": "role__accountgroups",
2268
- "cardinality": "many",
2269
- "kind": "Attribute",
2270
- }
2271
- ],
2272
- },
2273
- ],
2274
- }