qontract-reconcile 0.10.1rc900__py3-none-any.whl → 0.10.1rc901__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.1rc900
3
+ Version: 0.10.1rc901
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
@@ -765,9 +765,9 @@ reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=ojnIjw-8vRnmCCxOG
765
765
  reconcile/utils/mr/user_maintenance.py,sha256=cHPBn8zrReWLHalyk-EFdkFJe9zjVjRoZhT4t2zZfGE,3956
766
766
  reconcile/utils/ocm/__init__.py,sha256=xv7CJp7K9LCQfa4gL_W0MMCOD1P4qOy8t5aZj1xXNUE,808
767
767
  reconcile/utils/ocm/addons.py,sha256=_LDdJ-gapM3s5exKlIUt-MlXZTAUoHezbYBU0QmvfWQ,7335
768
- reconcile/utils/ocm/base.py,sha256=WcRklW-zVOQ7JiYGbrqI9i3UYN7-A-V23bahAG1OVRo,13951
768
+ reconcile/utils/ocm/base.py,sha256=IF-TOj9YqDBfuXRMAxCZ8xFTNsgLQdsAxCtIk4UjH4E,14457
769
769
  reconcile/utils/ocm/cluster_groups.py,sha256=F8oqVqN_4QUnGL0K61zZhoYIzJeP57EcmZpwmoV0mr4,1751
770
- reconcile/utils/ocm/clusters.py,sha256=gfZgOVg5V74D2xpng_bWmZE5OVJYwJLBSTUZyiOjTV0,7616
770
+ reconcile/utils/ocm/clusters.py,sha256=Fn4swizm1qq-XiNlIZ9SvahkftWAyNT8hF4kqRBpK4g,8287
771
771
  reconcile/utils/ocm/identity_providers.py,sha256=dKed09N8iWmn39tI_MpwgVe47x23eLsknGbjMUxtwr4,2175
772
772
  reconcile/utils/ocm/label_sources.py,sha256=ES_5VP4X6gsRxMFZ95WgbwE_HqqIUo_JRjHjdGYw6Ss,1846
773
773
  reconcile/utils/ocm/labels.py,sha256=aCsL5QkRk32hZeJwsSJuCCT9sbojWMn8LL5Zo-aoFb4,5916
@@ -844,8 +844,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
844
844
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
845
845
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
846
846
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
847
- qontract_reconcile-0.10.1rc900.dist-info/METADATA,sha256=SoW0nnbOZ_8OcmOORa7MDS0ADopOm48NgSuuxPlINHk,2273
848
- qontract_reconcile-0.10.1rc900.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
- qontract_reconcile-0.10.1rc900.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
- qontract_reconcile-0.10.1rc900.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
- qontract_reconcile-0.10.1rc900.dist-info/RECORD,,
847
+ qontract_reconcile-0.10.1rc901.dist-info/METADATA,sha256=ajNH3FKyAgiAEU36s_fRqlubaWQuOpyApTeND5vKlYw,2273
848
+ qontract_reconcile-0.10.1rc901.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
+ qontract_reconcile-0.10.1rc901.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
+ qontract_reconcile-0.10.1rc901.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
+ qontract_reconcile-0.10.1rc901.dist-info/RECORD,,
@@ -210,6 +210,27 @@ PRODUCT_ID_OSD = "osd"
210
210
  PRODUCT_ID_ROSA = "rosa"
211
211
 
212
212
 
213
+ class ProvisionShard(BaseModel):
214
+ kind: str = "ProvisionShard"
215
+ id: str
216
+
217
+
218
+ class ClusterManagementReference(BaseModel):
219
+ cluster_id: str
220
+ href: str
221
+
222
+
223
+ class FleetManagerServiceCluster(BaseModel):
224
+ kind: str = "ServiceCluster"
225
+
226
+ """
227
+ Using OSDFleetManager API, which has different object ids.
228
+ https://api.openshift.com/?urls.primaryName=OSD%20Fleet%20Manager%20service
229
+ """
230
+ cluster_management_reference: ClusterManagementReference
231
+ provision_shard_reference: OCMModelLink
232
+
233
+
213
234
  class OCMCluster(BaseModel):
214
235
  kind: str = "Cluster"
215
236
  id: str
@@ -11,10 +11,12 @@ from reconcile.utils.ocm.base import (
11
11
  PRODUCT_ID_OSD,
12
12
  PRODUCT_ID_ROSA,
13
13
  ClusterDetails,
14
+ FleetManagerServiceCluster,
14
15
  OCMCluster,
15
16
  OCMClusterState,
16
17
  OCMOrganizationLabel,
17
18
  OCMSubscriptionLabel,
19
+ ProvisionShard,
18
20
  build_label_container,
19
21
  )
20
22
  from reconcile.utils.ocm.labels import (
@@ -146,6 +148,26 @@ def get_ocm_clusters(
146
148
  yield OCMCluster(**cluster_dict)
147
149
 
148
150
 
151
+ def get_provision_shard_for_cluster_id(
152
+ ocm_api: OCMBaseClient,
153
+ id: str,
154
+ ) -> ProvisionShard:
155
+ data = ocm_api.get(api_path=f"/api/clusters_mgmt/v1/clusters/{id}/provision_shard")
156
+ return ProvisionShard(**data)
157
+
158
+
159
+ def get_service_clusters(
160
+ ocm_api: OCMBaseClient,
161
+ ) -> Generator[FleetManagerServiceCluster, None, None]:
162
+ for cluster_dict in ocm_api.get_paginated(
163
+ api_path="/api/osd_fleet_mgmt/v1/service_clusters",
164
+ max_page_size=100,
165
+ ):
166
+ if not cluster_dict.get("provision_shard_reference"):
167
+ continue
168
+ yield FleetManagerServiceCluster(**cluster_dict)
169
+
170
+
149
171
  def get_cluster_details_for_subscriptions(
150
172
  ocm_api: OCMBaseClient,
151
173
  subscription_filter: Filter | None = None,