stackit-valkey 0.0.1__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.
Files changed (40) hide show
  1. src/stackit/valkey/__init__.py +134 -0
  2. src/stackit/valkey/api/__init__.py +4 -0
  3. src/stackit/valkey/api/default_api.py +5235 -0
  4. src/stackit/valkey/api_client.py +649 -0
  5. src/stackit/valkey/api_response.py +22 -0
  6. src/stackit/valkey/configuration.py +162 -0
  7. src/stackit/valkey/exceptions.py +217 -0
  8. src/stackit/valkey/models/__init__.py +48 -0
  9. src/stackit/valkey/models/backup.py +102 -0
  10. src/stackit/valkey/models/create_backup_response_item.py +83 -0
  11. src/stackit/valkey/models/create_credentials_payload.py +82 -0
  12. src/stackit/valkey/models/create_instance_payload.py +97 -0
  13. src/stackit/valkey/models/create_instance_response.py +82 -0
  14. src/stackit/valkey/models/credentials.py +98 -0
  15. src/stackit/valkey/models/credentials_list_item.py +82 -0
  16. src/stackit/valkey/models/credentials_response.py +95 -0
  17. src/stackit/valkey/models/error.py +83 -0
  18. src/stackit/valkey/models/get_metrics_response.py +161 -0
  19. src/stackit/valkey/models/instance.py +148 -0
  20. src/stackit/valkey/models/instance_last_operation.py +100 -0
  21. src/stackit/valkey/models/instance_parameters.py +240 -0
  22. src/stackit/valkey/models/instance_schema.py +96 -0
  23. src/stackit/valkey/models/list_credentials_response.py +99 -0
  24. src/stackit/valkey/models/list_instances_response.py +99 -0
  25. src/stackit/valkey/models/list_offerings_response.py +99 -0
  26. src/stackit/valkey/models/list_restores_response.py +99 -0
  27. src/stackit/valkey/models/model_schema.py +82 -0
  28. src/stackit/valkey/models/offering.py +135 -0
  29. src/stackit/valkey/models/partial_update_instance_payload.py +97 -0
  30. src/stackit/valkey/models/plan.py +100 -0
  31. src/stackit/valkey/models/raw_credentials.py +89 -0
  32. src/stackit/valkey/models/restore.py +94 -0
  33. src/stackit/valkey/models/trigger_restore_response.py +82 -0
  34. src/stackit/valkey/models/update_backups_config_payload.py +82 -0
  35. src/stackit/valkey/models/update_backups_config_response.py +82 -0
  36. src/stackit/valkey/py.typed +0 -0
  37. src/stackit/valkey/rest.py +163 -0
  38. stackit_valkey-0.0.1.dist-info/METADATA +46 -0
  39. stackit_valkey-0.0.1.dist-info/RECORD +40 -0
  40. stackit_valkey-0.0.1.dist-info/WHEEL +4 -0
