From f692309ac653a6fafb2dc2ae822e5088016012ec Mon Sep 17 00:00:00 2001 From: 1101-1 <70093559+1101-1@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:21:49 +0500 Subject: [PATCH] [azure][feat]: Update configs collection for mysql and postgresql (#2157) --- .../azure/fix_plugin_azure/resource/mysql.py | 78 +++++---- .../fix_plugin_azure/resource/postgresql.py | 65 ++++---- plugins/azure/fix_plugin_azure/utils.py | 23 +++ plugins/azure/test/collector_test.py | 4 +- .../test/files/mysql/configurations.json | 150 +++++++----------- .../test/files/postgresql/configurations.json | 98 +++++++++++- 6 files changed, 244 insertions(+), 174 deletions(-) diff --git a/plugins/azure/fix_plugin_azure/resource/mysql.py b/plugins/azure/fix_plugin_azure/resource/mysql.py index 6c15be5a10..d3006c6596 100644 --- a/plugins/azure/fix_plugin_azure/resource/mysql.py +++ b/plugins/azure/fix_plugin_azure/resource/mysql.py @@ -13,6 +13,7 @@ AzureSystemData, ) from fix_plugin_azure.resource.microsoft_graph import MicrosoftGraphServicePrincipal, MicrosoftGraphUser +from fix_plugin_azure.utils import from_str_to_typed from fixlib.baseresources import ( BaseDatabase, BaseDatabaseInstanceType, @@ -21,7 +22,7 @@ ModelReference, ) from fixlib.graph import BySearchCriteria -from fixlib.json_bender import K, AsBool, Bender, S, ForallBend, Bend, MapEnum, MapValue +from fixlib.json_bender import K, Bender, S, ForallBend, Bend, MapEnum, MapValue from fixlib.types import Json service_name = "azure_mysql" @@ -318,39 +319,34 @@ def collect( class AzureMysqlServerConfiguration(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_configuration" # Collect via AzureMysqlServer() - mapping: ClassVar[Dict[str, Bender]] = { - "id": S("id"), - "tags": S("tags", default={}), - "name": S("name"), - "system_data": S("systemData") >> Bend(AzureSystemData.mapping), - "type": S("type"), - "ctime": S("systemData", "createdAt"), - "mtime": S("systemData", "lastModifiedAt"), - "allowed_values": S("properties", "allowedValues"), - "current_value": S("properties", "currentValue"), - "data_type": S("properties", "dataType"), - "default_value": S("properties", "defaultValue"), - "description": S("properties", "description"), - "documentation_link": S("properties", "documentationLink"), - "is_config_pending_restart": S("properties", "isConfigPendingRestart") >> AsBool(), - "is_dynamic_config": S("properties", "isDynamicConfig") >> AsBool(), - "is_read_only": S("properties", "isReadOnly") >> AsBool(), - "source": S("properties", "source"), - "value": S("properties", "value"), - } - allowed_values: Optional[str] = field(default=None, metadata={'description': 'Allowed values of the configuration.'}) # fmt: skip - current_value: Optional[str] = field(default=None, metadata={"description": "Current value of the configuration."}) - data_type: Optional[str] = field(default=None, metadata={"description": "Data type of the configuration."}) - default_value: Optional[str] = field(default=None, metadata={"description": "Default value of the configuration."}) - description: Optional[str] = field(default=None, metadata={"description": "Description of the configuration."}) - documentation_link: Optional[str] = field(default=None, metadata={'description': 'The link used to get the document from community or Azure site.'}) # fmt: skip - is_config_pending_restart: Optional[bool] = field(default=None, metadata={'description': 'If is the configuration pending restart or not.'}) # fmt: skip - is_dynamic_config: Optional[bool] = field(default=None, metadata={'description': 'If is the configuration dynamic.'}) # fmt: skip - is_read_only: Optional[bool] = field(default=None, metadata={"description": "If is the configuration read only."}) - source: Optional[str] = field(default=None, metadata={"description": "Source of the configuration."}) - value: Optional[str] = field(default=None, metadata={"description": "Value of the configuration."}) - system_data: Optional[AzureSystemData] = field(default=None, metadata={'description': 'Metadata pertaining to creation and last modification of the resource.'}) # fmt: skip - type: Optional[str] = field(default=None, metadata={'description': 'The type of the resource. E.g. Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts '}) # fmt: skip + config: Json = field(factory=dict) + + @classmethod + def collect_configs( + cls, + server_id: str, + raw: List[Json], + builder: GraphBuilder, + ) -> List["AzureMysqlServerConfiguration"]: + if not raw: + return [] + configuration_instance = AzureMysqlServerConfiguration(id=server_id) + for js in raw: + properties = js.get("properties") + if not properties: + continue + if ( + (data_type := properties.get("dataType")) + and (val := properties.get("currentValue") or properties.get("value")) + and (config_name := js.get("name")) + ): + value = from_str_to_typed(data_type, val) + if not value: + continue + configuration_instance.config[config_name] = value + if (added := builder.add_node(configuration_instance, configuration_instance.config)) is not None: + return [added] + return [] @define(eq=False, slots=False) @@ -667,14 +663,12 @@ def _collect_items( items = graph_builder.client.list(api_spec) if not items: return - collected = class_instance.collect(items, graph_builder) - for clazz in collected: - graph_builder.add_edge( - self, - edge_type=EdgeType.default, - id=clazz.id, - clazz=class_instance, - ) + if issubclass(AzureMysqlServerConfiguration, class_instance): # type: ignore + collected = class_instance.collect_configs(self.id, items, graph_builder) # type: ignore + else: + collected = class_instance.collect(items, graph_builder) + for resource in collected: + graph_builder.add_edge(self, node=resource) def post_process(self, graph_builder: GraphBuilder, source: Json) -> None: if server_id := self.id: diff --git a/plugins/azure/fix_plugin_azure/resource/postgresql.py b/plugins/azure/fix_plugin_azure/resource/postgresql.py index 52e4c70892..ac4474a674 100644 --- a/plugins/azure/fix_plugin_azure/resource/postgresql.py +++ b/plugins/azure/fix_plugin_azure/resource/postgresql.py @@ -24,6 +24,7 @@ AzureServerMaintenanceWindow, AzureServerNetwork, ) +from fix_plugin_azure.utils import from_str_to_typed from fixlib.baseresources import BaseDatabase, BaseDatabaseInstanceType, DatabaseInstanceStatus, ModelReference from fixlib.graph import BySearchCriteria from fixlib.json_bender import K, Bender, S, ForallBend, Bend, MapEnum, MapValue @@ -313,37 +314,34 @@ def collect(cls, raw: List[Json], builder: GraphBuilder) -> List[AzurePostgresql class AzurePostgresqlServerConfiguration(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_postgresql_server_configuration" # Collect via AzurePostgresqlServer() - mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { - "id": S("id"), - "tags": S("tags", default={}), - "name": S("name"), - "ctime": S("systemData", "createdAt"), - "mtime": S("systemData", "lastModifiedAt"), - "allowed_values": S("properties", "allowedValues"), - "data_type": S("properties", "dataType"), - "default_value": S("properties", "defaultValue"), - "description": S("properties", "description"), - "documentation_link": S("properties", "documentationLink"), - "is_config_pending_restart": S("properties", "isConfigPendingRestart"), - "is_dynamic_config": S("properties", "isDynamicConfig"), - "is_read_only": S("properties", "isReadOnly"), - "configuration_source": S("properties", "source"), - "system_data": S("systemData") >> Bend(AzureSystemData.mapping), - "unit": S("properties", "unit"), - "value": S("properties", "value"), - } - allowed_values: Optional[str] = field(default=None, metadata={'description': 'Allowed values of the configuration.'}) # fmt: skip - data_type: Optional[str] = field(default=None, metadata={"description": "Data type of the configuration."}) - default_value: Optional[str] = field(default=None, metadata={"description": "Default value of the configuration."}) - description: Optional[str] = field(default=None, metadata={"description": "Description of the configuration."}) - documentation_link: Optional[str] = field(default=None, metadata={'description': 'Configuration documentation link.'}) # fmt: skip - is_config_pending_restart: Optional[bool] = field(default=None, metadata={'description': 'Configuration is pending restart or not.'}) # fmt: skip - is_dynamic_config: Optional[bool] = field(default=None, metadata={'description': 'Configuration dynamic or static.'}) # fmt: skip - is_read_only: Optional[bool] = field(default=None, metadata={"description": "Configuration read-only or not."}) - configuration_source: Optional[str] = field(default=None, metadata={"description": "Source of the configuration."}) - system_data: Optional[AzureSystemData] = field(default=None, metadata={'description': 'Metadata pertaining to creation and last modification of the resource.'}) # fmt: skip - unit: Optional[str] = field(default=None, metadata={"description": "Configuration unit."}) - value: Optional[str] = field(default=None, metadata={"description": "Value of the configuration."}) + config: Json = field(factory=dict) + + @classmethod + def collect_configs( + cls, + server_id: str, + raw: List[Json], + builder: GraphBuilder, + ) -> List[AzurePostgresqlServerConfiguration]: + if not raw: + return [] + configuration_instance = AzurePostgresqlServerConfiguration(id=server_id) + for js in raw: + properties = js.get("properties") + if not properties: + continue + if ( + (data_type := properties.get("dataType")) + and (val := properties.get("value")) + and (config_name := js.get("name")) + ): + value = from_str_to_typed(data_type, val) + if not value: + continue + configuration_instance.config[config_name] = value + if (added := builder.add_node(configuration_instance, configuration_instance.config)) is not None: + return [added] + return [] @define(eq=False, slots=False) @@ -542,7 +540,10 @@ def _collect_items( items = graph_builder.client.list(api_spec) if not items: return - collected = class_instance.collect(items, graph_builder) + if issubclass(AzurePostgresqlServerConfiguration, class_instance): # type: ignore + collected = class_instance.collect_configs(self.id, items, graph_builder) # type: ignore + else: + collected = class_instance.collect(items, graph_builder) for clazz in collected: graph_builder.add_edge(self, node=clazz) diff --git a/plugins/azure/fix_plugin_azure/utils.py b/plugins/azure/fix_plugin_azure/utils.py index 0a1c51da27..8017951c07 100644 --- a/plugins/azure/fix_plugin_azure/utils.py +++ b/plugins/azure/fix_plugin_azure/utils.py @@ -1,3 +1,4 @@ +import logging from typing import Callable, Dict, TypeVar, Any from attr import frozen import functools @@ -6,6 +7,7 @@ T = TypeVar("T") +log = logging.getLogger("fix.plugins.azure") def rgetattr(obj: Any, attr: str, *args: Any) -> Any: @@ -44,6 +46,27 @@ def case_insensitive_eq(left: T, right: T) -> bool: return left == right +def from_str_to_typed(config_type: str, value: str) -> Any: + def set_bool(val: str) -> bool: + if val.lower() == "on": + return True + return False + + type_mapping = { + "Enumeration": lambda x: set_bool(x) if x.lower() in ["on", "off"] else str(x), + "Integer": int, + "Numeric": float, + "Set": lambda x: x.split(","), + "String": str, + "Boolean": set_bool, + } + try: + return type_mapping[config_type](value) # type: ignore + except Exception as e: + log.warning(f"An error occured while typing value: {e}") + return None + + @frozen(kw_only=True) class MetricNormalization: metric_name: MetricName diff --git a/plugins/azure/test/collector_test.py b/plugins/azure/test/collector_test.py index 902683e07c..2f88ad4e99 100644 --- a/plugins/azure/test/collector_test.py +++ b/plugins/azure/test/collector_test.py @@ -49,8 +49,8 @@ def test_collect( config, Cloud(id="azure"), azure_subscription, credentials, core_feedback ) subscription_collector.collect() - assert len(subscription_collector.graph.nodes) == 428 - assert len(subscription_collector.graph.edges) == 668 + assert len(subscription_collector.graph.nodes) == 420 + assert len(subscription_collector.graph.edges) == 652 graph_collector = MicrosoftGraphOrganizationCollector( config, Cloud(id="azure"), MicrosoftGraphOrganization(id="test", name="test"), credentials, core_feedback diff --git a/plugins/azure/test/files/mysql/configurations.json b/plugins/azure/test/files/mysql/configurations.json index 27592a39cd..942dd99994 100644 --- a/plugins/azure/test/files/mysql/configurations.json +++ b/plugins/azure/test/files/mysql/configurations.json @@ -2,131 +2,99 @@ "value": [ { "properties": { - "value": "OFF", - "description": "Tell the server to enable or disable archive engine.", - "defaultValue": "OFF", - "dataType": "Enumeration", "allowedValues": "ON,OFF", - "source": "system-default", - "isConfigPendingRestart": "False", - "isDynamicConfig": "False", - "isReadOnly": "True" - }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/archive", - "name": "archive", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" - }, - { - "properties": { - "value": "OFF", - "description": "Allow to audit the log.", - "defaultValue": "OFF", + "currentValue": "ON", "dataType": "Enumeration", - "allowedValues": "ON,OFF", - "source": "system-default", + "defaultValue": "ON", + "description": "Whether to enable automatic activation of all granted roles when users log in to the server.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_activate_all_roles_on_login", "isConfigPendingRestart": "False", "isDynamicConfig": "True", - "isReadOnly": "False" - }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_enabled", - "name": "audit_log_enabled", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" - }, - { - "properties": { - "value": "CONNECTION", - "description": "Select the events to audit logs.", - "defaultValue": "CONNECTION", - "dataType": "Set", - "allowedValues": "DDL,DML_SELECT,DML_NONSELECT,DCL,ADMIN,DML,GENERAL,CONNECTION,TABLE_ACCESS", + "isReadOnly": "False", "source": "system-default", - "isConfigPendingRestart": "False", - "isDynamicConfig": "True", - "isReadOnly": "False" + "value": "ON" }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_events", - "name": "audit_log_events", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" + "type": "Microsoft.DBforMySQL/flexibleServers/configurations", + "resourceGroup": "foo", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforMySQL/flexibleServers/test/configurations/activate_all_roles_on_login", + "name": "activate_all_roles_on_login" }, { "properties": { - "value": "azure_superuser", - "description": "The comma-separated user list whose commands will not be in the audit logs.", - "defaultValue": "azure_superuser", - "dataType": "String", - "allowedValues": "", - "source": "system-default", + "allowedValues": "0-65535", + "currentValue": "33062", + "dataType": "Integer", + "defaultValue": "33062", + "description": "The TCP/IP port number to use for connections on the administrative network interface.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_port", "isConfigPendingRestart": "False", - "isDynamicConfig": "True", - "isReadOnly": "False" + "isDynamicConfig": "False", + "isReadOnly": "True", + "source": "system-default", + "value": "33062" }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_exclude_users", - "name": "audit_log_exclude_users", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" + "type": "Microsoft.DBforMySQL/flexibleServers/configurations", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforMySQL/flexibleServers/test/configurations/admin_port", + "name": "admin_port", + "resourceGroup": "foo" }, { "properties": { - "value": "", - "description": "The comma-separated user list whose commands will be in the audit logs. It takes higher priority if the same user name is found in audit_log_exclude_users.", - "defaultValue": "", - "dataType": "String", "allowedValues": "", - "source": "system-default", + "currentValue": "log_filter_internal; log_sink_internal", + "dataType": "String", + "defaultValue": "", + "description": "The admin_ssl_ca system variable is like ssl_ca, except that it applies to the administrative connection interface rather than the main connection interface.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_ssl_ca", "isConfigPendingRestart": "False", "isDynamicConfig": "True", - "isReadOnly": "False" - }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_include_users", - "name": "audit_log_include_users", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" - }, - { - "properties": { - "value": "ON", - "description": "Allow to audit the slow log.", - "defaultValue": "ON", - "dataType": "Enumeration", - "allowedValues": "ON,OFF", + "isReadOnly": "True", "source": "system-default", - "isConfigPendingRestart": "False", - "isDynamicConfig": "True", - "isReadOnly": "True" + "systemData": null, + "value": "" }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_slow_log_enabled", - "name": "audit_slow_log_enabled", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforMySQL/flexibleServers/test/configurations/admin_ssl_ca", + "name": "admin_ssl_ca", + "resourceGroup": "foo", "type": "Microsoft.DBforMySQL/flexibleServers/configurations" }, { "properties": { - "value": "OFF", - "description": "Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist.", - "defaultValue": "OFF", - "dataType": "Enumeration", - "allowedValues": "ON,OFF", "source": "system-default", + "value": "TLSv1.2", + "allowedValues": "TLSv1.2,TLSv1.3", + "currentValue": "TLSv1.2", + "dataType": "Set", + "defaultValue": "TLSv1.2", + "description": "The admin_tls_version system variable is like tls_version, except that it applies to the administrative connection interface rather than the main connection interface.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_tls_version", "isConfigPendingRestart": "False", - "isDynamicConfig": "False", + "isDynamicConfig": "True", "isReadOnly": "True" }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_generate_certs", - "name": "auto_generate_certs", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforMySQL/flexibleServers/test/configurations/admin_tls_version", + "name": "admin_tls_version", + "type": "Microsoft.DBforMySQL/flexibleServers/configurations", + "resourceGroup": "foo" }, { "properties": { - "value": "1", - "description": "The auto_increment_increment is intended for use with source-to-source replication, and can be used to control the operation of AUTO_INCREMENT columns.", - "defaultValue": "1", - "dataType": "Integer", - "allowedValues": "1-65535", "source": "system-default", + "value": "90", "isConfigPendingRestart": "False", "isDynamicConfig": "True", - "isReadOnly": "False" + "isReadOnly": "False", + "allowedValues": "0-99.99", + "currentValue": "90", + "dataType": "Numeric", + "defaultValue": "90", + "description": "InnoDB tries to flush data from the buffer pool so that the percentage of dirty pages does not exceed this value.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_max_dirty_pages_pct" }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_increment_increment", - "name": "auto_increment_increment", - "type": "Microsoft.DBforMySQL/flexibleServers/configurations" + "type": "Microsoft.DBforMySQL/flexibleServers/configurations", + "resourceGroup": "foo", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforMySQL/flexibleServers/test/configurations/innodb_max_dirty_pages_pct", + "name": "innodb_max_dirty_pages_pct" } ] } \ No newline at end of file diff --git a/plugins/azure/test/files/postgresql/configurations.json b/plugins/azure/test/files/postgresql/configurations.json index f946b34532..c38293e3fa 100644 --- a/plugins/azure/test/files/postgresql/configurations.json +++ b/plugins/azure/test/files/postgresql/configurations.json @@ -3,22 +3,106 @@ "value": [ { "properties": { - "value": "", - "description": "Sets the application name to be reported in statistics and logs.", - "defaultValue": "", + "allowedValues": "ON,OFF", + "currentValue": "ON", + "dataType": "Enumeration", + "defaultValue": "ON", + "description": "Whether to enable automatic activation of all granted roles when users log in to the server.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_activate_all_roles_on_login", + "isConfigPendingRestart": "False", + "isDynamicConfig": "True", + "isReadOnly": "False", + "source": "system-default", + "value": "ON" + }, + "type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations", + "resourceGroup": "foo", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforPostgreSQL/flexibleServers/test/configurations/activate_all_roles_on_login", + "name": "activate_all_roles_on_login" + }, + { + "properties": { + "allowedValues": "0-65535", + "currentValue": "33062", + "dataType": "Integer", + "defaultValue": "33062", + "description": "The TCP/IP port number to use for connections on the administrative network interface.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_port", + "isConfigPendingRestart": "False", + "isDynamicConfig": "False", + "isReadOnly": "True", + "source": "system-default", + "value": "33062" + }, + "type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforPostgreSQL/flexibleServers/test/configurations/admin_port", + "name": "admin_port", + "resourceGroup": "foo" + }, + { + "properties": { + "allowedValues": "", + "currentValue": "log_filter_internal; log_sink_internal", "dataType": "String", - "allowedValues": "[A-Za-z0-9._-]*", - "source": "system-default" + "defaultValue": "", + "description": "The admin_ssl_ca system variable is like ssl_ca, except that it applies to the administrative connection interface rather than the main connection interface.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_ssl_ca", + "isConfigPendingRestart": "False", + "isDynamicConfig": "True", + "isReadOnly": "True", + "source": "system-default", + "systemData": null, + "value": "" }, - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/application_name", - "name": "application_name", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforPostgreSQL/flexibleServers/test/configurations/admin_ssl_ca", + "name": "admin_ssl_ca", + "resourceGroup": "foo", "type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations" }, + { + "properties": { + "source": "system-default", + "value": "TLSv1.2", + "allowedValues": "TLSv1.2,TLSv1.3", + "currentValue": "TLSv1.2", + "dataType": "Set", + "defaultValue": "TLSv1.2", + "description": "The admin_tls_version system variable is like tls_version, except that it applies to the administrative connection interface rather than the main connection interface.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_tls_version", + "isConfigPendingRestart": "False", + "isDynamicConfig": "True", + "isReadOnly": "True" + }, + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforPostgreSQL/flexibleServers/test/configurations/admin_tls_version", + "name": "admin_tls_version", + "type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations", + "resourceGroup": "foo" + }, + { + "properties": { + "source": "system-default", + "value": "90", + "isConfigPendingRestart": "False", + "isDynamicConfig": "True", + "isReadOnly": "False", + "allowedValues": "0-99.99", + "currentValue": "90", + "dataType": "Numeric", + "defaultValue": "90", + "description": "InnoDB tries to flush data from the buffer pool so that the percentage of dirty pages does not exceed this value.", + "documentationLink": "https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_max_dirty_pages_pct" + }, + "type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations", + "resourceGroup": "foo", + "id": "/subscriptions/subid/resourceGroups/foo/providers/Microsoft.DBforPostgreSQL/flexibleServers/test/configurations/innodb_max_dirty_pages_pct", + "name": "innodb_max_dirty_pages_pct" + }, { "properties": { "value": "on", "description": "Enables input of NULL elements in arrays.", "defaultValue": "on", + "currentValue": "on", "dataType": "Boolean", "allowedValues": "on,off", "source": "system-default"