Skip to content

Commit 697a449

Browse files
authored
chore(serverless): add fields for advanced scaling options (scaleway#2268)
1 parent e53d760 commit 697a449

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

api/container/v1beta1/container_sdk.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,12 @@ func (enum *TriggerStatus) UnmarshalJSON(data []byte) error {
762762
return nil
763763
}
764764

765+
// ContainerScalingOption: container scaling option.
766+
type ContainerScalingOption struct {
767+
// Precisely one of ConcurrentRequestsThreshold must be set.
768+
ConcurrentRequestsThreshold *uint32 `json:"concurrent_requests_threshold,omitempty"`
769+
}
770+
765771
// SecretHashedValue: secret hashed value.
766772
type SecretHashedValue struct {
767773
Key string `json:"key"`
@@ -933,6 +939,10 @@ type Container struct {
933939
// LocalStorageLimit: local storage limit of the container (in MB).
934940
LocalStorageLimit uint32 `json:"local_storage_limit"`
935941

942+
// ScalingOption: possible values:
943+
// - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
944+
ScalingOption *ContainerScalingOption `json:"scaling_option"`
945+
936946
// Region: region in which the container will be deployed.
937947
Region scw.Region `json:"region"`
938948
}
@@ -1135,7 +1145,7 @@ type CreateContainerRequest struct {
11351145
// RegistryImage: name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
11361146
RegistryImage *string `json:"registry_image,omitempty"`
11371147

1138-
// MaxConcurrency: number of maximum concurrent executions of the container.
1148+
// Deprecated: MaxConcurrency: number of maximum concurrent executions of the container.
11391149
MaxConcurrency *uint32 `json:"max_concurrency,omitempty"`
11401150

11411151
// Protocol: protocol the container uses.
@@ -1160,6 +1170,10 @@ type CreateContainerRequest struct {
11601170

11611171
// LocalStorageLimit: local storage limit of the container (in MB).
11621172
LocalStorageLimit *uint32 `json:"local_storage_limit,omitempty"`
1173+
1174+
// ScalingOption: possible values:
1175+
// - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
1176+
ScalingOption *ContainerScalingOption `json:"scaling_option,omitempty"`
11631177
}
11641178

11651179
// CreateCronRequest: create cron request.
@@ -1723,7 +1737,7 @@ type UpdateContainerRequest struct {
17231737
// RegistryImage: name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
17241738
RegistryImage *string `json:"registry_image,omitempty"`
17251739

1726-
// MaxConcurrency: number of maximum concurrent executions of the container.
1740+
// Deprecated: MaxConcurrency: number of maximum concurrent executions of the container.
17271741
MaxConcurrency *uint32 `json:"max_concurrency,omitempty"`
17281742

17291743
// Protocol: default value: unknown_protocol
@@ -1745,6 +1759,10 @@ type UpdateContainerRequest struct {
17451759

17461760
// LocalStorageLimit: local storage limit of the container (in MB).
17471761
LocalStorageLimit *uint32 `json:"local_storage_limit,omitempty"`
1762+
1763+
// ScalingOption: possible values:
1764+
// - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
1765+
ScalingOption *ContainerScalingOption `json:"scaling_option,omitempty"`
17481766
}
17491767

17501768
// UpdateCronRequest: update cron request.

0 commit comments

Comments
 (0)