qontract-reconcile 0.10.1rc887__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.1rc887
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
@@ -10,7 +10,7 @@ reconcile/aws_iam_password_reset.py,sha256=q96mwr2KeEQ5bpNniGlgIMZTxiuLSodcYfX-t
10
10
  reconcile/aws_support_cases_sos.py,sha256=Jk6_XjDeJSYxgRGqcEAOcynt9qJF2r5HPIPcSKmoBv8,2974
11
11
  reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
12
12
  reconcile/checkpoint.py,sha256=_JhMxrye5BgkRMxWYuf7Upli6XayPINKSsuo3ynHTRc,5010
13
- reconcile/cli.py,sha256=6N_nkpjSm4L-q9fxW6CW07Pof1y412R7eQ54z_30vLA,105113
13
+ reconcile/cli.py,sha256=YHpIxOaOuRlpBCXtlbiJR2fRjAMK0_4vJULYnRO9CS4,105636
14
14
  reconcile/closedbox_endpoint_monitoring_base.py,sha256=rLh16BOlBOxTmJ8Si3wWyyEpmMlhh4Znx1Gc36qsmOc,4865
15
15
  reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
16
16
  reconcile/dashdotdb_base.py,sha256=4gJ_VXOOPXPNrJIkSlOr8N1PD60ciZZqSBobNPhXvUA,4768
@@ -179,7 +179,9 @@ reconcile/cna/assets/asset.py,sha256=KWgA4fuDAEGsJwmR52WwK_YgSJMW-1cV2la3lmNf4iE
179
179
  reconcile/cna/assets/asset_factory.py,sha256=7T7X_J6xIsoGETqBRI45_EyIKEdQcnRPt_GAuVuLQcc,785
180
180
  reconcile/cna/assets/null.py,sha256=85mVh97atCoC0aLuX47poTZiyOthmziJeBsUw0c924w,1658
181
181
  reconcile/dynatrace_token_provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
- reconcile/dynatrace_token_provider/integration.py,sha256=Tt3Nayf1TOdizBStXdEaJKfKqlOkJljw22lWlN2GB2s,16518
182
+ reconcile/dynatrace_token_provider/integration.py,sha256=Q7XCnlqoXb4uRsatLciEQlbTSU-HjCRmTd0AHhkxagU,16541
183
+ reconcile/dynatrace_token_provider/integration_v2.py,sha256=Si-hwvGSnC4kVF33-QBZ9FTc4Jfsl_PcESbfl_XmVL8,558
184
+ reconcile/dynatrace_token_provider/meta.py,sha256=f1EdgTS-fuQMUnBmzQFNwvo3Rr9mzNO2R5aOH44oCYg,50
183
185
  reconcile/dynatrace_token_provider/metrics.py,sha256=xiKkl8fTEBQaXJelGCPNTZhHAWdO1M3pCXNr_Tei63c,1285
184
186
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
185
187
  reconcile/external_resources/aws.py,sha256=JvjKaABy2Pg8u8Lq82Acv4zMvpE3_qGKes7OG-zlHOM,2956
@@ -810,7 +812,7 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
810
812
  tools/app_interface_reporter.py,sha256=uy9eRHf6EdvD8ZY2WYdroGXm18DOdnqVZyxaWN3Bm_0,17724
811
813
  tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
812
814
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
813
- tools/qontract_cli.py,sha256=PYFiVIc37qFOl3UxXt04o-V50Leu37pAFndTRMu_WBs,121059
815
+ tools/qontract_cli.py,sha256=rm3Hr02hJT4mqBJIw3qfi2G2TQ0a0xO0CGWYPZMncCQ,122947
814
816
  tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
815
817
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
816
818
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -841,8 +843,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
841
843
  tools/test/test_saas_promotion_state.py,sha256=48Qe5UA5WTI5NVgL7Nz0TSS77osetcijfHNCNdsHfSI,2726
842
844
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
843
845
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
844
- qontract_reconcile-0.10.1rc887.dist-info/METADATA,sha256=hsI7-7-pLKcnuPvfEEaiX0kI_9dg2RVn3ADXezJXa1Q,2273
845
- qontract_reconcile-0.10.1rc887.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
846
- qontract_reconcile-0.10.1rc887.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
847
- qontract_reconcile-0.10.1rc887.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
848
- qontract_reconcile-0.10.1rc887.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,,
reconcile/cli.py CHANGED
@@ -3045,8 +3045,25 @@ def dynatrace_token_provider(ctx, ocm_org_ids):
3045
3045
  DynatraceTokenProviderIntegration,
3046
3046
  DynatraceTokenProviderIntegrationParams,
3047
3047
  )
3048
+ from reconcile.dynatrace_token_provider.integration_v2 import (
3049
+ DynatraceTokenProviderIntegrationParamsV2,
3050
+ DynatraceTokenProviderIntegrationV2,
3051
+ )
3048
3052
 
3049
3053
  parsed_ocm_org_ids = set(ocm_org_ids.split(",")) if ocm_org_ids else None
3054
+
3055
+ # We will remove V1 once migrations towards new token declaration is done
3056
+ # Run V2
3057
+ run_class_integration(
3058
+ integration=DynatraceTokenProviderIntegrationV2(
3059
+ DynatraceTokenProviderIntegrationParamsV2(
3060
+ ocm_organization_ids=parsed_ocm_org_ids
3061
+ )
3062
+ ),
3063
+ ctx=ctx.obj,
3064
+ )
3065
+
3066
+ # Run V1
3050
3067
  run_class_integration(
3051
3068
  integration=DynatraceTokenProviderIntegration(
3052
3069
  DynatraceTokenProviderIntegrationParams(
@@ -8,6 +8,7 @@ from typing import Any
8
8
  from dynatrace import Dynatrace
9
9
  from dynatrace.environment_v2.tokens_api import ApiTokenCreated
10
10
 
11
+ from reconcile.dynatrace_token_provider.meta import QONTRACT_INTEGRATION
11
12
  from reconcile.dynatrace_token_provider.metrics import (
12
13
  DTPClustersManagedGauge,
13
14
  DTPOrganizationErrorRate,
@@ -52,7 +53,6 @@ from reconcile.utils.runtime.integration import (
52
53
  )
53
54
  from reconcile.utils.secret_reader import SecretReaderBase
54
55
 
55
- QONTRACT_INTEGRATION = "dynatrace-token-provider"
56
56
  SYNCSET_ID = "ext-dynatrace-tokens-dtp"
57
57
  SECRET_NAME = "dynatrace-token-dtp"
58
58
  SECRET_NAMESPACE = "dynatrace"
@@ -0,0 +1,20 @@
1
+ from reconcile.dynatrace_token_provider.meta import QONTRACT_INTEGRATION
2
+ from reconcile.utils.runtime.integration import (
3
+ PydanticRunParams,
4
+ QontractReconcileIntegration,
5
+ )
6
+
7
+
8
+ class DynatraceTokenProviderIntegrationParamsV2(PydanticRunParams):
9
+ ocm_organization_ids: set[str] | None = None
10
+
11
+
12
+ class DynatraceTokenProviderIntegrationV2(
13
+ QontractReconcileIntegration[DynatraceTokenProviderIntegrationParamsV2]
14
+ ):
15
+ @property
16
+ def name(self) -> str:
17
+ return QONTRACT_INTEGRATION
18
+
19
+ def run(self, dry_run: bool) -> None:
20
+ pass
@@ -0,0 +1 @@
1
+ QONTRACT_INTEGRATION = "dynatrace-token-provider"
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