@@ -0,0 +1,161 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set, Union
19
+
20
+ from pydantic import (
21
+ BaseModel,
22
+ ConfigDict,
23
+ Field,
24
+ StrictBool,
25
+ StrictFloat,
26
+ StrictInt,
27
+ )
28
+ from pydantic_core import to_jsonable_python
29
+ from typing_extensions import Self
30
+
31
+
32
+ class GetMetricsResponse(BaseModel):
33
+ """
34
+ GetMetricsResponse
35
+ """ # noqa: E501
36
+
37
+ cpu_idle_time: Optional[StrictInt] = Field(default=None, alias="cpuIdleTime")
38
+ cpu_load_percent: Union[StrictFloat, StrictInt] = Field(alias="cpuLoadPercent")
39
+ cpu_system_time: Optional[StrictInt] = Field(default=None, alias="cpuSystemTime")
40
+ cpu_user_time: Optional[StrictInt] = Field(default=None, alias="cpuUserTime")
41
+ disk_ephemeral_total: StrictInt = Field(alias="diskEphemeralTotal")
42
+ disk_ephemeral_used: StrictInt = Field(alias="diskEphemeralUsed")
43
+ disk_persistent_total: StrictInt = Field(alias="diskPersistentTotal")
44
+ disk_persistent_used: StrictInt = Field(alias="diskPersistentUsed")
45
+ load1: Union[StrictFloat, StrictInt]
46
+ load15: Union[StrictFloat, StrictInt]
47
+ load5: Union[StrictFloat, StrictInt]
48
+ memory_total: StrictInt = Field(alias="memoryTotal")
49
+ memory_used: StrictInt = Field(alias="memoryUsed")
50
+ parachute_disk_ephemeral_activated: StrictBool = Field(alias="parachuteDiskEphemeralActivated")
51
+ parachute_disk_ephemeral_total: StrictInt = Field(alias="parachuteDiskEphemeralTotal")
52
+ parachute_disk_ephemeral_used: StrictInt = Field(alias="parachuteDiskEphemeralUsed")
53
+ parachute_disk_ephemeral_used_percent: StrictInt = Field(alias="parachuteDiskEphemeralUsedPercent")
54
+ parachute_disk_ephemeral_used_threshold: StrictInt = Field(alias="parachuteDiskEphemeralUsedThreshold")
55
+ parachute_disk_persistent_activated: StrictBool = Field(alias="parachuteDiskPersistentActivated")
56
+ parachute_disk_persistent_total: StrictInt = Field(alias="parachuteDiskPersistentTotal")
57
+ parachute_disk_persistent_used: StrictInt = Field(alias="parachuteDiskPersistentUsed")
58
+ parachute_disk_persistent_used_percent: StrictInt = Field(alias="parachuteDiskPersistentUsedPercent")
59
+ parachute_disk_persistent_used_threshold: StrictInt = Field(alias="parachuteDiskPersistentUsedThreshold")
60
+ __properties: ClassVar[List[str]] = [
61
+ "cpuIdleTime",
62
+ "cpuLoadPercent",
63
+ "cpuSystemTime",
64
+ "cpuUserTime",
65
+ "diskEphemeralTotal",
66
+ "diskEphemeralUsed",
67
+ "diskPersistentTotal",
68
+ "diskPersistentUsed",
69
+ "load1",
70
+ "load15",
71
+ "load5",
72
+ "memoryTotal",
73
+ "memoryUsed",
74
+ "parachuteDiskEphemeralActivated",
75
+ "parachuteDiskEphemeralTotal",
76
+ "parachuteDiskEphemeralUsed",
77
+ "parachuteDiskEphemeralUsedPercent",
78
+ "parachuteDiskEphemeralUsedThreshold",
79
+ "parachuteDiskPersistentActivated",
80
+ "parachuteDiskPersistentTotal",
81
+ "parachuteDiskPersistentUsed",
82
+ "parachuteDiskPersistentUsedPercent",
83
+ "parachuteDiskPersistentUsedThreshold",
84
+ ]
85
+
86
+ model_config = ConfigDict(
87
+ validate_by_name=True,
88
+ validate_by_alias=True,
89
+ validate_assignment=True,
90
+ protected_namespaces=(),
91
+ )
92
+
93
+ def to_str(self) -> str:
94
+ """Returns the string representation of the model using alias"""
95
+ return pprint.pformat(self.model_dump(by_alias=True))
96
+
97
+ def to_json(self) -> str:
98
+ """Returns the JSON representation of the model using alias"""
99
+ return json.dumps(to_jsonable_python(self.to_dict()))
100
+
101
+ @classmethod
102
+ def from_json(cls, json_str: str) -> Optional[Self]:
103
+ """Create an instance of GetMetricsResponse from a JSON string"""
104
+ return cls.from_dict(json.loads(json_str))
105
+
106
+ def to_dict(self) -> Dict[str, Any]:
107
+ """Return the dictionary representation of the model using alias.
108
+
109
+ This has the following differences from calling pydantic's
110
+ `self.model_dump(by_alias=True)`:
111
+
112
+ * `None` is only added to the output dict for nullable fields that
113
+ were set at model initialization. Other fields with value `None`
114
+ are ignored.
115
+ """
116
+ excluded_fields: Set[str] = set([])
117
+
118
+ _dict = self.model_dump(
119
+ by_alias=True,
120
+ exclude=excluded_fields,
121
+ exclude_none=True,
122
+ )
123
+ return _dict
124
+
125
+ @classmethod
126
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
127
+ """Create an instance of GetMetricsResponse from a dict"""
128
+ if obj is None:
129
+ return None
130
+
131
+ if not isinstance(obj, dict):
132
+ return cls.model_validate(obj)
133
+
134
+ _obj = cls.model_validate(
135
+ {
136
+ "cpuIdleTime": obj.get("cpuIdleTime"),
137
+ "cpuLoadPercent": obj.get("cpuLoadPercent"),
138
+ "cpuSystemTime": obj.get("cpuSystemTime"),
139
+ "cpuUserTime": obj.get("cpuUserTime"),
140
+ "diskEphemeralTotal": obj.get("diskEphemeralTotal"),
141
+ "diskEphemeralUsed": obj.get("diskEphemeralUsed"),
142
+ "diskPersistentTotal": obj.get("diskPersistentTotal"),
143
+ "diskPersistentUsed": obj.get("diskPersistentUsed"),
144
+ "load1": obj.get("load1"),
145
+ "load15": obj.get("load15"),
146
+ "load5": obj.get("load5"),
147
+ "memoryTotal": obj.get("memoryTotal"),
148
+ "memoryUsed": obj.get("memoryUsed"),
149
+ "parachuteDiskEphemeralActivated": obj.get("parachuteDiskEphemeralActivated"),
150
+ "parachuteDiskEphemeralTotal": obj.get("parachuteDiskEphemeralTotal"),
151
+ "parachuteDiskEphemeralUsed": obj.get("parachuteDiskEphemeralUsed"),
152
+ "parachuteDiskEphemeralUsedPercent": obj.get("parachuteDiskEphemeralUsedPercent"),
153
+ "parachuteDiskEphemeralUsedThreshold": obj.get("parachuteDiskEphemeralUsedThreshold"),
154
+ "parachuteDiskPersistentActivated": obj.get("parachuteDiskPersistentActivated"),
155
+ "parachuteDiskPersistentTotal": obj.get("parachuteDiskPersistentTotal"),
156
+ "parachuteDiskPersistentUsed": obj.get("parachuteDiskPersistentUsed"),
157
+ "parachuteDiskPersistentUsedPercent": obj.get("parachuteDiskPersistentUsedPercent"),
158
+ "parachuteDiskPersistentUsedThreshold": obj.get("parachuteDiskPersistentUsedThreshold"),
159
+ }
160
+ )
161
+ return _obj
@@ -0,0 +1,148 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+ from stackit.valkey.models.instance_last_operation import InstanceLastOperation
25
+
26
+
27
+ class Instance(BaseModel):
28
+ """
29
+ Instance
30
+ """ # noqa: E501
31
+
32
+ cf_guid: StrictStr = Field(alias="cfGuid")
33
+ cf_organization_guid: StrictStr = Field(alias="cfOrganizationGuid")
34
+ cf_space_guid: StrictStr = Field(alias="cfSpaceGuid")
35
+ dashboard_url: StrictStr = Field(alias="dashboardUrl")
36
+ image_url: StrictStr = Field(alias="imageUrl")
37
+ instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId")
38
+ last_operation: InstanceLastOperation = Field(alias="lastOperation")
39
+ name: StrictStr
40
+ offering_name: StrictStr = Field(alias="offeringName")
41
+ offering_version: StrictStr = Field(alias="offeringVersion")
42
+ parameters: Dict[str, Any]
43
+ plan_id: StrictStr = Field(alias="planId")
44
+ plan_name: StrictStr = Field(alias="planName")
45
+ status: Optional[StrictStr] = None
46
+ __properties: ClassVar[List[str]] = [
47
+ "cfGuid",
48
+ "cfOrganizationGuid",
49
+ "cfSpaceGuid",
50
+ "dashboardUrl",
51
+ "imageUrl",
52
+ "instanceId",
53
+ "lastOperation",
54
+ "name",
55
+ "offeringName",
56
+ "offeringVersion",
57
+ "parameters",
58
+ "planId",
59
+ "planName",
60
+ "status",
61
+ ]
62
+
63
+ @field_validator("status")
64
+ def status_validate_enum(cls, value):
65
+ """Validates the enum"""
66
+ if value is None:
67
+ return value
68
+
69
+ if value not in set(["active", "failed", "stopped", "creating", "deleting", "updating"]):
70
+ raise ValueError(
71
+ "must be one of enum values ('active', 'failed', 'stopped', 'creating', 'deleting', 'updating')"
72
+ )
73
+ return value
74
+
75
+ model_config = ConfigDict(
76
+ validate_by_name=True,
77
+ validate_by_alias=True,
78
+ validate_assignment=True,
79
+ protected_namespaces=(),
80
+ )
81
+
82
+ def to_str(self) -> str:
83
+ """Returns the string representation of the model using alias"""
84
+ return pprint.pformat(self.model_dump(by_alias=True))
85
+
86
+ def to_json(self) -> str:
87
+ """Returns the JSON representation of the model using alias"""
88
+ return json.dumps(to_jsonable_python(self.to_dict()))
89
+
90
+ @classmethod
91
+ def from_json(cls, json_str: str) -> Optional[Self]:
92
+ """Create an instance of Instance from a JSON string"""
93
+ return cls.from_dict(json.loads(json_str))
94
+
95
+ def to_dict(self) -> Dict[str, Any]:
96
+ """Return the dictionary representation of the model using alias.
97
+
98
+ This has the following differences from calling pydantic's
99
+ `self.model_dump(by_alias=True)`:
100
+
101
+ * `None` is only added to the output dict for nullable fields that
102
+ were set at model initialization. Other fields with value `None`
103
+ are ignored.
104
+ """
105
+ excluded_fields: Set[str] = set([])
106
+
107
+ _dict = self.model_dump(
108
+ by_alias=True,
109
+ exclude=excluded_fields,
110
+ exclude_none=True,
111
+ )
112
+ # override the default output from pydantic by calling `to_dict()` of last_operation
113
+ if self.last_operation:
114
+ _dict["lastOperation"] = self.last_operation.to_dict()
115
+ return _dict
116
+
117
+ @classmethod
118
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119
+ """Create an instance of Instance from a dict"""
120
+ if obj is None:
121
+ return None
122
+
123
+ if not isinstance(obj, dict):
124
+ return cls.model_validate(obj)
125
+
126
+ _obj = cls.model_validate(
127
+ {
128
+ "cfGuid": obj.get("cfGuid"),
129
+ "cfOrganizationGuid": obj.get("cfOrganizationGuid"),
130
+ "cfSpaceGuid": obj.get("cfSpaceGuid"),
131
+ "dashboardUrl": obj.get("dashboardUrl"),
132
+ "imageUrl": obj.get("imageUrl"),
133
+ "instanceId": obj.get("instanceId"),
134
+ "lastOperation": (
135
+ InstanceLastOperation.from_dict(obj["lastOperation"])
136
+ if obj.get("lastOperation") is not None
137
+ else None
138
+ ),
139
+ "name": obj.get("name"),
140
+ "offeringName": obj.get("offeringName"),
141
+ "offeringVersion": obj.get("offeringVersion"),
142
+ "parameters": obj.get("parameters"),
143
+ "planId": obj.get("planId"),
144
+ "planName": obj.get("planName"),
145
+ "status": obj.get("status"),
146
+ }
147
+ )
148
+ return _obj
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+
25
+ class InstanceLastOperation(BaseModel):
26
+ """
27
+ InstanceLastOperation
28
+ """ # noqa: E501
29
+
30
+ description: StrictStr
31
+ state: StrictStr
32
+ type: StrictStr
33
+ __properties: ClassVar[List[str]] = ["description", "state", "type"]
34
+
35
+ @field_validator("state")
36
+ def state_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(["in progress", "succeeded", "failed"]):
39
+ raise ValueError("must be one of enum values ('in progress', 'succeeded', 'failed')")
40
+ return value
41
+
42
+ @field_validator("type")
43
+ def type_validate_enum(cls, value):
44
+ """Validates the enum"""
45
+ if value not in set(["create", "update", "delete"]):
46
+ raise ValueError("must be one of enum values ('create', 'update', 'delete')")
47
+ return value
48
+
49
+ model_config = ConfigDict(
50
+ validate_by_name=True,
51
+ validate_by_alias=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ return json.dumps(to_jsonable_python(self.to_dict()))
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of InstanceLastOperation from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ """
79
+ excluded_fields: Set[str] = set([])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of InstanceLastOperation from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate(
98
+ {"description": obj.get("description"), "state": obj.get("state"), "type": obj.get("type")}
99
+ )
100
+ return _obj
@@ -0,0 +1,240 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import (
21
+ BaseModel,
22
+ ConfigDict,
23
+ Field,
24
+ StrictBool,
25
+ StrictInt,
26
+ StrictStr,
27
+ field_validator,
28
+ )
29
+ from pydantic_core import to_jsonable_python
30
+ from typing_extensions import Annotated, Self
31
+
32
+
33
+ class InstanceParameters(BaseModel):
34
+ """
35
+ InstanceParameters
36
+ """ # noqa: E501
37
+
38
+ down_after_milliseconds: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
39
+ default=10000, description="The unit is milliseconds.", alias="down-after-milliseconds"
40
+ )
41
+ enable_monitoring: Optional[StrictBool] = False
42
+ failover_timeout: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
43
+ default=30000, description="The unit is milliseconds.", alias="failover-timeout"
44
+ )
45
+ graphite: Optional[StrictStr] = Field(
46
+ default=None,
47
+ description="If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to.",
48
+ )
49
+ lazyfree_lazy_eviction: Optional[StrictStr] = Field(default="no", alias="lazyfree-lazy-eviction")
50
+ lazyfree_lazy_expire: Optional[StrictStr] = Field(default="no", alias="lazyfree-lazy-expire")
51
+ lua_time_limit: Optional[StrictInt] = Field(default=5000, alias="lua-time-limit")
52
+ max_disk_threshold: Optional[StrictInt] = Field(
53
+ default=80,
54
+ description="This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node.",
55
+ )
56
+ maxclients: Optional[Annotated[int, Field(strict=True, ge=1)]] = 10000
57
+ maxmemory_policy: Optional[StrictStr] = Field(default="volatile-lru", alias="maxmemory-policy")
58
+ maxmemory_samples: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=5, alias="maxmemory-samples")
59
+ metrics_frequency: Optional[StrictInt] = Field(
60
+ default=10, description="Frequency of metrics being emitted in seconds"
61
+ )
62
+ metrics_prefix: Optional[StrictStr] = Field(
63
+ default=None,
64
+ description="Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example.",
65
+ )
66
+ min_replicas_to_write: Optional[StrictInt] = Field(
67
+ default=1,
68
+ description="The amount of connected replicas that are required for the primary to accept write operations. It can be set to 0 to disable it.",
69
+ alias="min-replicas-to-write",
70
+ )
71
+ min_replicas_max_lag: Optional[StrictInt] = Field(default=10, description="The unit is seconds.")
72
+ monitoring_instance_id: Optional[StrictStr] = None
73
+ notify_keyspace_events: Optional[StrictStr] = Field(
74
+ default="",
75
+ description="The allowed value must include the following characters only: [K,E,g,$,l,s,h,z,x,e,A,t]",
76
+ alias="notify-keyspace-events",
77
+ )
78
+ repl_backlog_size: Optional[StrictStr] = Field(
79
+ default="1mb", description="Set the replication backlog size for the cluster.", alias="repl-backlog-size"
80
+ )
81
+ sgw_acl: Optional[StrictStr] = Field(
82
+ default=None,
83
+ description="Comma separated list of IP networks in CIDR notation which are allowed to access this instance.",
84
+ )
85
+ snapshot: Optional[StrictStr] = Field(
86
+ default=None, description="This setting must follow the original Redis configuration for RDB."
87
+ )
88
+ syslog: Optional[List[StrictStr]] = None
89
+ __properties: ClassVar[List[str]] = [
90
+ "down-after-milliseconds",
91
+ "enable_monitoring",
92
+ "failover-timeout",
93
+ "graphite",
94
+ "lazyfree-lazy-eviction",
95
+ "lazyfree-lazy-expire",
96
+ "lua-time-limit",
97
+ "max_disk_threshold",
98
+ "maxclients",
99
+ "maxmemory-policy",
100
+ "maxmemory-samples",
101
+ "metrics_frequency",
102
+ "metrics_prefix",
103
+ "min-replicas-to-write",
104
+ "min_replicas_max_lag",
105
+ "monitoring_instance_id",
106
+ "notify-keyspace-events",
107
+ "repl-backlog-size",
108
+ "sgw_acl",
109
+ "snapshot",
110
+ "syslog",
111
+ ]
112
+
113
+ @field_validator("lazyfree_lazy_eviction")
114
+ def lazyfree_lazy_eviction_validate_enum(cls, value):
115
+ """Validates the enum"""
116
+ if value is None:
117
+ return value
118
+
119
+ if value not in set(["yes", "no"]):
120
+ raise ValueError("must be one of enum values ('yes', 'no')")
121
+ return value
122
+
123
+ @field_validator("lazyfree_lazy_expire")
124
+ def lazyfree_lazy_expire_validate_enum(cls, value):
125
+ """Validates the enum"""
126
+ if value is None:
127
+ return value
128
+
129
+ if value not in set(["yes", "no"]):
130
+ raise ValueError("must be one of enum values ('yes', 'no')")
131
+ return value
132
+
133
+ @field_validator("maxmemory_policy")
134
+ def maxmemory_policy_validate_enum(cls, value):
135
+ """Validates the enum"""
136
+ if value is None:
137
+ return value
138
+
139
+ if value not in set(
140
+ ["volatile-lru", "allkeys-lru", "volatile-random", "allkeys-random", "volatile-ttl", "noeviction"]
141
+ ):
142
+ raise ValueError(
143
+ "must be one of enum values ('volatile-lru', 'allkeys-lru', 'volatile-random', 'allkeys-random', 'volatile-ttl', 'noeviction')"
144
+ )
145
+ return value
146
+
147
+ model_config = ConfigDict(
148
+ validate_by_name=True,
149
+ validate_by_alias=True,
150
+ validate_assignment=True,
151
+ protected_namespaces=(),
152
+ )
153
+
154
+ def to_str(self) -> str:
155
+ """Returns the string representation of the model using alias"""
156
+ return pprint.pformat(self.model_dump(by_alias=True))
157
+
158
+ def to_json(self) -> str:
159
+ """Returns the JSON representation of the model using alias"""
160
+ return json.dumps(to_jsonable_python(self.to_dict()))
161
+
162
+ @classmethod
163
+ def from_json(cls, json_str: str) -> Optional[Self]:
164
+ """Create an instance of InstanceParameters from a JSON string"""
165
+ return cls.from_dict(json.loads(json_str))
166
+
167
+ def to_dict(self) -> Dict[str, Any]:
168
+ """Return the dictionary representation of the model using alias.
169
+
170
+ This has the following differences from calling pydantic's
171
+ `self.model_dump(by_alias=True)`:
172
+
173
+ * `None` is only added to the output dict for nullable fields that
174
+ were set at model initialization. Other fields with value `None`
175
+ are ignored.
176
+ """
177
+ excluded_fields: Set[str] = set([])
178
+
179
+ _dict = self.model_dump(
180
+ by_alias=True,
181
+ exclude=excluded_fields,
182
+ exclude_none=True,
183
+ )
184
+ return _dict
185
+
186
+ @classmethod
187
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
188
+ """Create an instance of InstanceParameters from a dict"""
189
+ if obj is None:
190
+ return None
191
+
192
+ if not isinstance(obj, dict):
193
+ return cls.model_validate(obj)
194
+
195
+ _obj = cls.model_validate(
196
+ {
197
+ "down-after-milliseconds": (
198
+ obj.get("down-after-milliseconds") if obj.get("down-after-milliseconds") is not None else 10000
199
+ ),
200
+ "enable_monitoring": (
201
+ obj.get("enable_monitoring") if obj.get("enable_monitoring") is not None else False
202
+ ),
203
+ "failover-timeout": obj.get("failover-timeout") if obj.get("failover-timeout") is not None else 30000,
204
+ "graphite": obj.get("graphite"),
205
+ "lazyfree-lazy-eviction": (
206
+ obj.get("lazyfree-lazy-eviction") if obj.get("lazyfree-lazy-eviction") is not None else "no"
207
+ ),
208
+ "lazyfree-lazy-expire": (
209
+ obj.get("lazyfree-lazy-expire") if obj.get("lazyfree-lazy-expire") is not None else "no"
210
+ ),
211
+ "lua-time-limit": obj.get("lua-time-limit") if obj.get("lua-time-limit") is not None else 5000,
212
+ "max_disk_threshold": (
213
+ obj.get("max_disk_threshold") if obj.get("max_disk_threshold") is not None else 80
214
+ ),
215
+ "maxclients": obj.get("maxclients") if obj.get("maxclients") is not None else 10000,
216
+ "maxmemory-policy": (
217
+ obj.get("maxmemory-policy") if obj.get("maxmemory-policy") is not None else "volatile-lru"
218
+ ),
219
+ "maxmemory-samples": obj.get("maxmemory-samples") if obj.get("maxmemory-samples") is not None else 5,
220
+ "metrics_frequency": obj.get("metrics_frequency") if obj.get("metrics_frequency") is not None else 10,
221
+ "metrics_prefix": obj.get("metrics_prefix"),
222
+ "min-replicas-to-write": (
223
+ obj.get("min-replicas-to-write") if obj.get("min-replicas-to-write") is not None else 1
224
+ ),
225
+ "min_replicas_max_lag": (
226
+ obj.get("min_replicas_max_lag") if obj.get("min_replicas_max_lag") is not None else 10
227
+ ),
228
+ "monitoring_instance_id": obj.get("monitoring_instance_id"),
229
+ "notify-keyspace-events": (
230
+ obj.get("notify-keyspace-events") if obj.get("notify-keyspace-events") is not None else ""
231
+ ),
232
+ "repl-backlog-size": (
233
+ obj.get("repl-backlog-size") if obj.get("repl-backlog-size") is not None else "1mb"
234
+ ),
235
+ "sgw_acl": obj.get("sgw_acl"),
236
+ "snapshot": obj.get("snapshot"),
237
+ "syslog": obj.get("syslog"),
238
+ }
239
+ )
240
+ return _obj