beamlit 0.0.24rc20__py3-none-any.whl → 0.0.25__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/chat.py +37 -11
- beamlit/agents/decorator.py +97 -65
- beamlit/api/agents/create_agent.py +9 -14
- beamlit/api/agents/delete_agent.py +22 -1
- beamlit/api/agents/delete_agent_history.py +2 -6
- beamlit/api/agents/get_agent.py +22 -1
- beamlit/api/agents/get_agent_environment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +2 -6
- beamlit/api/agents/get_agent_metrics.py +22 -1
- beamlit/api/agents/list_agent_history.py +11 -11
- beamlit/api/agents/list_agents.py +36 -4
- beamlit/api/agents/put_agent_history.py +2 -6
- beamlit/api/agents/update_agent.py +9 -14
- beamlit/api/functions/create_function.py +9 -14
- beamlit/api/functions/delete_function.py +22 -1
- beamlit/api/functions/get_function.py +22 -1
- beamlit/api/functions/get_function_environment_logs.py +11 -11
- beamlit/api/functions/get_function_metrics.py +22 -1
- beamlit/api/functions/list_functions.py +36 -4
- beamlit/api/functions/update_function.py +9 -14
- beamlit/api/history/get_agents_history.py +12 -12
- beamlit/api/history/list_agents_history.py +12 -12
- beamlit/api/integrations/get_integration_connection.py +16 -12
- beamlit/api/integrations/get_integration_connection_model.py +8 -1
- beamlit/api/integrations/get_integration_model.py +8 -1
- beamlit/api/locations/list_locations.py +12 -12
- beamlit/api/models/create_model.py +13 -14
- beamlit/api/models/delete_model.py +22 -1
- beamlit/api/models/get_model.py +22 -1
- beamlit/api/models/get_model_environment_logs.py +11 -11
- beamlit/api/models/get_model_metrics.py +38 -13
- beamlit/api/models/list_models.py +36 -4
- beamlit/api/models/update_model.py +13 -14
- beamlit/api/privateclusters/__init__.py +0 -0
- beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
- beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
- beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
- beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
- beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
- beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
- beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
- beamlit/authentication/device_mode.py +3 -9
- beamlit/common/generate.py +47 -34
- beamlit/common/settings.py +29 -27
- beamlit/deploy/deploy.py +101 -342
- beamlit/deploy/format.py +70 -0
- beamlit/deploy/parser.py +175 -0
- beamlit/functions/decorator.py +8 -11
- beamlit/models/__init__.py +64 -78
- beamlit/models/acl.py +4 -22
- beamlit/models/agent.py +34 -95
- beamlit/models/agent_history.py +7 -5
- beamlit/models/agent_history_event.py +11 -9
- beamlit/models/agent_metadata.py +5 -3
- beamlit/models/agent_spec.py +54 -45
- beamlit/models/api_key.py +14 -14
- beamlit/models/configuration.py +11 -0
- beamlit/models/core_spec.py +45 -32
- beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
- beamlit/models/environment.py +33 -105
- beamlit/models/environment_metadata.py +146 -0
- beamlit/models/environment_spec.py +8 -6
- beamlit/models/function.py +34 -95
- beamlit/models/function_metadata.py +5 -3
- beamlit/models/function_spec.py +53 -40
- beamlit/models/integration_connection.py +31 -137
- beamlit/models/integration_connection_spec.py +6 -4
- beamlit/models/metadata.py +5 -3
- beamlit/models/metadata_labels.py +4 -2
- beamlit/models/model.py +33 -94
- beamlit/models/model_metadata.py +5 -3
- beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
- beamlit/models/model_provider.py +27 -43
- beamlit/models/model_spec.py +45 -32
- beamlit/models/owner_fields.py +4 -2
- beamlit/models/pending_invitation.py +14 -14
- beamlit/models/pod_template_spec.py +4 -2
- beamlit/models/policy.py +33 -159
- beamlit/models/policy_spec.py +24 -28
- beamlit/models/private_cluster.py +183 -0
- beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
- beamlit/models/resource_deployment_metrics.py +0 -108
- beamlit/models/resource_environment_metrics.py +143 -71
- beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
- beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_log.py +4 -2
- beamlit/models/runtime.py +20 -2
- beamlit/models/serverless_config.py +28 -21
- beamlit/models/spec_configuration.py +7 -5
- beamlit/models/store_agent.py +14 -14
- beamlit/models/store_function.py +14 -14
- beamlit/models/time_fields.py +4 -2
- beamlit/models/websocket_channel.py +4 -2
- beamlit/models/workspace.py +23 -14
- beamlit/run.py +0 -1
- beamlit/serve/app.py +1 -0
- beamlit/serve/middlewares/accesslog.py +3 -1
- {beamlit-0.0.24rc20.dist-info → beamlit-0.0.25.dist-info}/METADATA +1 -1
- beamlit-0.0.25.dist-info/RECORD +243 -0
- beamlit/api/agents/delete_agent_deployment.py +0 -163
- beamlit/api/agents/delete_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_logs.py +0 -164
- beamlit/api/agents/list_agent_deployment_history.py +0 -164
- beamlit/api/agents/put_agent_deployment.py +0 -185
- beamlit/api/agents/put_agent_deployment_history.py +0 -198
- beamlit/api/functions/delete_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment_logs.py +0 -164
- beamlit/api/functions/get_function_deployment_metrics.py +0 -159
- beamlit/api/functions/put_function_deployment.py +0 -185
- beamlit/api/models/delete_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment_logs.py +0 -168
- beamlit/api/models/get_model_deployment_metrics.py +0 -163
- beamlit/api/models/put_model_deployment.py +0 -193
- beamlit/models/agent_configuration.py +0 -70
- beamlit/models/agent_deployment.py +0 -340
- beamlit/models/agent_deployment_configuration.py +0 -45
- beamlit/models/agent_deployment_configuration_type_0.py +0 -43
- beamlit/models/agent_deployment_history.py +0 -185
- beamlit/models/agent_deployment_history_event.py +0 -133
- beamlit/models/agent_deployment_pod_template.py +0 -45
- beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
- beamlit/models/agent_with_deployments.py +0 -176
- beamlit/models/authentication_provider_model.py +0 -144
- beamlit/models/authentication_provider_organization.py +0 -88
- beamlit/models/deployment_configuration.py +0 -70
- beamlit/models/deployment_configurations.py +0 -58
- beamlit/models/deployment_serverless_config.py +0 -131
- beamlit/models/deployment_serverless_config_type_0.py +0 -220
- beamlit/models/function_configuration.py +0 -70
- beamlit/models/function_deployment.py +0 -340
- beamlit/models/function_deployment_configuration.py +0 -45
- beamlit/models/function_deployment_configuration_type_0.py +0 -43
- beamlit/models/function_deployment_pod_template.py +0 -45
- beamlit/models/function_deployment_pod_template_type_0.py +0 -43
- beamlit/models/function_with_deployments.py +0 -176
- beamlit/models/integration.py +0 -198
- beamlit/models/integration_config.py +0 -45
- beamlit/models/integration_secret.py +0 -61
- beamlit/models/labels_type_0.py +0 -45
- beamlit/models/location.py +0 -122
- beamlit/models/model_deployment.py +0 -296
- beamlit/models/model_deployment_log.py +0 -70
- beamlit/models/model_deployment_metrics.py +0 -172
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
- beamlit/models/model_deployment_pod_template.py +0 -45
- beamlit/models/model_deployment_pod_template_type_0.py +0 -43
- beamlit/models/model_metrics.py +0 -96
- beamlit/models/model_with_deployments.py +0 -176
- beamlit/models/resource_deployment_log.py +0 -70
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
- beamlit/models/runtime_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0.py +0 -111
- beamlit/models/runtime_type_0_readiness_probe.py +0 -43
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0_resources.py +0 -59
- beamlit/models/standard_fields_dynamo_db.py +0 -88
- beamlit/models/store_agent_configuration.py +0 -97
- beamlit/models/store_agent_labels_type_0.py +0 -43
- beamlit/models/store_function_configuration.py +0 -97
- beamlit/models/store_function_labels_type_0.py +0 -43
- beamlit-0.0.24rc20.dist-info/RECORD +0 -303
- {beamlit-0.0.24rc20.dist-info → beamlit-0.0.25.dist-info}/WHEEL +0 -0
@@ -1,58 +0,0 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar
|
2
|
-
|
3
|
-
from attrs import define as _attrs_define
|
4
|
-
from attrs import field as _attrs_field
|
5
|
-
|
6
|
-
if TYPE_CHECKING:
|
7
|
-
from ..models.deployment_configuration import DeploymentConfiguration
|
8
|
-
|
9
|
-
|
10
|
-
T = TypeVar("T", bound="DeploymentConfigurations")
|
11
|
-
|
12
|
-
|
13
|
-
@_attrs_define
|
14
|
-
class DeploymentConfigurations:
|
15
|
-
"""Deployment configurations key value and also a boolean secret to specify if it should be stored in secret manager"""
|
16
|
-
|
17
|
-
additional_properties: dict[str, "DeploymentConfiguration"] = _attrs_field(init=False, factory=dict)
|
18
|
-
|
19
|
-
def to_dict(self) -> dict[str, Any]:
|
20
|
-
field_dict: dict[str, Any] = {}
|
21
|
-
for prop_name, prop in self.additional_properties.items():
|
22
|
-
field_dict[prop_name] = prop.to_dict()
|
23
|
-
|
24
|
-
return field_dict
|
25
|
-
|
26
|
-
@classmethod
|
27
|
-
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
28
|
-
from ..models.deployment_configuration import DeploymentConfiguration
|
29
|
-
|
30
|
-
if not src_dict:
|
31
|
-
return None
|
32
|
-
d = src_dict.copy()
|
33
|
-
deployment_configurations = cls()
|
34
|
-
|
35
|
-
additional_properties = {}
|
36
|
-
for prop_name, prop_dict in d.items():
|
37
|
-
additional_property = DeploymentConfiguration.from_dict(prop_dict)
|
38
|
-
|
39
|
-
additional_properties[prop_name] = additional_property
|
40
|
-
|
41
|
-
deployment_configurations.additional_properties = additional_properties
|
42
|
-
return deployment_configurations
|
43
|
-
|
44
|
-
@property
|
45
|
-
def additional_keys(self) -> list[str]:
|
46
|
-
return list(self.additional_properties.keys())
|
47
|
-
|
48
|
-
def __getitem__(self, key: str) -> "DeploymentConfiguration":
|
49
|
-
return self.additional_properties[key]
|
50
|
-
|
51
|
-
def __setitem__(self, key: str, value: "DeploymentConfiguration") -> None:
|
52
|
-
self.additional_properties[key] = value
|
53
|
-
|
54
|
-
def __delitem__(self, key: str) -> None:
|
55
|
-
del self.additional_properties[key]
|
56
|
-
|
57
|
-
def __contains__(self, key: str) -> bool:
|
58
|
-
return key in self.additional_properties
|
@@ -1,131 +0,0 @@
|
|
1
|
-
from typing import Any, TypeVar, Union
|
2
|
-
|
3
|
-
from attrs import define as _attrs_define
|
4
|
-
from attrs import field as _attrs_field
|
5
|
-
|
6
|
-
from ..types import UNSET, Unset
|
7
|
-
|
8
|
-
T = TypeVar("T", bound="DeploymentServerlessConfig")
|
9
|
-
|
10
|
-
|
11
|
-
@_attrs_define
|
12
|
-
class DeploymentServerlessConfig:
|
13
|
-
"""Configuration for a serverless deployment
|
14
|
-
|
15
|
-
Attributes:
|
16
|
-
last_pod_retention_period (Union[Unset, str]): The minimum amount of time that the last replica will remain
|
17
|
-
active AFTER a scale-to-zero decision is made
|
18
|
-
max_num_replicas (Union[Unset, int]): The maximum number of replicas for the deployment.
|
19
|
-
metric (Union[Unset, str]): Metric watched to make scaling decisions. Can be "cpu" or "memory" or "rps" or
|
20
|
-
"concurrency"
|
21
|
-
min_num_replicas (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which
|
22
|
-
case the deployment is always running in at least one location).
|
23
|
-
scale_down_delay (Union[Unset, str]): The time window which must pass at reduced concurrency before a scale-down
|
24
|
-
decision is applied. This can be useful, for example, to keep containers around for a configurable duration to
|
25
|
-
avoid a cold start penalty if new requests come in.
|
26
|
-
scale_up_minimum (Union[Unset, int]): The minimum number of replicas that will be created when the deployment
|
27
|
-
scales up from zero.
|
28
|
-
stable_window (Union[Unset, str]): The sliding time window over which metrics are averaged to provide the input
|
29
|
-
for scaling decisions
|
30
|
-
target (Union[Unset, str]): Target value for the watched metric
|
31
|
-
"""
|
32
|
-
|
33
|
-
last_pod_retention_period: Union[Unset, str] = UNSET
|
34
|
-
max_num_replicas: Union[Unset, int] = UNSET
|
35
|
-
metric: Union[Unset, str] = UNSET
|
36
|
-
min_num_replicas: Union[Unset, int] = UNSET
|
37
|
-
scale_down_delay: Union[Unset, str] = UNSET
|
38
|
-
scale_up_minimum: Union[Unset, int] = UNSET
|
39
|
-
stable_window: Union[Unset, str] = UNSET
|
40
|
-
target: Union[Unset, str] = UNSET
|
41
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
|
-
|
43
|
-
def to_dict(self) -> dict[str, Any]:
|
44
|
-
last_pod_retention_period = self.last_pod_retention_period
|
45
|
-
|
46
|
-
max_num_replicas = self.max_num_replicas
|
47
|
-
|
48
|
-
metric = self.metric
|
49
|
-
|
50
|
-
min_num_replicas = self.min_num_replicas
|
51
|
-
|
52
|
-
scale_down_delay = self.scale_down_delay
|
53
|
-
|
54
|
-
scale_up_minimum = self.scale_up_minimum
|
55
|
-
|
56
|
-
stable_window = self.stable_window
|
57
|
-
|
58
|
-
target = self.target
|
59
|
-
|
60
|
-
field_dict: dict[str, Any] = {}
|
61
|
-
field_dict.update(self.additional_properties)
|
62
|
-
field_dict.update({})
|
63
|
-
if last_pod_retention_period is not UNSET:
|
64
|
-
field_dict["last_pod_retention_period"] = last_pod_retention_period
|
65
|
-
if max_num_replicas is not UNSET:
|
66
|
-
field_dict["max_num_replicas"] = max_num_replicas
|
67
|
-
if metric is not UNSET:
|
68
|
-
field_dict["metric"] = metric
|
69
|
-
if min_num_replicas is not UNSET:
|
70
|
-
field_dict["min_num_replicas"] = min_num_replicas
|
71
|
-
if scale_down_delay is not UNSET:
|
72
|
-
field_dict["scale_down_delay"] = scale_down_delay
|
73
|
-
if scale_up_minimum is not UNSET:
|
74
|
-
field_dict["scale_up_minimum"] = scale_up_minimum
|
75
|
-
if stable_window is not UNSET:
|
76
|
-
field_dict["stable_window"] = stable_window
|
77
|
-
if target is not UNSET:
|
78
|
-
field_dict["target"] = target
|
79
|
-
|
80
|
-
return field_dict
|
81
|
-
|
82
|
-
@classmethod
|
83
|
-
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
84
|
-
if not src_dict:
|
85
|
-
return None
|
86
|
-
d = src_dict.copy()
|
87
|
-
last_pod_retention_period = d.pop("last_pod_retention_period", UNSET)
|
88
|
-
|
89
|
-
max_num_replicas = d.pop("max_num_replicas", UNSET)
|
90
|
-
|
91
|
-
metric = d.pop("metric", UNSET)
|
92
|
-
|
93
|
-
min_num_replicas = d.pop("min_num_replicas", UNSET)
|
94
|
-
|
95
|
-
scale_down_delay = d.pop("scale_down_delay", UNSET)
|
96
|
-
|
97
|
-
scale_up_minimum = d.pop("scale_up_minimum", UNSET)
|
98
|
-
|
99
|
-
stable_window = d.pop("stable_window", UNSET)
|
100
|
-
|
101
|
-
target = d.pop("target", UNSET)
|
102
|
-
|
103
|
-
deployment_serverless_config = cls(
|
104
|
-
last_pod_retention_period=last_pod_retention_period,
|
105
|
-
max_num_replicas=max_num_replicas,
|
106
|
-
metric=metric,
|
107
|
-
min_num_replicas=min_num_replicas,
|
108
|
-
scale_down_delay=scale_down_delay,
|
109
|
-
scale_up_minimum=scale_up_minimum,
|
110
|
-
stable_window=stable_window,
|
111
|
-
target=target,
|
112
|
-
)
|
113
|
-
|
114
|
-
deployment_serverless_config.additional_properties = d
|
115
|
-
return deployment_serverless_config
|
116
|
-
|
117
|
-
@property
|
118
|
-
def additional_keys(self) -> list[str]:
|
119
|
-
return list(self.additional_properties.keys())
|
120
|
-
|
121
|
-
def __getitem__(self, key: str) -> Any:
|
122
|
-
return self.additional_properties[key]
|
123
|
-
|
124
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
125
|
-
self.additional_properties[key] = value
|
126
|
-
|
127
|
-
def __delitem__(self, key: str) -> None:
|
128
|
-
del self.additional_properties[key]
|
129
|
-
|
130
|
-
def __contains__(self, key: str) -> bool:
|
131
|
-
return key in self.additional_properties
|
@@ -1,220 +0,0 @@
|
|
1
|
-
from typing import Any, Type, TypeVar, Union, cast
|
2
|
-
|
3
|
-
from attrs import define as _attrs_define
|
4
|
-
from attrs import field as _attrs_field
|
5
|
-
|
6
|
-
from ..types import UNSET, Unset
|
7
|
-
|
8
|
-
T = TypeVar("T", bound="DeploymentServerlessConfigType0")
|
9
|
-
|
10
|
-
|
11
|
-
@_attrs_define
|
12
|
-
class DeploymentServerlessConfigType0:
|
13
|
-
"""Configuration for a serverless deployment
|
14
|
-
|
15
|
-
Attributes:
|
16
|
-
last_pod_retention_period (Union[None, Unset, str]): The minimum amount of time that the last replica will
|
17
|
-
remain active AFTER a scale-to-zero decision is made
|
18
|
-
max_num_replicas (Union[None, Unset, int]): The maximum number of replicas for the deployment.
|
19
|
-
metric (Union[None, Unset, str]): Metric watched to make scaling decisions. Can be "cpu" or "memory" or "rps" or
|
20
|
-
"concurrency"
|
21
|
-
min_num_replicas (Union[None, Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in
|
22
|
-
which case the deployment is always running in at least one location).
|
23
|
-
scale_down_delay (Union[None, Unset, str]): The time window which must pass at reduced concurrency before a
|
24
|
-
scale-down decision is applied. This can be useful, for example, to keep containers around for a configurable
|
25
|
-
duration to avoid a cold start penalty if new requests come in.
|
26
|
-
scale_up_minimum (Union[None, Unset, int]): The minimum number of replicas that will be created when the
|
27
|
-
deployment scales up from zero.
|
28
|
-
stable_window (Union[None, Unset, str]): The sliding time window over which metrics are averaged to provide the
|
29
|
-
input for scaling decisions
|
30
|
-
target (Union[None, Unset, str]): Target value for the watched metric
|
31
|
-
"""
|
32
|
-
|
33
|
-
last_pod_retention_period: Union[None, Unset, str] = UNSET
|
34
|
-
max_num_replicas: Union[None, Unset, int] = UNSET
|
35
|
-
metric: Union[None, Unset, str] = UNSET
|
36
|
-
min_num_replicas: Union[None, Unset, int] = UNSET
|
37
|
-
scale_down_delay: Union[None, Unset, str] = UNSET
|
38
|
-
scale_up_minimum: Union[None, Unset, int] = UNSET
|
39
|
-
stable_window: Union[None, Unset, str] = UNSET
|
40
|
-
target: Union[None, Unset, str] = UNSET
|
41
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
|
-
|
43
|
-
def to_dict(self) -> dict[str, Any]:
|
44
|
-
last_pod_retention_period: Union[None, Unset, str]
|
45
|
-
if isinstance(self.last_pod_retention_period, Unset):
|
46
|
-
last_pod_retention_period = UNSET
|
47
|
-
else:
|
48
|
-
last_pod_retention_period = self.last_pod_retention_period
|
49
|
-
|
50
|
-
max_num_replicas: Union[None, Unset, int]
|
51
|
-
if isinstance(self.max_num_replicas, Unset):
|
52
|
-
max_num_replicas = UNSET
|
53
|
-
else:
|
54
|
-
max_num_replicas = self.max_num_replicas
|
55
|
-
|
56
|
-
metric: Union[None, Unset, str]
|
57
|
-
if isinstance(self.metric, Unset):
|
58
|
-
metric = UNSET
|
59
|
-
else:
|
60
|
-
metric = self.metric
|
61
|
-
|
62
|
-
min_num_replicas: Union[None, Unset, int]
|
63
|
-
if isinstance(self.min_num_replicas, Unset):
|
64
|
-
min_num_replicas = UNSET
|
65
|
-
else:
|
66
|
-
min_num_replicas = self.min_num_replicas
|
67
|
-
|
68
|
-
scale_down_delay: Union[None, Unset, str]
|
69
|
-
if isinstance(self.scale_down_delay, Unset):
|
70
|
-
scale_down_delay = UNSET
|
71
|
-
else:
|
72
|
-
scale_down_delay = self.scale_down_delay
|
73
|
-
|
74
|
-
scale_up_minimum: Union[None, Unset, int]
|
75
|
-
if isinstance(self.scale_up_minimum, Unset):
|
76
|
-
scale_up_minimum = UNSET
|
77
|
-
else:
|
78
|
-
scale_up_minimum = self.scale_up_minimum
|
79
|
-
|
80
|
-
stable_window: Union[None, Unset, str]
|
81
|
-
if isinstance(self.stable_window, Unset):
|
82
|
-
stable_window = UNSET
|
83
|
-
else:
|
84
|
-
stable_window = self.stable_window
|
85
|
-
|
86
|
-
target: Union[None, Unset, str]
|
87
|
-
if isinstance(self.target, Unset):
|
88
|
-
target = UNSET
|
89
|
-
else:
|
90
|
-
target = self.target
|
91
|
-
|
92
|
-
field_dict: dict[str, Any] = {}
|
93
|
-
field_dict.update(self.additional_properties)
|
94
|
-
field_dict.update({})
|
95
|
-
if last_pod_retention_period is not UNSET:
|
96
|
-
field_dict["last_pod_retention_period"] = last_pod_retention_period
|
97
|
-
if max_num_replicas is not UNSET:
|
98
|
-
field_dict["max_num_replicas"] = max_num_replicas
|
99
|
-
if metric is not UNSET:
|
100
|
-
field_dict["metric"] = metric
|
101
|
-
if min_num_replicas is not UNSET:
|
102
|
-
field_dict["min_num_replicas"] = min_num_replicas
|
103
|
-
if scale_down_delay is not UNSET:
|
104
|
-
field_dict["scale_down_delay"] = scale_down_delay
|
105
|
-
if scale_up_minimum is not UNSET:
|
106
|
-
field_dict["scale_up_minimum"] = scale_up_minimum
|
107
|
-
if stable_window is not UNSET:
|
108
|
-
field_dict["stable_window"] = stable_window
|
109
|
-
if target is not UNSET:
|
110
|
-
field_dict["target"] = target
|
111
|
-
|
112
|
-
return field_dict
|
113
|
-
|
114
|
-
@classmethod
|
115
|
-
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
116
|
-
d = src_dict.copy()
|
117
|
-
|
118
|
-
def _parse_last_pod_retention_period(data: object) -> Union[None, Unset, str]:
|
119
|
-
if data is None:
|
120
|
-
return data
|
121
|
-
if isinstance(data, Unset):
|
122
|
-
return data
|
123
|
-
return cast(Union[None, Unset, str], data)
|
124
|
-
|
125
|
-
last_pod_retention_period = _parse_last_pod_retention_period(
|
126
|
-
d.pop("last_pod_retention_period", UNSET)
|
127
|
-
)
|
128
|
-
|
129
|
-
def _parse_max_num_replicas(data: object) -> Union[None, Unset, int]:
|
130
|
-
if data is None:
|
131
|
-
return data
|
132
|
-
if isinstance(data, Unset):
|
133
|
-
return data
|
134
|
-
return cast(Union[None, Unset, int], data)
|
135
|
-
|
136
|
-
max_num_replicas = _parse_max_num_replicas(d.pop("max_num_replicas", UNSET))
|
137
|
-
|
138
|
-
def _parse_metric(data: object) -> Union[None, Unset, str]:
|
139
|
-
if data is None:
|
140
|
-
return data
|
141
|
-
if isinstance(data, Unset):
|
142
|
-
return data
|
143
|
-
return cast(Union[None, Unset, str], data)
|
144
|
-
|
145
|
-
metric = _parse_metric(d.pop("metric", UNSET))
|
146
|
-
|
147
|
-
def _parse_min_num_replicas(data: object) -> Union[None, Unset, int]:
|
148
|
-
if data is None:
|
149
|
-
return data
|
150
|
-
if isinstance(data, Unset):
|
151
|
-
return data
|
152
|
-
return cast(Union[None, Unset, int], data)
|
153
|
-
|
154
|
-
min_num_replicas = _parse_min_num_replicas(d.pop("min_num_replicas", UNSET))
|
155
|
-
|
156
|
-
def _parse_scale_down_delay(data: object) -> Union[None, Unset, str]:
|
157
|
-
if data is None:
|
158
|
-
return data
|
159
|
-
if isinstance(data, Unset):
|
160
|
-
return data
|
161
|
-
return cast(Union[None, Unset, str], data)
|
162
|
-
|
163
|
-
scale_down_delay = _parse_scale_down_delay(d.pop("scale_down_delay", UNSET))
|
164
|
-
|
165
|
-
def _parse_scale_up_minimum(data: object) -> Union[None, Unset, int]:
|
166
|
-
if data is None:
|
167
|
-
return data
|
168
|
-
if isinstance(data, Unset):
|
169
|
-
return data
|
170
|
-
return cast(Union[None, Unset, int], data)
|
171
|
-
|
172
|
-
scale_up_minimum = _parse_scale_up_minimum(d.pop("scale_up_minimum", UNSET))
|
173
|
-
|
174
|
-
def _parse_stable_window(data: object) -> Union[None, Unset, str]:
|
175
|
-
if data is None:
|
176
|
-
return data
|
177
|
-
if isinstance(data, Unset):
|
178
|
-
return data
|
179
|
-
return cast(Union[None, Unset, str], data)
|
180
|
-
|
181
|
-
stable_window = _parse_stable_window(d.pop("stable_window", UNSET))
|
182
|
-
|
183
|
-
def _parse_target(data: object) -> Union[None, Unset, str]:
|
184
|
-
if data is None:
|
185
|
-
return data
|
186
|
-
if isinstance(data, Unset):
|
187
|
-
return data
|
188
|
-
return cast(Union[None, Unset, str], data)
|
189
|
-
|
190
|
-
target = _parse_target(d.pop("target", UNSET))
|
191
|
-
|
192
|
-
deployment_serverless_config_type_0 = cls(
|
193
|
-
last_pod_retention_period=last_pod_retention_period,
|
194
|
-
max_num_replicas=max_num_replicas,
|
195
|
-
metric=metric,
|
196
|
-
min_num_replicas=min_num_replicas,
|
197
|
-
scale_down_delay=scale_down_delay,
|
198
|
-
scale_up_minimum=scale_up_minimum,
|
199
|
-
stable_window=stable_window,
|
200
|
-
target=target,
|
201
|
-
)
|
202
|
-
|
203
|
-
deployment_serverless_config_type_0.additional_properties = d
|
204
|
-
return deployment_serverless_config_type_0
|
205
|
-
|
206
|
-
@property
|
207
|
-
def additional_keys(self) -> list[str]:
|
208
|
-
return list(self.additional_properties.keys())
|
209
|
-
|
210
|
-
def __getitem__(self, key: str) -> Any:
|
211
|
-
return self.additional_properties[key]
|
212
|
-
|
213
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
214
|
-
self.additional_properties[key] = value
|
215
|
-
|
216
|
-
def __delitem__(self, key: str) -> None:
|
217
|
-
del self.additional_properties[key]
|
218
|
-
|
219
|
-
def __contains__(self, key: str) -> bool:
|
220
|
-
return key in self.additional_properties
|
@@ -1,70 +0,0 @@
|
|
1
|
-
from typing import Any, TypeVar, Union
|
2
|
-
|
3
|
-
from attrs import define as _attrs_define
|
4
|
-
from attrs import field as _attrs_field
|
5
|
-
|
6
|
-
from ..types import UNSET, Unset
|
7
|
-
|
8
|
-
T = TypeVar("T", bound="FunctionConfiguration")
|
9
|
-
|
10
|
-
|
11
|
-
@_attrs_define
|
12
|
-
class FunctionConfiguration:
|
13
|
-
"""Function configuration, this is a key value storage. In your function you can retrieve the value with config[key]
|
14
|
-
|
15
|
-
Attributes:
|
16
|
-
secret (Union[Unset, bool]): Function configuration secret
|
17
|
-
value (Union[Unset, str]): Function configuration value
|
18
|
-
"""
|
19
|
-
|
20
|
-
secret: Union[Unset, bool] = UNSET
|
21
|
-
value: Union[Unset, str] = UNSET
|
22
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
-
|
24
|
-
def to_dict(self) -> dict[str, Any]:
|
25
|
-
secret = self.secret
|
26
|
-
|
27
|
-
value = self.value
|
28
|
-
|
29
|
-
field_dict: dict[str, Any] = {}
|
30
|
-
field_dict.update(self.additional_properties)
|
31
|
-
field_dict.update({})
|
32
|
-
if secret is not UNSET:
|
33
|
-
field_dict["secret"] = secret
|
34
|
-
if value is not UNSET:
|
35
|
-
field_dict["value"] = value
|
36
|
-
|
37
|
-
return field_dict
|
38
|
-
|
39
|
-
@classmethod
|
40
|
-
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
-
if not src_dict:
|
42
|
-
return None
|
43
|
-
d = src_dict.copy()
|
44
|
-
secret = d.pop("secret", UNSET)
|
45
|
-
|
46
|
-
value = d.pop("value", UNSET)
|
47
|
-
|
48
|
-
function_configuration = cls(
|
49
|
-
secret=secret,
|
50
|
-
value=value,
|
51
|
-
)
|
52
|
-
|
53
|
-
function_configuration.additional_properties = d
|
54
|
-
return function_configuration
|
55
|
-
|
56
|
-
@property
|
57
|
-
def additional_keys(self) -> list[str]:
|
58
|
-
return list(self.additional_properties.keys())
|
59
|
-
|
60
|
-
def __getitem__(self, key: str) -> Any:
|
61
|
-
return self.additional_properties[key]
|
62
|
-
|
63
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
-
self.additional_properties[key] = value
|
65
|
-
|
66
|
-
def __delitem__(self, key: str) -> None:
|
67
|
-
del self.additional_properties[key]
|
68
|
-
|
69
|
-
def __contains__(self, key: str) -> bool:
|
70
|
-
return key in self.additional_properties
|