in aliyun-java-sdk-eci/src/main/java/com/aliyuncs/eci/model/v20180808/UpdateContainerGroupRequest.java [185:239]
public void setInitContainers(List<Container> initContainers) {
this.initContainers = initContainers;
if (initContainers != null) {
for (int depth1 = 0; depth1 < initContainers.size(); depth1++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".Name" , initContainers.get(depth1).getName());
putQueryParameter("InitContainer." + (depth1 + 1) + ".Image" , initContainers.get(depth1).getImage());
putQueryParameter("InitContainer." + (depth1 + 1) + ".Cpu" , initContainers.get(depth1).getCpu());
putQueryParameter("InitContainer." + (depth1 + 1) + ".Memory" , initContainers.get(depth1).getMemory());
putQueryParameter("InitContainer." + (depth1 + 1) + ".WorkingDir" , initContainers.get(depth1).getWorkingDir());
putQueryParameter("InitContainer." + (depth1 + 1) + ".ImagePullPolicy" , initContainers.get(depth1).getImagePullPolicy());
if (initContainers.get(depth1).getCommands() != null) {
for (int i = 0; i < initContainers.get(depth1).getCommands().size(); i++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".Command." + (i + 1) , initContainers.get(depth1).getCommands().get(i));
}
}
if (initContainers.get(depth1).getArgs() != null) {
for (int i = 0; i < initContainers.get(depth1).getArgs().size(); i++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".Arg." + (i + 1) , initContainers.get(depth1).getArgs().get(i));
}
}
if (initContainers.get(depth1).getVolumeMounts() != null) {
for (int depth2 = 0; depth2 < initContainers.get(depth1).getVolumeMounts().size(); depth2++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".VolumeMount." + (depth2 + 1) + ".MountPath" , initContainers.get(depth1).getVolumeMounts().get(depth2).getMountPath());
putQueryParameter("InitContainer." + (depth1 + 1) + ".VolumeMount." + (depth2 + 1) + ".ReadOnly" , initContainers.get(depth1).getVolumeMounts().get(depth2).getReadOnly());
putQueryParameter("InitContainer." + (depth1 + 1) + ".VolumeMount." + (depth2 + 1) + ".Name" , initContainers.get(depth1).getVolumeMounts().get(depth2).getName());
}
}
if (initContainers.get(depth1).getPorts() != null) {
for (int depth2 = 0; depth2 < initContainers.get(depth1).getPorts().size(); depth2++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".Port." + (depth2 + 1) + ".Protocol" , initContainers.get(depth1).getPorts().get(depth2).getProtocol());
putQueryParameter("InitContainer." + (depth1 + 1) + ".Port." + (depth2 + 1) + ".Port" , initContainers.get(depth1).getPorts().get(depth2).getPort());
}
}
if (initContainers.get(depth1).getEnvironmentVars() != null) {
for (int depth2 = 0; depth2 < initContainers.get(depth1).getEnvironmentVars().size(); depth2++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".EnvironmentVar." + (depth2 + 1) + ".Key" , initContainers.get(depth1).getEnvironmentVars().get(depth2).getKey());
putQueryParameter("InitContainer." + (depth1 + 1) + ".EnvironmentVar." + (depth2 + 1) + ".Value" , initContainers.get(depth1).getEnvironmentVars().get(depth2).getValue());
}
}
if(initContainers.get(depth1).getSecurityContext() != null){
if (initContainers.get(depth1).getSecurityContext().getCapability() != null) {
if(initContainers.get(depth1).getSecurityContext().getCapability().getAdds() != null){
for (int i = 0; i < initContainers.get(depth1).getSecurityContext().getCapability().getAdds().size(); i++) {
putQueryParameter("InitContainer." + (depth1 + 1) + ".SecurityContext.Capability.Add." + (i + 1) , initContainers.get(depth1).getSecurityContext().getCapability().getAdds().get(i));
}
}
}
putQueryParameter("InitContainer." + (depth1 + 1) + ".SecurityContext.ReadOnlyRootFilesystem" , initContainers.get(depth1).getSecurityContext().getReadOnlyRootFilesystem());
putQueryParameter("InitContainer." + (depth1 + 1) + ".SecurityContext.RunAsUser" , initContainers.get(depth1).getSecurityContext().getRunAsUser());
}
}
}
}