qontract-reconcile 0.10.1rc798__py3-none-any.whl → 0.10.1rc800__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.
- {qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/RECORD +10 -8
- reconcile/cli.py +13 -0
- reconcile/gql_definitions/maintenance/__init__.py +0 -0
- reconcile/gql_definitions/maintenance/maintenances.py +95 -0
- reconcile/gql_definitions/statuspage/statuspages.py +35 -0
- tools/qontract_cli.py +23 -0
- {qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc800
|
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
|
{qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/RECORD
RENAMED
@@ -10,7 +10,7 @@ reconcile/aws_iam_password_reset.py,sha256=NwErtrqgBiXr7eGCAHdtGGOx0S7-4JnSc29Ie
|
|
10
10
|
reconcile/aws_support_cases_sos.py,sha256=Jk6_XjDeJSYxgRGqcEAOcynt9qJF2r5HPIPcSKmoBv8,2974
|
11
11
|
reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=W_VJagnsJR1v5oqjlI3RJJE0_nhtJ0m81RS8zWA5u5c,3538
|
12
12
|
reconcile/checkpoint.py,sha256=R2WFXUXLTB4sWMi4GeA4eegsuf_1-Q4vH8M0Toh3Ij4,5036
|
13
|
-
reconcile/cli.py,sha256
|
13
|
+
reconcile/cli.py,sha256=pBX9_8GU6g4m8Y3-KeX8wOCv9datyVqxvbkXTmgdvNQ,100833
|
14
14
|
reconcile/closedbox_endpoint_monitoring_base.py,sha256=SMhkcQqprWvThrIJa3U_3uh5w1h-alleW1QnCJFY4Qw,4909
|
15
15
|
reconcile/cluster_deployment_mapper.py,sha256=2Ah-nu-Mdig0pjuiZl_XLrmVAjYzFjORR3dMlCgkmw0,2352
|
16
16
|
reconcile/dashdotdb_base.py,sha256=a5aPLVxyqPSbjdB0Ty-uliOtxwvEbbEljHJKxdK3-Zk,4813
|
@@ -315,6 +315,8 @@ reconcile/gql_definitions/jumphosts/jumphosts.py,sha256=gN595lx7K1XsB2AfxDQ911TB
|
|
315
315
|
reconcile/gql_definitions/ldap_groups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
316
316
|
reconcile/gql_definitions/ldap_groups/roles.py,sha256=goGDnkBBFy0mdLsXqL9qlSLPCFd9rwiD1rrsIH-6nZQ,2888
|
317
317
|
reconcile/gql_definitions/ldap_groups/settings.py,sha256=KR6eKqXQWVYZAUEdatL1RCARaTOWl9X-QmxEMVjVNDE,2227
|
318
|
+
reconcile/gql_definitions/maintenance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
319
|
+
reconcile/gql_definitions/maintenance/maintenances.py,sha256=0fTy0SiRjtnSrUwm2qcPtU3RSFJ1ox1eQuC9v8l94dY,2666
|
318
320
|
reconcile/gql_definitions/membershipsources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
319
321
|
reconcile/gql_definitions/membershipsources/roles.py,sha256=d3nv3GLsj_eKgwB1glsiK6smpC4i16WO3dU5rIdRg94,3678
|
320
322
|
reconcile/gql_definitions/ocm_labels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -349,7 +351,7 @@ reconcile/gql_definitions/slo_documents/slo_documents.py,sha256=pOrm9NXAonlo6Lxq
|
|
349
351
|
reconcile/gql_definitions/status_board/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
350
352
|
reconcile/gql_definitions/status_board/status_board.py,sha256=vHEzncabujkqbjJ-ibMYNJTODgTc4DMf4y6TW3I_7II,4700
|
351
353
|
reconcile/gql_definitions/statuspage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
352
|
-
reconcile/gql_definitions/statuspage/statuspages.py,sha256=
|
354
|
+
reconcile/gql_definitions/statuspage/statuspages.py,sha256=RybRGzA8LiQ4yKct_IarI_i_ExQi8Q-jjW5y7J6AZKE,4564
|
353
355
|
reconcile/gql_definitions/templating/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
354
356
|
reconcile/gql_definitions/templating/template_collection.py,sha256=lS0vzEKV2ZrzOqOEriqpy0yBgKjb2Ftrzgx6PIH46_4,3310
|
355
357
|
reconcile/gql_definitions/templating/templates.py,sha256=ejAvQ13zfNMQTz3FWtRUic6dSvio3aAgBKEqt600hbk,2821
|
@@ -764,7 +766,7 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
|
|
764
766
|
tools/app_interface_reporter.py,sha256=upA-J-n-HXHKVDINRuMR7vTt-iJvQORKUVi9D3leQto,17738
|
765
767
|
tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
|
766
768
|
tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
|
767
|
-
tools/qontract_cli.py,sha256=
|
769
|
+
tools/qontract_cli.py,sha256=MtuyVLlAFq9e8cbUqx2uOecXbnG01GVA_hqV79qUiGc,114628
|
768
770
|
tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
|
769
771
|
tools/template_validation.py,sha256=-U-lTGeLaci8yWPEblCJeev2DOlY1jM9QOOh-O1zts8,3376
|
770
772
|
tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -782,8 +784,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
|
|
782
784
|
tools/test/test_qontract_cli.py,sha256=w2l4BHB09k1d-BGJ1jBUNCqDv7zkqYrMHojQXg-21kQ,4155
|
783
785
|
tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
|
784
786
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
785
|
-
qontract_reconcile-0.10.
|
786
|
-
qontract_reconcile-0.10.
|
787
|
-
qontract_reconcile-0.10.
|
788
|
-
qontract_reconcile-0.10.
|
789
|
-
qontract_reconcile-0.10.
|
787
|
+
qontract_reconcile-0.10.1rc800.dist-info/METADATA,sha256=huLB1uwf75yvYhnmLSvCpNBFVHX017JzdMzq1GD1liw,2314
|
788
|
+
qontract_reconcile-0.10.1rc800.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
789
|
+
qontract_reconcile-0.10.1rc800.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
|
790
|
+
qontract_reconcile-0.10.1rc800.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
791
|
+
qontract_reconcile-0.10.1rc800.dist-info/RECORD,,
|
reconcile/cli.py
CHANGED
@@ -36,6 +36,7 @@ from reconcile.utils.runtime.environment import init_env
|
|
36
36
|
from reconcile.utils.runtime.integration import (
|
37
37
|
ModuleArgsKwargsRunParams,
|
38
38
|
ModuleBasedQontractReconcileIntegration,
|
39
|
+
NoParams,
|
39
40
|
PydanticRunParams,
|
40
41
|
QontractReconcileIntegration,
|
41
42
|
)
|
@@ -3184,6 +3185,18 @@ def status_page_components(ctx):
|
|
3184
3185
|
run_class_integration(StatusPageComponentsIntegration(), ctx.obj)
|
3185
3186
|
|
3186
3187
|
|
3188
|
+
@integration.command(
|
3189
|
+
short_help="Manages maintenances on statuspage.io hosted status pages."
|
3190
|
+
)
|
3191
|
+
@click.pass_context
|
3192
|
+
def status_page_maintenances(ctx):
|
3193
|
+
from reconcile.statuspage.integrations.maintenances import (
|
3194
|
+
StatusPageMaintenancesIntegration,
|
3195
|
+
)
|
3196
|
+
|
3197
|
+
run_class_integration(StatusPageMaintenancesIntegration(NoParams()), ctx.obj)
|
3198
|
+
|
3199
|
+
|
3187
3200
|
@integration.command(
|
3188
3201
|
short_help="Manages OCM cluster usergroups and notifications via OCM labels."
|
3189
3202
|
)
|
File without changes
|
@@ -0,0 +1,95 @@
|
|
1
|
+
"""
|
2
|
+
Generated by qenerate plugin=pydantic_v1. DO NOT MODIFY MANUALLY!
|
3
|
+
"""
|
4
|
+
from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
|
5
|
+
from datetime import datetime # noqa: F401 # pylint: disable=W0611
|
6
|
+
from enum import Enum # noqa: F401 # pylint: disable=W0611
|
7
|
+
from typing import ( # noqa: F401 # pylint: disable=W0611
|
8
|
+
Any,
|
9
|
+
Optional,
|
10
|
+
Union,
|
11
|
+
)
|
12
|
+
|
13
|
+
from pydantic import ( # noqa: F401 # pylint: disable=W0611
|
14
|
+
BaseModel,
|
15
|
+
Extra,
|
16
|
+
Field,
|
17
|
+
Json,
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
DEFINITION = """
|
22
|
+
query Maintenances {
|
23
|
+
maintenances: maintenance_v1 {
|
24
|
+
name
|
25
|
+
message
|
26
|
+
scheduledStart
|
27
|
+
scheduledEnd
|
28
|
+
affectedServices {
|
29
|
+
name
|
30
|
+
}
|
31
|
+
announcements {
|
32
|
+
provider
|
33
|
+
... on MaintenanceStatuspageAnnouncement_v1 {
|
34
|
+
page {
|
35
|
+
name
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
"""
|
42
|
+
|
43
|
+
|
44
|
+
class ConfiguredBaseModel(BaseModel):
|
45
|
+
class Config:
|
46
|
+
smart_union=True
|
47
|
+
extra=Extra.forbid
|
48
|
+
|
49
|
+
|
50
|
+
class AppV1(ConfiguredBaseModel):
|
51
|
+
name: str = Field(..., alias="name")
|
52
|
+
|
53
|
+
|
54
|
+
class MaintenanceAnnouncementV1(ConfiguredBaseModel):
|
55
|
+
provider: str = Field(..., alias="provider")
|
56
|
+
|
57
|
+
|
58
|
+
class StatusPageV1(ConfiguredBaseModel):
|
59
|
+
name: str = Field(..., alias="name")
|
60
|
+
|
61
|
+
|
62
|
+
class MaintenanceStatuspageAnnouncementV1(MaintenanceAnnouncementV1):
|
63
|
+
page: StatusPageV1 = Field(..., alias="page")
|
64
|
+
|
65
|
+
|
66
|
+
class MaintenanceV1(ConfiguredBaseModel):
|
67
|
+
name: str = Field(..., alias="name")
|
68
|
+
message: str = Field(..., alias="message")
|
69
|
+
scheduled_start: str = Field(..., alias="scheduledStart")
|
70
|
+
scheduled_end: str = Field(..., alias="scheduledEnd")
|
71
|
+
affected_services: list[AppV1] = Field(..., alias="affectedServices")
|
72
|
+
announcements: Optional[list[Union[MaintenanceStatuspageAnnouncementV1, MaintenanceAnnouncementV1]]] = Field(..., alias="announcements")
|
73
|
+
|
74
|
+
|
75
|
+
class MaintenancesQueryData(ConfiguredBaseModel):
|
76
|
+
maintenances: Optional[list[MaintenanceV1]] = Field(..., alias="maintenances")
|
77
|
+
|
78
|
+
|
79
|
+
def query(query_func: Callable, **kwargs: Any) -> MaintenancesQueryData:
|
80
|
+
"""
|
81
|
+
This is a convenience function which queries and parses the data into
|
82
|
+
concrete types. It should be compatible with most GQL clients.
|
83
|
+
You do not have to use it to consume the generated data classes.
|
84
|
+
Alternatively, you can also mime and alternate the behavior
|
85
|
+
of this function in the caller.
|
86
|
+
|
87
|
+
Parameters:
|
88
|
+
query_func (Callable): Function which queries your GQL Server
|
89
|
+
kwargs: optional arguments that will be passed to the query function
|
90
|
+
|
91
|
+
Returns:
|
92
|
+
MaintenancesQueryData: queried data parsed into generated classes
|
93
|
+
"""
|
94
|
+
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
|
95
|
+
return MaintenancesQueryData(**raw_data)
|
@@ -56,6 +56,20 @@ query StatusPages {
|
|
56
56
|
}
|
57
57
|
}
|
58
58
|
}
|
59
|
+
maintenances {
|
60
|
+
name
|
61
|
+
message
|
62
|
+
scheduledStart
|
63
|
+
scheduledEnd
|
64
|
+
announcements {
|
65
|
+
provider
|
66
|
+
... on MaintenanceStatuspageAnnouncement_v1 {
|
67
|
+
page {
|
68
|
+
name
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
59
73
|
}
|
60
74
|
}
|
61
75
|
"""
|
@@ -95,12 +109,33 @@ class StatusPageComponentV1(ConfiguredBaseModel):
|
|
95
109
|
status_config: Optional[list[Union[ManualStatusProviderV1, StatusProviderV1]]] = Field(..., alias="status_config")
|
96
110
|
|
97
111
|
|
112
|
+
class MaintenanceAnnouncementV1(ConfiguredBaseModel):
|
113
|
+
provider: str = Field(..., alias="provider")
|
114
|
+
|
115
|
+
|
116
|
+
class MaintenanceStatuspageAnnouncementV1_StatusPageV1(ConfiguredBaseModel):
|
117
|
+
name: str = Field(..., alias="name")
|
118
|
+
|
119
|
+
|
120
|
+
class MaintenanceStatuspageAnnouncementV1(MaintenanceAnnouncementV1):
|
121
|
+
page: MaintenanceStatuspageAnnouncementV1_StatusPageV1 = Field(..., alias="page")
|
122
|
+
|
123
|
+
|
124
|
+
class MaintenanceV1(ConfiguredBaseModel):
|
125
|
+
name: str = Field(..., alias="name")
|
126
|
+
message: str = Field(..., alias="message")
|
127
|
+
scheduled_start: str = Field(..., alias="scheduledStart")
|
128
|
+
scheduled_end: str = Field(..., alias="scheduledEnd")
|
129
|
+
announcements: Optional[list[Union[MaintenanceStatuspageAnnouncementV1, MaintenanceAnnouncementV1]]] = Field(..., alias="announcements")
|
130
|
+
|
131
|
+
|
98
132
|
class StatusPageV1(ConfiguredBaseModel):
|
99
133
|
name: str = Field(..., alias="name")
|
100
134
|
page_id: str = Field(..., alias="pageId")
|
101
135
|
api_url: str = Field(..., alias="apiUrl")
|
102
136
|
credentials: VaultSecret = Field(..., alias="credentials")
|
103
137
|
components: Optional[list[StatusPageComponentV1]] = Field(..., alias="components")
|
138
|
+
maintenances: Optional[list[MaintenanceV1]] = Field(..., alias="maintenances")
|
104
139
|
|
105
140
|
|
106
141
|
class StatusPagesQueryData(ConfiguredBaseModel):
|
tools/qontract_cli.py
CHANGED
@@ -66,6 +66,7 @@ from reconcile.gql_definitions.common.app_interface_vault_settings import (
|
|
66
66
|
AppInterfaceSettingsV1,
|
67
67
|
)
|
68
68
|
from reconcile.gql_definitions.fragments.aus_organization import AUSOCMOrganization
|
69
|
+
from reconcile.gql_definitions.maintenance import maintenances as maintenances_gql
|
69
70
|
from reconcile.jenkins_job_builder import init_jjb
|
70
71
|
from reconcile.slack_base import slackapi_from_queries
|
71
72
|
from reconcile.status_board import StatusBoardExporterIntegration
|
@@ -2577,6 +2578,28 @@ def osd_component_versions(ctx):
|
|
2577
2578
|
print_output(ctx.obj["options"], data, columns)
|
2578
2579
|
|
2579
2580
|
|
2581
|
+
@get.command()
|
2582
|
+
@click.pass_context
|
2583
|
+
def maintenances(ctx):
|
2584
|
+
now = datetime.now(timezone.utc)
|
2585
|
+
maintenances = maintenances_gql.query(gql.get_api().query).maintenances or []
|
2586
|
+
data = [
|
2587
|
+
{
|
2588
|
+
**m.dict(),
|
2589
|
+
"services": ", ".join(a.name for a in m.affected_services),
|
2590
|
+
}
|
2591
|
+
for m in maintenances
|
2592
|
+
if datetime.fromisoformat(m.scheduled_end) > now
|
2593
|
+
]
|
2594
|
+
columns = [
|
2595
|
+
"name",
|
2596
|
+
"scheduled_start",
|
2597
|
+
"scheduled_end",
|
2598
|
+
"services",
|
2599
|
+
]
|
2600
|
+
print_output(ctx.obj["options"], data, columns)
|
2601
|
+
|
2602
|
+
|
2580
2603
|
@root.group(name="set")
|
2581
2604
|
@output
|
2582
2605
|
@click.pass_context
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc798.dist-info → qontract_reconcile-0.10.1rc800.dist-info}/top_level.txt
RENAMED
File without changes
|