qontract-reconcile 0.10.1rc888__py3-none-any.whl → 0.10.1rc889__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc888
3
+ Version: 0.10.1rc889
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -812,7 +812,7 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
812
812
  tools/app_interface_reporter.py,sha256=uy9eRHf6EdvD8ZY2WYdroGXm18DOdnqVZyxaWN3Bm_0,17724
813
813
  tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
814
814
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
815
- tools/qontract_cli.py,sha256=PYFiVIc37qFOl3UxXt04o-V50Leu37pAFndTRMu_WBs,121059
815
+ tools/qontract_cli.py,sha256=rm3Hr02hJT4mqBJIw3qfi2G2TQ0a0xO0CGWYPZMncCQ,122947
816
816
  tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
817
817
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
818
818
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -843,8 +843,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
843
843
  tools/test/test_saas_promotion_state.py,sha256=48Qe5UA5WTI5NVgL7Nz0TSS77osetcijfHNCNdsHfSI,2726
844
844
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
845
845
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
846
- qontract_reconcile-0.10.1rc888.dist-info/METADATA,sha256=Jdlu3njSekBAi5WRIsJmrYWirEt8p6xfH9Iz73XPjK8,2273
847
- qontract_reconcile-0.10.1rc888.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
848
- qontract_reconcile-0.10.1rc888.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
849
- qontract_reconcile-0.10.1rc888.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
850
- qontract_reconcile-0.10.1rc888.dist-info/RECORD,,
846
+ qontract_reconcile-0.10.1rc889.dist-info/METADATA,sha256=6mFOXr_MkHFuKSqB3aKVOJP0Qi8ju9uRTqZGxCw0pZk,2273
847
+ qontract_reconcile-0.10.1rc889.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
848
+ qontract_reconcile-0.10.1rc889.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
849
+ qontract_reconcile-0.10.1rc889.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
850
+ qontract_reconcile-0.10.1rc889.dist-info/RECORD,,
tools/qontract_cli.py CHANGED
@@ -56,6 +56,14 @@ from reconcile.cli import (
56
56
  config_file,
57
57
  use_jump_host,
58
58
  )
59
+ from reconcile.external_resources.manager import (
60
+ FLAG_RESOURCE_MANAGED_BY_ERV2,
61
+ setup_factories,
62
+ )
63
+ from reconcile.external_resources.model import (
64
+ ExternalResourcesInventory,
65
+ load_module_inventory,
66
+ )
59
67
  from reconcile.gql_definitions.advanced_upgrade_service.aus_clusters import (
60
68
  query as aus_clusters_query,
61
69
  )
@@ -72,6 +80,11 @@ from reconcile.typed_queries.app_interface_vault_settings import (
72
80
  get_app_interface_vault_settings,
73
81
  )
74
82
  from reconcile.typed_queries.clusters import get_clusters
83
+ from reconcile.typed_queries.external_resources import (
84
+ get_modules,
85
+ get_namespaces,
86
+ get_settings,
87
+ )
75
88
  from reconcile.typed_queries.saas_files import get_saas_files
76
89
  from reconcile.typed_queries.slo_documents import get_slo_documents
77
90
  from reconcile.typed_queries.status_board import get_status_board
@@ -3784,5 +3797,45 @@ def remove(ctx, sso_client_vault_secret_path: str):
3784
3797
  )
3785
3798
 
3786
3799
 
3800
+ @root.group()
3801
+ @click.pass_context
3802
+ def external_resources(ctx):
3803
+ """External resources commands"""
3804
+
3805
+
3806
+ @external_resources.command()
3807
+ @click.argument("provision-provider", required=True)
3808
+ @click.argument("provisioner", required=True)
3809
+ @click.argument("provider", required=True)
3810
+ @click.argument("identifier", required=True)
3811
+ @click.pass_context
3812
+ def get_input(
3813
+ ctx, provision_provider: str, provisioner: str, provider: str, identifier: str
3814
+ ):
3815
+ """Gets the input data for an external resource asset. Input data is what is used
3816
+ in the Reconciliation Job to manage the resource.
3817
+
3818
+ e.g: qontract-reconcile --config=<config> external-resources get-input aws app-sre-stage rds dashdotdb-stage
3819
+ """
3820
+ namespaces = [ns for ns in get_namespaces() if ns.external_resources]
3821
+ er_inventory = ExternalResourcesInventory(namespaces)
3822
+
3823
+ spec = er_inventory.get_inventory_spec(
3824
+ provision_provider=provision_provider,
3825
+ provisioner=provisioner,
3826
+ provider=provider,
3827
+ identifier=identifier,
3828
+ )
3829
+ vault_settings = get_app_interface_vault_settings()
3830
+ secret_reader = create_secret_reader(use_vault=vault_settings.vault)
3831
+ er_settings = get_settings()[0]
3832
+ m_inventory = load_module_inventory(get_modules())
3833
+ factories = setup_factories(er_settings, m_inventory, er_inventory, secret_reader)
3834
+ f = factories.get_factory(spec.provision_provider)
3835
+ resource = f.create_external_resource(spec)
3836
+ f.validate_external_resource(resource)
3837
+ print(resource.json(exclude={"data": {FLAG_RESOURCE_MANAGED_BY_ERV2}}))
3838
+
3839
+
3787
3840
  if __name__ == "__main__":
3788
3841
  root() # pylint: disable=no-value-for-parameter