qontract-reconcile 0.10.1rc838__py3-none-any.whl → 0.10.1rc840__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.1rc838.dist-info → qontract_reconcile-0.10.1rc840.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc838.dist-info → qontract_reconcile-0.10.1rc840.dist-info}/RECORD +48 -34
- reconcile/gql_definitions/advanced_upgrade_service/aus_clusters.py +1 -0
- reconcile/gql_definitions/advanced_upgrade_service/aus_organization.py +1 -0
- reconcile/gql_definitions/aws_saml_idp/aws_accounts.py +1 -0
- reconcile/gql_definitions/aws_saml_roles/aws_accounts.py +1 -0
- reconcile/gql_definitions/cluster_auth_rhidp/clusters.py +1 -0
- reconcile/gql_definitions/cna/queries/cna_provisioners.py +1 -0
- reconcile/gql_definitions/common/app_code_component_repos.py +4 -0
- reconcile/gql_definitions/common/clusters.py +3 -0
- reconcile/gql_definitions/common/clusters_with_peering.py +1 -0
- reconcile/gql_definitions/common/ocm_environments.py +1 -0
- reconcile/gql_definitions/common/pagerduty_instances.py +2 -0
- reconcile/gql_definitions/common/quay_instances.py +64 -0
- reconcile/gql_definitions/common/slack_workspaces.py +62 -0
- reconcile/gql_definitions/dynatrace_token_provider/dynatrace_bootstrap_tokens.py +6 -0
- reconcile/gql_definitions/fragments/aws_account_common.py +1 -0
- reconcile/gql_definitions/fragments/ocm_environment.py +1 -0
- reconcile/gql_definitions/gitlab_members/gitlab_instances.py +4 -0
- reconcile/gql_definitions/glitchtip/glitchtip_instance.py +2 -0
- reconcile/gql_definitions/jenkins_configs/jenkins_instances.py +79 -0
- reconcile/gql_definitions/jira/jira_servers.py +4 -0
- reconcile/gql_definitions/ocm_labels/clusters.py +1 -0
- reconcile/gql_definitions/openshift_cluster_bots/clusters.py +1 -0
- reconcile/gql_definitions/rhidp/organizations.py +1 -0
- reconcile/gql_definitions/statuspage/statuspages.py +4 -0
- reconcile/gql_definitions/terraform_cloudflare_resources/terraform_cloudflare_accounts.py +2 -0
- reconcile/gql_definitions/terraform_tgw_attachments/aws_accounts.py +1 -0
- reconcile/gql_definitions/unleash_feature_toggles/feature_toggles.py +2 -0
- reconcile/gql_definitions/vault_instances/vault_instances.py +2 -0
- reconcile/test/test_gitlab_members.py +2 -0
- reconcile/test/test_terraform_cloudflare_resources.py +1 -0
- reconcile/typed_queries/cloudflare.py +10 -0
- reconcile/typed_queries/dynatrace.py +10 -0
- reconcile/typed_queries/glitchtip.py +10 -0
- reconcile/typed_queries/jenkins.py +11 -0
- reconcile/typed_queries/jira.py +7 -0
- reconcile/typed_queries/ocm.py +8 -0
- reconcile/typed_queries/quay.py +7 -0
- reconcile/typed_queries/repos.py +19 -6
- reconcile/typed_queries/slack.py +7 -0
- reconcile/typed_queries/unleash.py +10 -0
- reconcile/typed_queries/vault.py +10 -0
- tools/cli_commands/systems_and_tools.py +338 -0
- tools/qontract_cli.py +8 -0
- {qontract_reconcile-0.10.1rc838.dist-info → qontract_reconcile-0.10.1rc840.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc838.dist-info → qontract_reconcile-0.10.1rc840.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc838.dist-info → qontract_reconcile-0.10.1rc840.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,79 @@
|
|
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 JenkinsInstances {
|
32
|
+
instances: jenkins_instances_v1 {
|
33
|
+
name
|
34
|
+
description
|
35
|
+
serverUrl
|
36
|
+
token {
|
37
|
+
... VaultSecret
|
38
|
+
}
|
39
|
+
deleteMethod
|
40
|
+
}
|
41
|
+
}
|
42
|
+
"""
|
43
|
+
|
44
|
+
|
45
|
+
class ConfiguredBaseModel(BaseModel):
|
46
|
+
class Config:
|
47
|
+
smart_union=True
|
48
|
+
extra=Extra.forbid
|
49
|
+
|
50
|
+
|
51
|
+
class JenkinsInstanceV1(ConfiguredBaseModel):
|
52
|
+
name: str = Field(..., alias="name")
|
53
|
+
description: str = Field(..., alias="description")
|
54
|
+
server_url: str = Field(..., alias="serverUrl")
|
55
|
+
token: VaultSecret = Field(..., alias="token")
|
56
|
+
delete_method: Optional[str] = Field(..., alias="deleteMethod")
|
57
|
+
|
58
|
+
|
59
|
+
class JenkinsInstancesQueryData(ConfiguredBaseModel):
|
60
|
+
instances: Optional[list[JenkinsInstanceV1]] = Field(..., alias="instances")
|
61
|
+
|
62
|
+
|
63
|
+
def query(query_func: Callable, **kwargs: Any) -> JenkinsInstancesQueryData:
|
64
|
+
"""
|
65
|
+
This is a convenience function which queries and parses the data into
|
66
|
+
concrete types. It should be compatible with most GQL clients.
|
67
|
+
You do not have to use it to consume the generated data classes.
|
68
|
+
Alternatively, you can also mime and alternate the behavior
|
69
|
+
of this function in the caller.
|
70
|
+
|
71
|
+
Parameters:
|
72
|
+
query_func (Callable): Function which queries your GQL Server
|
73
|
+
kwargs: optional arguments that will be passed to the query function
|
74
|
+
|
75
|
+
Returns:
|
76
|
+
JenkinsInstancesQueryData: queried data parsed into generated classes
|
77
|
+
"""
|
78
|
+
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
|
79
|
+
return JenkinsInstancesQueryData(**raw_data)
|
@@ -21,6 +21,8 @@ from pydantic import ( # noqa: F401 # pylint: disable=W0611
|
|
21
21
|
DEFINITION = """
|
22
22
|
query JiraServers {
|
23
23
|
jira_servers: jira_servers_v1 {
|
24
|
+
name
|
25
|
+
description
|
24
26
|
serverUrl
|
25
27
|
username
|
26
28
|
token {
|
@@ -48,6 +50,8 @@ class VaultSecretV1(ConfiguredBaseModel):
|
|
48
50
|
|
49
51
|
|
50
52
|
class JiraServerV1(ConfiguredBaseModel):
|
53
|
+
name: str = Field(..., alias="name")
|
54
|
+
description: str = Field(..., alias="description")
|
51
55
|
server_url: str = Field(..., alias="serverUrl")
|
52
56
|
username: str = Field(..., alias="username")
|
53
57
|
token: VaultSecretV1 = Field(..., alias="token")
|
@@ -31,7 +31,9 @@ fragment VaultSecret on VaultSecret_v1 {
|
|
31
31
|
query StatusPages {
|
32
32
|
status_pages: status_page_v1 {
|
33
33
|
name
|
34
|
+
description
|
34
35
|
pageId
|
36
|
+
url
|
35
37
|
apiUrl
|
36
38
|
credentials {
|
37
39
|
...VaultSecret
|
@@ -145,7 +147,9 @@ class MaintenanceV1(ConfiguredBaseModel):
|
|
145
147
|
|
146
148
|
class StatusPageV1(ConfiguredBaseModel):
|
147
149
|
name: str = Field(..., alias="name")
|
150
|
+
description: str = Field(..., alias="description")
|
148
151
|
page_id: str = Field(..., alias="pageId")
|
152
|
+
url: Optional[str] = Field(..., alias="url")
|
149
153
|
api_url: str = Field(..., alias="apiUrl")
|
150
154
|
credentials: VaultSecret = Field(..., alias="credentials")
|
151
155
|
components: Optional[list[StatusPageComponentV1]] = Field(..., alias="components")
|
@@ -31,6 +31,7 @@ fragment VaultSecret on VaultSecret_v1 {
|
|
31
31
|
query TerraformCloudflareAccounts {
|
32
32
|
accounts: cloudflare_accounts_v1 {
|
33
33
|
name
|
34
|
+
description
|
34
35
|
providerVersion
|
35
36
|
apiCredentials {
|
36
37
|
... VaultSecret
|
@@ -94,6 +95,7 @@ class DeletionApprovalV1(ConfiguredBaseModel):
|
|
94
95
|
|
95
96
|
class CloudflareAccountV1(ConfiguredBaseModel):
|
96
97
|
name: str = Field(..., alias="name")
|
98
|
+
description: Optional[str] = Field(..., alias="description")
|
97
99
|
provider_version: str = Field(..., alias="providerVersion")
|
98
100
|
api_credentials: VaultSecret = Field(..., alias="apiCredentials")
|
99
101
|
terraform_state_account: AWSAccountV1 = Field(..., alias="terraformStateAccount")
|
@@ -31,6 +31,7 @@ fragment VaultSecret on VaultSecret_v1 {
|
|
31
31
|
query UnleashFeatureToggles {
|
32
32
|
instances: unleash_instances_v1 {
|
33
33
|
name
|
34
|
+
description
|
34
35
|
url
|
35
36
|
adminToken {
|
36
37
|
...VaultSecret
|
@@ -82,6 +83,7 @@ class UnleashProjectV1(ConfiguredBaseModel):
|
|
82
83
|
|
83
84
|
class UnleashInstanceV1(ConfiguredBaseModel):
|
84
85
|
name: str = Field(..., alias="name")
|
86
|
+
description: str = Field(..., alias="description")
|
85
87
|
url: str = Field(..., alias="url")
|
86
88
|
admin_token: Optional[VaultSecret] = Field(..., alias="adminToken")
|
87
89
|
allow_unmanaged_feature_toggles: Optional[bool] = Field(..., alias="allowUnmanagedFeatureToggles")
|
@@ -31,6 +31,7 @@ fragment VaultSecret on VaultSecret_v1 {
|
|
31
31
|
query VaultInstances {
|
32
32
|
vault_instances: vault_instances_v1 {
|
33
33
|
name
|
34
|
+
description
|
34
35
|
address
|
35
36
|
auth {
|
36
37
|
provider
|
@@ -215,6 +216,7 @@ class VaultReplicationConfigV1(ConfiguredBaseModel):
|
|
215
216
|
|
216
217
|
class VaultInstanceV1(ConfiguredBaseModel):
|
217
218
|
name: str = Field(..., alias="name")
|
219
|
+
description: str = Field(..., alias="description")
|
218
220
|
address: str = Field(..., alias="address")
|
219
221
|
auth: Union[VaultInstanceAuthApproleV1, VaultInstanceAuthV1] = Field(..., alias="auth")
|
220
222
|
replication: Optional[list[VaultReplicationConfigV1]] = Field(..., alias="replication")
|
@@ -27,6 +27,8 @@ from reconcile.utils.pagerduty_api import PagerDutyMap
|
|
27
27
|
@pytest.fixture()
|
28
28
|
def instance(vault_secret: VaultSecret) -> GitlabInstanceV1:
|
29
29
|
return GitlabInstanceV1(
|
30
|
+
name="gitlab",
|
31
|
+
description="gitlab",
|
30
32
|
url="http://foobar.com",
|
31
33
|
token=vault_secret,
|
32
34
|
sslVerify=False,
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from reconcile.gql_definitions.terraform_cloudflare_resources.terraform_cloudflare_accounts import (
|
2
|
+
CloudflareAccountV1,
|
3
|
+
query,
|
4
|
+
)
|
5
|
+
from reconcile.utils import gql
|
6
|
+
|
7
|
+
|
8
|
+
def get_cloudflare_accounts() -> list[CloudflareAccountV1]:
|
9
|
+
data = query(gql.get_api().query)
|
10
|
+
return list(data.accounts or [])
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from reconcile.gql_definitions.dynatrace_token_provider.dynatrace_bootstrap_tokens import (
|
2
|
+
DynatraceEnvironmentV1,
|
3
|
+
query,
|
4
|
+
)
|
5
|
+
from reconcile.utils import gql
|
6
|
+
|
7
|
+
|
8
|
+
def get_dynatrace_environments() -> list[DynatraceEnvironmentV1]:
|
9
|
+
data = query(gql.get_api().query)
|
10
|
+
return list(data.environments or [])
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from reconcile.gql_definitions.glitchtip.glitchtip_instance import (
|
2
|
+
GlitchtipInstanceV1,
|
3
|
+
query,
|
4
|
+
)
|
5
|
+
from reconcile.utils import gql
|
6
|
+
|
7
|
+
|
8
|
+
def get_glitchtip_instances() -> list[GlitchtipInstanceV1]:
|
9
|
+
data = query(gql.get_api().query)
|
10
|
+
return list(data.instances or [])
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from reconcile.gql_definitions.jenkins_configs.jenkins_instances import (
|
2
|
+
JenkinsInstanceV1,
|
3
|
+
query,
|
4
|
+
)
|
5
|
+
from reconcile.utils import gql
|
6
|
+
|
7
|
+
|
8
|
+
def get_jenkins_instances() -> list[JenkinsInstanceV1]:
|
9
|
+
gqlapi = gql.get_api()
|
10
|
+
data = query(gqlapi.query)
|
11
|
+
return list(data.instances or [])
|
@@ -0,0 +1,8 @@
|
|
1
|
+
from reconcile.gql_definitions.common.ocm_environments import query
|
2
|
+
from reconcile.gql_definitions.fragments.ocm_environment import OCMEnvironment
|
3
|
+
from reconcile.utils import gql
|
4
|
+
|
5
|
+
|
6
|
+
def get_ocm_environments() -> list[OCMEnvironment]:
|
7
|
+
data = query(gql.get_api().query)
|
8
|
+
return list(data.environments or [])
|
reconcile/typed_queries/repos.py
CHANGED
@@ -1,17 +1,30 @@
|
|
1
1
|
from collections.abc import Callable
|
2
2
|
from typing import Optional
|
3
3
|
|
4
|
-
from reconcile.gql_definitions.common.app_code_component_repos import
|
4
|
+
from reconcile.gql_definitions.common.app_code_component_repos import (
|
5
|
+
AppCodeComponentsV1,
|
6
|
+
query,
|
7
|
+
)
|
5
8
|
from reconcile.utils import gql
|
6
9
|
|
7
10
|
|
8
|
-
def
|
11
|
+
def get_code_components(
|
9
12
|
server: str = "",
|
10
13
|
query_func: Optional[Callable] = None,
|
11
|
-
) -> list[
|
14
|
+
) -> list[AppCodeComponentsV1]:
|
12
15
|
if not query_func:
|
13
16
|
query_func = gql.get_api().query
|
14
|
-
|
17
|
+
code_components: list[AppCodeComponentsV1] = []
|
15
18
|
for app in query(query_func).apps or []:
|
16
|
-
|
17
|
-
|
19
|
+
code_components += [
|
20
|
+
c for c in app.code_components or [] if c.url.startswith(server)
|
21
|
+
]
|
22
|
+
return code_components
|
23
|
+
|
24
|
+
|
25
|
+
def get_repos(
|
26
|
+
server: str = "",
|
27
|
+
query_func: Optional[Callable] = None,
|
28
|
+
) -> list[str]:
|
29
|
+
code_components = get_code_components(server=server, query_func=query_func)
|
30
|
+
return [c.url for c in code_components]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from reconcile.gql_definitions.unleash_feature_toggles.feature_toggles import (
|
2
|
+
UnleashInstanceV1,
|
3
|
+
query,
|
4
|
+
)
|
5
|
+
from reconcile.utils import gql
|
6
|
+
|
7
|
+
|
8
|
+
def get_unleash_instances() -> list[UnleashInstanceV1]:
|
9
|
+
data = query(gql.get_api().query)
|
10
|
+
return list(data.instances or [])
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from reconcile.gql_definitions.vault_instances.vault_instances import (
|
2
|
+
VaultInstanceV1,
|
3
|
+
query,
|
4
|
+
)
|
5
|
+
from reconcile.utils import gql
|
6
|
+
|
7
|
+
|
8
|
+
def get_vault_instances() -> list[VaultInstanceV1]:
|
9
|
+
data = query(gql.get_api().query)
|
10
|
+
return list(data.vault_instances or [])
|