qontract-reconcile 0.10.1rc753__py3-none-any.whl → 0.10.1rc755__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.1rc753.dist-info → qontract_reconcile-0.10.1rc755.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc753.dist-info → qontract_reconcile-0.10.1rc755.dist-info}/RECORD +12 -7
- reconcile/cli.py +27 -0
- reconcile/gql_definitions/external_resources/__init__.py +0 -0
- reconcile/gql_definitions/external_resources/external_resources_modules.py +72 -0
- reconcile/gql_definitions/external_resources/external_resources_namespaces.py +1043 -0
- reconcile/gql_definitions/external_resources/external_resources_settings.py +70 -0
- reconcile/typed_queries/external_resources.py +47 -0
- reconcile/utils/terrascript_aws_client.py +8 -6
- {qontract_reconcile-0.10.1rc753.dist-info → qontract_reconcile-0.10.1rc755.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc753.dist-info → qontract_reconcile-0.10.1rc755.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc753.dist-info → qontract_reconcile-0.10.1rc755.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,70 @@
|
|
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 ExternalResourcesSettings {
|
23
|
+
settings: external_resources_settings_v1 {
|
24
|
+
state_dynamodb_table
|
25
|
+
state_dynamodb_index
|
26
|
+
state_dynamodb_region
|
27
|
+
tf_state_bucket
|
28
|
+
tf_state_region
|
29
|
+
tf_state_dynamodb_table
|
30
|
+
}
|
31
|
+
}
|
32
|
+
"""
|
33
|
+
|
34
|
+
|
35
|
+
class ConfiguredBaseModel(BaseModel):
|
36
|
+
class Config:
|
37
|
+
smart_union=True
|
38
|
+
extra=Extra.forbid
|
39
|
+
|
40
|
+
|
41
|
+
class ExternalResourcesSettingsV1(ConfiguredBaseModel):
|
42
|
+
state_dynamodb_table: str = Field(..., alias="state_dynamodb_table")
|
43
|
+
state_dynamodb_index: str = Field(..., alias="state_dynamodb_index")
|
44
|
+
state_dynamodb_region: str = Field(..., alias="state_dynamodb_region")
|
45
|
+
tf_state_bucket: Optional[str] = Field(..., alias="tf_state_bucket")
|
46
|
+
tf_state_region: Optional[str] = Field(..., alias="tf_state_region")
|
47
|
+
tf_state_dynamodb_table: Optional[str] = Field(..., alias="tf_state_dynamodb_table")
|
48
|
+
|
49
|
+
|
50
|
+
class ExternalResourcesSettingsQueryData(ConfiguredBaseModel):
|
51
|
+
settings: Optional[list[ExternalResourcesSettingsV1]] = Field(..., alias="settings")
|
52
|
+
|
53
|
+
|
54
|
+
def query(query_func: Callable, **kwargs: Any) -> ExternalResourcesSettingsQueryData:
|
55
|
+
"""
|
56
|
+
This is a convenience function which queries and parses the data into
|
57
|
+
concrete types. It should be compatible with most GQL clients.
|
58
|
+
You do not have to use it to consume the generated data classes.
|
59
|
+
Alternatively, you can also mime and alternate the behavior
|
60
|
+
of this function in the caller.
|
61
|
+
|
62
|
+
Parameters:
|
63
|
+
query_func (Callable): Function which queries your GQL Server
|
64
|
+
kwargs: optional arguments that will be passed to the query function
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
ExternalResourcesSettingsQueryData: queried data parsed into generated classes
|
68
|
+
"""
|
69
|
+
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
|
70
|
+
return ExternalResourcesSettingsQueryData(**raw_data)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
from collections.abc import Callable
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from reconcile.gql_definitions.external_resources.external_resources_modules import (
|
5
|
+
ExternalResourcesModuleV1,
|
6
|
+
)
|
7
|
+
from reconcile.gql_definitions.external_resources.external_resources_modules import (
|
8
|
+
query as query_modules,
|
9
|
+
)
|
10
|
+
from reconcile.gql_definitions.external_resources.external_resources_namespaces import (
|
11
|
+
NamespaceV1,
|
12
|
+
)
|
13
|
+
from reconcile.gql_definitions.external_resources.external_resources_namespaces import (
|
14
|
+
query as query_namespaces,
|
15
|
+
)
|
16
|
+
from reconcile.gql_definitions.external_resources.external_resources_settings import (
|
17
|
+
ExternalResourcesSettingsV1,
|
18
|
+
)
|
19
|
+
from reconcile.gql_definitions.external_resources.external_resources_settings import (
|
20
|
+
query as query_settings,
|
21
|
+
)
|
22
|
+
from reconcile.utils import gql
|
23
|
+
|
24
|
+
|
25
|
+
def get_namespaces(query_func: Optional[Callable] = None) -> list[NamespaceV1]:
|
26
|
+
if not query_func:
|
27
|
+
query_func = gql.get_api().query
|
28
|
+
data = query_namespaces(query_func=query_func)
|
29
|
+
return list(data.namespaces or [])
|
30
|
+
|
31
|
+
|
32
|
+
def get_settings(
|
33
|
+
query_func: Optional[Callable] = None,
|
34
|
+
) -> list[ExternalResourcesSettingsV1]:
|
35
|
+
if not query_func:
|
36
|
+
query_func = gql.get_api().query
|
37
|
+
data = query_settings(query_func=query_func)
|
38
|
+
return list(data.settings or [])
|
39
|
+
|
40
|
+
|
41
|
+
def get_modules(
|
42
|
+
query_func: Optional[Callable] = None,
|
43
|
+
) -> list[ExternalResourcesModuleV1]:
|
44
|
+
if not query_func:
|
45
|
+
query_func = gql.get_api().query
|
46
|
+
data = query_modules(query_func=query_func)
|
47
|
+
return list(data.modules or [])
|
@@ -298,6 +298,10 @@ class aws_cloudfront_log_delivery_canonical_user_id(Data):
|
|
298
298
|
pass
|
299
299
|
|
300
300
|
|
301
|
+
class cloudinit_config(Data):
|
302
|
+
pass
|
303
|
+
|
304
|
+
|
301
305
|
# temporary until we upgrade to a terrascript release
|
302
306
|
# that supports this provider
|
303
307
|
# https://github.com/mjuenema/python-terrascript/pull/166
|
@@ -436,9 +440,9 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
436
440
|
"source": "hashicorp/random",
|
437
441
|
"version": "3.4.3",
|
438
442
|
},
|
439
|
-
"
|
440
|
-
"source": "hashicorp/
|
441
|
-
"version": "2.
|
443
|
+
"cloudinit": {
|
444
|
+
"source": "hashicorp/cloudinit",
|
445
|
+
"version": "2.3.3",
|
442
446
|
},
|
443
447
|
},
|
444
448
|
required_version=TERRAFORM_VERSION[0],
|
@@ -5428,9 +5432,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
5428
5432
|
"content": content,
|
5429
5433
|
})
|
5430
5434
|
cloudinit_value = {"gzip": True, "base64_encode": True, "part": part}
|
5431
|
-
cloudinit_data =
|
5432
|
-
identifier, **cloudinit_value
|
5433
|
-
)
|
5435
|
+
cloudinit_data = cloudinit_config(identifier, **cloudinit_value)
|
5434
5436
|
tf_resources.append(cloudinit_data)
|
5435
5437
|
template_values["user_data"] = "${" + cloudinit_data.rendered + "}"
|
5436
5438
|
template_resource = aws_launch_template(identifier, **template_values)
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc753.dist-info → qontract_reconcile-0.10.1rc755.dist-info}/top_level.txt
RENAMED
File without changes
|