Skip to content

Commit

Permalink
ECIScalingConfiguration add lifecycle params.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk-team committed Jan 23, 2024
1 parent df052a7 commit 6e70670
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 69 deletions.
3 changes: 3 additions & 0 deletions aliyun-python-sdk-ess/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-01-23 Version: 2.3.17
- ECIScalingConfiguration add lifecycle params.

2023-12-06 Version: 2.3.16
- ScaleWithAdjustment supports ECI overrides.

Expand Down
2 changes: 1 addition & 1 deletion aliyun-python-sdk-ess/aliyunsdkess/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.16'
__version__ = '2.3.17'
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,19 @@ def set_Containers(self, Container): # RepeatList
for depth1 in range(len(Container)):
if Container[depth1].get('Stdin') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Stdin', Container[depth1].get('Stdin'))
if Container[depth1].get('Memory') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Memory', Container[depth1].get('Memory'))
if Container[depth1].get('LivenessProbe.Exec.Command') is not None:
for depth2 in range(len(Container[depth1].get('LivenessProbe.Exec.Command'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.Exec.Command.' + str(depth2 + 1), Container[depth1].get('LivenessProbe.Exec.Command')[depth2])
if Container[depth1].get('LifecyclePostStartHandlerHttpGetPort') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerHttpGetPort', Container[depth1].get('LifecyclePostStartHandlerHttpGetPort'))
if Container[depth1].get('WorkingDir') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.WorkingDir', Container[depth1].get('WorkingDir'))
if Container[depth1].get('ReadinessProbe.HttpGet.Port') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.HttpGet.Port', Container[depth1].get('ReadinessProbe.HttpGet.Port'))
if Container[depth1].get('ReadinessProbe.FailureThreshold') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.FailureThreshold', Container[depth1].get('ReadinessProbe.FailureThreshold'))
if Container[depth1].get('LivenessProbe.HttpGet.Port') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.HttpGet.Port', Container[depth1].get('LivenessProbe.HttpGet.Port'))
if Container[depth1].get('Arg') is not None:
for depth2 in range(len(Container[depth1].get('Arg'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.Arg.' + str(depth2 + 1), Container[depth1].get('Arg')[depth2])
if Container[depth1].get('ReadinessProbe.SuccessThreshold') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.SuccessThreshold', Container[depth1].get('ReadinessProbe.SuccessThreshold'))
if Container[depth1].get('LifecyclePreStopHandlerTcpSocketPort') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerTcpSocketPort', Container[depth1].get('LifecyclePreStopHandlerTcpSocketPort'))
if Container[depth1].get('VolumeMount') is not None:
for depth2 in range(len(Container[depth1].get('VolumeMount'))):
if Container[depth1].get('VolumeMount')[depth2].get('MountPath') is not None:
Expand All @@ -70,49 +65,88 @@ def set_Containers(self, Container): # RepeatList
self.add_query_param('Container.' + str(depth1 + 1) + '.VolumeMount.' + str(depth2 + 1) + '.SubPath', Container[depth1].get('VolumeMount')[depth2].get('SubPath'))
if Container[depth1].get('Image') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Image', Container[depth1].get('Image'))
if Container[depth1].get('SecurityContext.Capability.Add') is not None:
for depth2 in range(len(Container[depth1].get('SecurityContext.Capability.Add'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.SecurityContext.Capability.Add.' + str(depth2 + 1), Container[depth1].get('SecurityContext.Capability.Add')[depth2])
if Container[depth1].get('ReadinessProbe.InitialDelaySeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.InitialDelaySeconds', Container[depth1].get('ReadinessProbe.InitialDelaySeconds'))
if Container[depth1].get('LifecyclePostStartHandlerExec') is not None:
for depth2 in range(len(Container[depth1].get('LifecyclePostStartHandlerExec'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerExec.' + str(depth2 + 1), Container[depth1].get('LifecyclePostStartHandlerExec')[depth2])
if Container[depth1].get('Cpu') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Cpu', Container[depth1].get('Cpu'))
if Container[depth1].get('ReadinessProbe.Exec.Command') is not None:
for depth2 in range(len(Container[depth1].get('ReadinessProbe.Exec.Command'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.Exec.Command.' + str(depth2 + 1), Container[depth1].get('ReadinessProbe.Exec.Command')[depth2])
if Container[depth1].get('ReadinessProbe.HttpGet.Scheme') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.HttpGet.Scheme', Container[depth1].get('ReadinessProbe.HttpGet.Scheme'))
if Container[depth1].get('ReadinessProbe.HttpGet.Path') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.HttpGet.Path', Container[depth1].get('ReadinessProbe.HttpGet.Path'))
if Container[depth1].get('Gpu') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Gpu', Container[depth1].get('Gpu'))
if Container[depth1].get('StdinOnce') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.StdinOnce', Container[depth1].get('StdinOnce'))
if Container[depth1].get('ImagePullPolicy') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ImagePullPolicy', Container[depth1].get('ImagePullPolicy'))
if Container[depth1].get('Command') is not None:
for depth2 in range(len(Container[depth1].get('Command'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.Command.' + str(depth2 + 1), Container[depth1].get('Command')[depth2])
if Container[depth1].get('LifecyclePostStartHandlerTcpSocketHost') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerTcpSocketHost', Container[depth1].get('LifecyclePostStartHandlerTcpSocketHost'))
if Container[depth1].get('LivenessProbe.SuccessThreshold') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.SuccessThreshold', Container[depth1].get('LivenessProbe.SuccessThreshold'))
if Container[depth1].get('SecurityContext.RunAsUser') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.SecurityContext.RunAsUser', Container[depth1].get('SecurityContext.RunAsUser'))
if Container[depth1].get('LivenessProbe.HttpGet.Path') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.HttpGet.Path', Container[depth1].get('LivenessProbe.HttpGet.Path'))
if Container[depth1].get('LivenessProbe.PeriodSeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.PeriodSeconds', Container[depth1].get('LivenessProbe.PeriodSeconds'))
if Container[depth1].get('LivenessProbe.InitialDelaySeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.InitialDelaySeconds', Container[depth1].get('LivenessProbe.InitialDelaySeconds'))
if Container[depth1].get('LivenessProbe.TimeoutSeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.TimeoutSeconds', Container[depth1].get('LivenessProbe.TimeoutSeconds'))
if Container[depth1].get('LivenessProbe.TcpSocket.Port') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.TcpSocket.Port', Container[depth1].get('LivenessProbe.TcpSocket.Port'))
if Container[depth1].get('Port') is not None:
for depth2 in range(len(Container[depth1].get('Port'))):
if Container[depth1].get('Port')[depth2].get('Protocol') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Port.' + str(depth2 + 1) + '.Protocol', Container[depth1].get('Port')[depth2].get('Protocol'))
if Container[depth1].get('Port')[depth2].get('Port') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Port.' + str(depth2 + 1) + '.Port', Container[depth1].get('Port')[depth2].get('Port'))
if Container[depth1].get('Name') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Name', Container[depth1].get('Name'))
if Container[depth1].get('LifecyclePreStopHandlerTcpSocketHost') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerTcpSocketHost', Container[depth1].get('LifecyclePreStopHandlerTcpSocketHost'))
if Container[depth1].get('SecurityContext.ReadOnlyRootFilesystem') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.SecurityContext.ReadOnlyRootFilesystem', Container[depth1].get('SecurityContext.ReadOnlyRootFilesystem'))
if Container[depth1].get('LifecyclePreStopHandlerHttpGetHost') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerHttpGetHost', Container[depth1].get('LifecyclePreStopHandlerHttpGetHost'))
if Container[depth1].get('Memory') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Memory', Container[depth1].get('Memory'))
if Container[depth1].get('LifecyclePreStopHandlerHttpGetScheme') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerHttpGetScheme', Container[depth1].get('LifecyclePreStopHandlerHttpGetScheme'))
if Container[depth1].get('LifecyclePostStartHandlerTcpSocketPort') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerTcpSocketPort', Container[depth1].get('LifecyclePostStartHandlerTcpSocketPort'))
if Container[depth1].get('LifecyclePreStopHandlerHttpGetPath') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerHttpGetPath', Container[depth1].get('LifecyclePreStopHandlerHttpGetPath'))
if Container[depth1].get('LifecyclePostStartHandlerHttpGetHost') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerHttpGetHost', Container[depth1].get('LifecyclePostStartHandlerHttpGetHost'))
if Container[depth1].get('ReadinessProbe.FailureThreshold') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.FailureThreshold', Container[depth1].get('ReadinessProbe.FailureThreshold'))
if Container[depth1].get('Arg') is not None:
for depth2 in range(len(Container[depth1].get('Arg'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.Arg.' + str(depth2 + 1), Container[depth1].get('Arg')[depth2])
if Container[depth1].get('ReadinessProbe.SuccessThreshold') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.SuccessThreshold', Container[depth1].get('ReadinessProbe.SuccessThreshold'))
if Container[depth1].get('LifecyclePostStartHandlerHttpGetPath') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerHttpGetPath', Container[depth1].get('LifecyclePostStartHandlerHttpGetPath'))
if Container[depth1].get('LifecyclePreStopHandlerExec') is not None:
for depth2 in range(len(Container[depth1].get('LifecyclePreStopHandlerExec'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerExec.' + str(depth2 + 1), Container[depth1].get('LifecyclePreStopHandlerExec')[depth2])
if Container[depth1].get('SecurityContext.Capability.Add') is not None:
for depth2 in range(len(Container[depth1].get('SecurityContext.Capability.Add'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.SecurityContext.Capability.Add.' + str(depth2 + 1), Container[depth1].get('SecurityContext.Capability.Add')[depth2])
if Container[depth1].get('ReadinessProbe.InitialDelaySeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.InitialDelaySeconds', Container[depth1].get('ReadinessProbe.InitialDelaySeconds'))
if Container[depth1].get('ReadinessProbe.Exec.Command') is not None:
for depth2 in range(len(Container[depth1].get('ReadinessProbe.Exec.Command'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.Exec.Command.' + str(depth2 + 1), Container[depth1].get('ReadinessProbe.Exec.Command')[depth2])
if Container[depth1].get('ReadinessProbe.HttpGet.Scheme') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.HttpGet.Scheme', Container[depth1].get('ReadinessProbe.HttpGet.Scheme'))
if Container[depth1].get('LifecyclePreStopHandlerHttpGetPort') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePreStopHandlerHttpGetPort', Container[depth1].get('LifecyclePreStopHandlerHttpGetPort'))
if Container[depth1].get('ImagePullPolicy') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ImagePullPolicy', Container[depth1].get('ImagePullPolicy'))
if Container[depth1].get('Command') is not None:
for depth2 in range(len(Container[depth1].get('Command'))):
self.add_query_param('Container.' + str(depth1 + 1) + '.Command.' + str(depth2 + 1), Container[depth1].get('Command')[depth2])
if Container[depth1].get('LivenessProbe.HttpGet.Path') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.HttpGet.Path', Container[depth1].get('LivenessProbe.HttpGet.Path'))
if Container[depth1].get('LifecyclePostStartHandlerHttpGetScheme') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LifecyclePostStartHandlerHttpGetScheme', Container[depth1].get('LifecyclePostStartHandlerHttpGetScheme'))
if Container[depth1].get('LivenessProbe.TimeoutSeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.TimeoutSeconds', Container[depth1].get('LivenessProbe.TimeoutSeconds'))
if Container[depth1].get('LivenessProbe.TcpSocket.Port') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.TcpSocket.Port', Container[depth1].get('LivenessProbe.TcpSocket.Port'))
if Container[depth1].get('ReadinessProbe.PeriodSeconds') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.ReadinessProbe.PeriodSeconds', Container[depth1].get('ReadinessProbe.PeriodSeconds'))
if Container[depth1].get('EnvironmentVar') is not None:
Expand All @@ -125,10 +159,6 @@ def set_Containers(self, Container): # RepeatList
self.add_query_param('Container.' + str(depth1 + 1) + '.EnvironmentVar.' + str(depth2 + 1) + '.Key', Container[depth1].get('EnvironmentVar')[depth2].get('Key'))
if Container[depth1].get('Tty') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Tty', Container[depth1].get('Tty'))
if Container[depth1].get('Name') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.Name', Container[depth1].get('Name'))
if Container[depth1].get('SecurityContext.ReadOnlyRootFilesystem') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.SecurityContext.ReadOnlyRootFilesystem', Container[depth1].get('SecurityContext.ReadOnlyRootFilesystem'))
if Container[depth1].get('LivenessProbe.FailureThreshold') is not None:
self.add_query_param('Container.' + str(depth1 + 1) + '.LivenessProbe.FailureThreshold', Container[depth1].get('LivenessProbe.FailureThreshold'))
if Container[depth1].get('ReadinessProbe.TimeoutSeconds') is not None:
Expand Down
Loading

0 comments on commit 6e70670

Please sign in to comment.