qontract-reconcile 0.10.2.dev159__py3-none-any.whl → 0.10.2.dev173__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.2.dev159.dist-info → qontract_reconcile-0.10.2.dev173.dist-info}/METADATA +2 -2
- {qontract_reconcile-0.10.2.dev159.dist-info → qontract_reconcile-0.10.2.dev173.dist-info}/RECORD +34 -24
- reconcile/acs_rbac.py +1 -0
- reconcile/aws_cloudwatch_log_retention/integration.py +39 -25
- reconcile/cli.py +4 -6
- reconcile/dashdotdb_slo.py +45 -156
- reconcile/gcp_image_mirror.py +252 -0
- reconcile/gitlab_housekeeping.py +1 -1
- reconcile/gql_definitions/aws_cloudwatch_log_retention/__init__.py +0 -0
- reconcile/gql_definitions/aws_cloudwatch_log_retention/aws_accounts.py +158 -0
- reconcile/gql_definitions/common/saas_files.py +49 -0
- reconcile/gql_definitions/dashdotdb_slo/slo_documents_query.py +15 -67
- reconcile/gql_definitions/fragments/container_image_mirror.py +33 -0
- reconcile/gql_definitions/fragments/saas_slo_document.py +82 -0
- reconcile/gql_definitions/gcp/__init__.py +0 -0
- reconcile/gql_definitions/gcp/gcp_docker_repos.py +128 -0
- reconcile/gql_definitions/gcp/gcp_projects.py +77 -0
- reconcile/gql_definitions/introspection.json +380 -230
- reconcile/quay_mirror.py +3 -42
- reconcile/quay_mirror_org.py +3 -2
- reconcile/slack_base.py +2 -2
- reconcile/typed_queries/aws_cloudwatch_log_retention/aws_accounts.py +12 -0
- reconcile/utils/dynatrace/client.py +0 -31
- reconcile/utils/quay_mirror.py +42 -0
- reconcile/utils/saasherder/interfaces.py +2 -0
- reconcile/utils/saasherder/saasherder.py +5 -0
- reconcile/utils/slack_api.py +3 -1
- reconcile/utils/slo_document_manager.py +278 -0
- reconcile/utils/terrascript_aws_client.py +57 -0
- tools/{sd_app_sre_alert_report.py → alert_report.py} +1 -1
- tools/cli_commands/erv2.py +61 -0
- tools/qontract_cli.py +15 -5
- reconcile/gcr_mirror.py +0 -278
- {qontract_reconcile-0.10.2.dev159.dist-info → qontract_reconcile-0.10.2.dev173.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev159.dist-info → qontract_reconcile-0.10.2.dev173.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,82 @@
|
|
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
|
+
from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
|
21
|
+
|
22
|
+
|
23
|
+
class ConfiguredBaseModel(BaseModel):
|
24
|
+
class Config:
|
25
|
+
smart_union=True
|
26
|
+
extra=Extra.forbid
|
27
|
+
|
28
|
+
|
29
|
+
class SLOExternalPrometheusAccessV1(ConfiguredBaseModel):
|
30
|
+
url: str = Field(..., alias="url")
|
31
|
+
username: Optional[VaultSecret] = Field(..., alias="username")
|
32
|
+
password: Optional[VaultSecret] = Field(..., alias="password")
|
33
|
+
|
34
|
+
|
35
|
+
class AppV1(ConfiguredBaseModel):
|
36
|
+
name: str = Field(..., alias="name")
|
37
|
+
|
38
|
+
|
39
|
+
class ClusterSpecV1(ConfiguredBaseModel):
|
40
|
+
private: bool = Field(..., alias="private")
|
41
|
+
|
42
|
+
|
43
|
+
class ClusterV1(ConfiguredBaseModel):
|
44
|
+
name: str = Field(..., alias="name")
|
45
|
+
automation_token: Optional[VaultSecret] = Field(..., alias="automationToken")
|
46
|
+
prometheus_url: str = Field(..., alias="prometheusUrl")
|
47
|
+
spec: Optional[ClusterSpecV1] = Field(..., alias="spec")
|
48
|
+
|
49
|
+
|
50
|
+
class NamespaceV1(ConfiguredBaseModel):
|
51
|
+
name: str = Field(..., alias="name")
|
52
|
+
app: AppV1 = Field(..., alias="app")
|
53
|
+
cluster: ClusterV1 = Field(..., alias="cluster")
|
54
|
+
|
55
|
+
|
56
|
+
class SLONamespacesV1_NamespaceV1(ConfiguredBaseModel):
|
57
|
+
name: str = Field(..., alias="name")
|
58
|
+
|
59
|
+
|
60
|
+
class SLONamespacesV1(ConfiguredBaseModel):
|
61
|
+
prometheus_access: Optional[SLOExternalPrometheusAccessV1] = Field(..., alias="prometheusAccess")
|
62
|
+
namespace: NamespaceV1 = Field(..., alias="namespace")
|
63
|
+
slo_namespace: Optional[SLONamespacesV1_NamespaceV1] = Field(..., alias="SLONamespace")
|
64
|
+
|
65
|
+
|
66
|
+
class SLODocumentSLOSLOParametersV1(ConfiguredBaseModel):
|
67
|
+
window: str = Field(..., alias="window")
|
68
|
+
|
69
|
+
|
70
|
+
class SLODocumentSLOV1(ConfiguredBaseModel):
|
71
|
+
name: str = Field(..., alias="name")
|
72
|
+
expr: str = Field(..., alias="expr")
|
73
|
+
sli_type: str = Field(..., alias="SLIType")
|
74
|
+
slo_parameters: SLODocumentSLOSLOParametersV1 = Field(..., alias="SLOParameters")
|
75
|
+
slo_target: float = Field(..., alias="SLOTarget")
|
76
|
+
slo_target_unit: str = Field(..., alias="SLOTargetUnit")
|
77
|
+
|
78
|
+
|
79
|
+
class SLODocument(ConfiguredBaseModel):
|
80
|
+
name: str = Field(..., alias="name")
|
81
|
+
namespaces: list[SLONamespacesV1] = Field(..., alias="namespaces")
|
82
|
+
slos: Optional[list[SLODocumentSLOV1]] = Field(..., alias="slos")
|
File without changes
|
@@ -0,0 +1,128 @@
|
|
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
|
+
from reconcile.gql_definitions.fragments.container_image_mirror import ContainerImageMirror
|
21
|
+
|
22
|
+
|
23
|
+
DEFINITION = """
|
24
|
+
fragment ContainerImageMirror on ContainerImageMirror_v1 {
|
25
|
+
url
|
26
|
+
pullCredentials {
|
27
|
+
...VaultSecret
|
28
|
+
}
|
29
|
+
tags
|
30
|
+
tagsExclude
|
31
|
+
}
|
32
|
+
|
33
|
+
fragment VaultSecret on VaultSecret_v1 {
|
34
|
+
path
|
35
|
+
field
|
36
|
+
version
|
37
|
+
format
|
38
|
+
}
|
39
|
+
|
40
|
+
query GcpDockerRepos {
|
41
|
+
apps: apps_v1 {
|
42
|
+
gcrRepos {
|
43
|
+
project {
|
44
|
+
name
|
45
|
+
}
|
46
|
+
items {
|
47
|
+
name
|
48
|
+
mirror {
|
49
|
+
...ContainerImageMirror
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
artifactRegistryMirrors {
|
54
|
+
project {
|
55
|
+
name
|
56
|
+
}
|
57
|
+
items {
|
58
|
+
imageURL
|
59
|
+
mirror {
|
60
|
+
...ContainerImageMirror
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
"""
|
67
|
+
|
68
|
+
|
69
|
+
class ConfiguredBaseModel(BaseModel):
|
70
|
+
class Config:
|
71
|
+
smart_union=True
|
72
|
+
extra=Extra.forbid
|
73
|
+
|
74
|
+
|
75
|
+
class GcpProjectV1(ConfiguredBaseModel):
|
76
|
+
name: str = Field(..., alias="name")
|
77
|
+
|
78
|
+
|
79
|
+
class AppGcrReposItemsV1(ConfiguredBaseModel):
|
80
|
+
name: str = Field(..., alias="name")
|
81
|
+
mirror: Optional[ContainerImageMirror] = Field(..., alias="mirror")
|
82
|
+
|
83
|
+
|
84
|
+
class AppGcrReposV1(ConfiguredBaseModel):
|
85
|
+
project: GcpProjectV1 = Field(..., alias="project")
|
86
|
+
items: list[AppGcrReposItemsV1] = Field(..., alias="items")
|
87
|
+
|
88
|
+
|
89
|
+
class AppArtifactRegistryMirrorsV1_GcpProjectV1(ConfiguredBaseModel):
|
90
|
+
name: str = Field(..., alias="name")
|
91
|
+
|
92
|
+
|
93
|
+
class AppArtifactRegistryMirrorsItemsV1(ConfiguredBaseModel):
|
94
|
+
image_url: str = Field(..., alias="imageURL")
|
95
|
+
mirror: ContainerImageMirror = Field(..., alias="mirror")
|
96
|
+
|
97
|
+
|
98
|
+
class AppArtifactRegistryMirrorsV1(ConfiguredBaseModel):
|
99
|
+
project: AppArtifactRegistryMirrorsV1_GcpProjectV1 = Field(..., alias="project")
|
100
|
+
items: list[AppArtifactRegistryMirrorsItemsV1] = Field(..., alias="items")
|
101
|
+
|
102
|
+
|
103
|
+
class AppV1(ConfiguredBaseModel):
|
104
|
+
gcr_repos: Optional[list[AppGcrReposV1]] = Field(..., alias="gcrRepos")
|
105
|
+
artifact_registry_mirrors: Optional[list[AppArtifactRegistryMirrorsV1]] = Field(..., alias="artifactRegistryMirrors")
|
106
|
+
|
107
|
+
|
108
|
+
class GcpDockerReposQueryData(ConfiguredBaseModel):
|
109
|
+
apps: Optional[list[AppV1]] = Field(..., alias="apps")
|
110
|
+
|
111
|
+
|
112
|
+
def query(query_func: Callable, **kwargs: Any) -> GcpDockerReposQueryData:
|
113
|
+
"""
|
114
|
+
This is a convenience function which queries and parses the data into
|
115
|
+
concrete types. It should be compatible with most GQL clients.
|
116
|
+
You do not have to use it to consume the generated data classes.
|
117
|
+
Alternatively, you can also mime and alternate the behavior
|
118
|
+
of this function in the caller.
|
119
|
+
|
120
|
+
Parameters:
|
121
|
+
query_func (Callable): Function which queries your GQL Server
|
122
|
+
kwargs: optional arguments that will be passed to the query function
|
123
|
+
|
124
|
+
Returns:
|
125
|
+
GcpDockerReposQueryData: queried data parsed into generated classes
|
126
|
+
"""
|
127
|
+
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
|
128
|
+
return GcpDockerReposQueryData(**raw_data)
|
@@ -0,0 +1,77 @@
|
|
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
|
+
from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
|
21
|
+
|
22
|
+
|
23
|
+
DEFINITION = """
|
24
|
+
fragment VaultSecret on VaultSecret_v1 {
|
25
|
+
path
|
26
|
+
field
|
27
|
+
version
|
28
|
+
format
|
29
|
+
}
|
30
|
+
|
31
|
+
query GcpProjects {
|
32
|
+
gcp_projects: gcp_projects_v1 {
|
33
|
+
name
|
34
|
+
gcrPushCredentials {
|
35
|
+
...VaultSecret
|
36
|
+
}
|
37
|
+
artifactPushCredentials {
|
38
|
+
...VaultSecret
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
"""
|
43
|
+
|
44
|
+
|
45
|
+
class ConfiguredBaseModel(BaseModel):
|
46
|
+
class Config:
|
47
|
+
smart_union=True
|
48
|
+
extra=Extra.forbid
|
49
|
+
|
50
|
+
|
51
|
+
class GcpProjectV1(ConfiguredBaseModel):
|
52
|
+
name: str = Field(..., alias="name")
|
53
|
+
gcr_push_credentials: Optional[VaultSecret] = Field(..., alias="gcrPushCredentials")
|
54
|
+
artifact_push_credentials: VaultSecret = Field(..., alias="artifactPushCredentials")
|
55
|
+
|
56
|
+
|
57
|
+
class GcpProjectsQueryData(ConfiguredBaseModel):
|
58
|
+
gcp_projects: Optional[list[GcpProjectV1]] = Field(..., alias="gcp_projects")
|
59
|
+
|
60
|
+
|
61
|
+
def query(query_func: Callable, **kwargs: Any) -> GcpProjectsQueryData:
|
62
|
+
"""
|
63
|
+
This is a convenience function which queries and parses the data into
|
64
|
+
concrete types. It should be compatible with most GQL clients.
|
65
|
+
You do not have to use it to consume the generated data classes.
|
66
|
+
Alternatively, you can also mime and alternate the behavior
|
67
|
+
of this function in the caller.
|
68
|
+
|
69
|
+
Parameters:
|
70
|
+
query_func (Callable): Function which queries your GQL Server
|
71
|
+
kwargs: optional arguments that will be passed to the query function
|
72
|
+
|
73
|
+
Returns:
|
74
|
+
GcpProjectsQueryData: queried data parsed into generated classes
|
75
|
+
"""
|
76
|
+
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
|
77
|
+
return GcpProjectsQueryData(**raw_data)
|