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