qontract-reconcile 0.10.1rc782__py3-none-any.whl → 0.10.1rc784__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.1rc782
3
+ Version: 0.10.1rc784
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
@@ -429,7 +429,7 @@ reconcile/skupper_network/models.py,sha256=DNTI7HZv-rqY42GIIxyRuvroHLvdH6rJerjIq
429
429
  reconcile/skupper_network/reconciler.py,sha256=XS-1oKBr_1l3dYUAVqUH6gCHg1G5ZuOfY_7fgGVAiFA,9996
430
430
  reconcile/skupper_network/site_controller.py,sha256=A3K-62BjJ5HiFVydV0ouGoD1NwrO7XhAH15BHAcS9fk,1550
431
431
  reconcile/statuspage/__init__.py,sha256=o9vR6sp3ARDQFZrbCEShelTxjF1XgfLaElK_QVt_248,261
432
- reconcile/statuspage/atlassian.py,sha256=1qKxdnVezGke2R4u0DYFloUq_feeFAH64fAz_aQkfVM,12748
432
+ reconcile/statuspage/atlassian.py,sha256=zXsO9qx_pqfk2TDSoa1JSv6UvY2nVsJAp6rRWuEcG24,13258
433
433
  reconcile/statuspage/integration.py,sha256=---tzyl381RddAkIhXb7n3ySjUhuX7FBBI152SYsRfk,3654
434
434
  reconcile/statuspage/page.py,sha256=cJH2sDA8jiAmSdaDitQqNjkyDq_UP2w3s7eauCi-yt4,3740
435
435
  reconcile/statuspage/state.py,sha256=HD9EOoKm_nEqCMLIwW809En3cq5VhyzKJPUbsh-bae8,1617
@@ -785,8 +785,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
785
785
  tools/test/test_qontract_cli.py,sha256=w2l4BHB09k1d-BGJ1jBUNCqDv7zkqYrMHojQXg-21kQ,4155
786
786
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
787
787
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
788
- qontract_reconcile-0.10.1rc782.dist-info/METADATA,sha256=c2ZGHoKH3dB8loiBCLwbuBbJz7pI-UVr1p7zev44OG8,2382
789
- qontract_reconcile-0.10.1rc782.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
790
- qontract_reconcile-0.10.1rc782.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
791
- qontract_reconcile-0.10.1rc782.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
792
- qontract_reconcile-0.10.1rc782.dist-info/RECORD,,
788
+ qontract_reconcile-0.10.1rc784.dist-info/METADATA,sha256=iirIbkjHkjlb5fv0PhRZw_CL44Hr7n9dtau5yPk4JOM,2382
789
+ qontract_reconcile-0.10.1rc784.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
790
+ qontract_reconcile-0.10.1rc784.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
791
+ qontract_reconcile-0.10.1rc784.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
792
+ qontract_reconcile-0.10.1rc784.dist-info/RECORD,,
@@ -5,6 +5,7 @@ from typing import (
5
5
  Protocol,
6
6
  )
7
7
 
8
+ import requests
8
9
  import statuspageio # type: ignore
9
10
  from pydantic import BaseModel
10
11
 
@@ -64,12 +65,22 @@ class LegacyLibAtlassianAPI:
64
65
  )
65
66
 
66
67
  def list_components(self) -> list[AtlassianRawComponent]:
67
- return [
68
- AtlassianRawComponent(
69
- **c.toDict(),
70
- )
71
- for c in self._client.components.list()
72
- ]
68
+ url = f"{self.api_url}/v1/pages/{self.page_id}/components"
69
+ headers = {"Authorization": f"OAuth {self.token}"}
70
+ all_components: list[AtlassianRawComponent] = []
71
+ page = 1
72
+ per_page = 100
73
+ while True:
74
+ params = {"page": page, "per_page": per_page}
75
+ response = requests.get(url, params=params, headers=headers)
76
+ response.raise_for_status()
77
+ components = [AtlassianRawComponent(**c) for c in response.json()]
78
+ all_components += components
79
+ if len(components) < per_page:
80
+ break
81
+ page += 1
82
+
83
+ return all_components
73
84
 
74
85
  def update_component(self, id: str, data: dict[str, Any]) -> None:
75
86
  self._client.components.update(id, **data)