GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added support for "--replicas-max-per-node" (#1383) · yauldmar/docker-java@732c0f5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docker-java-api/src/main/java/com/github/dockerjava/api/model
    • ServicePlacement.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docker-java-api/src/main/java/com/github/dockerjava/api/model/ServicePlacement.java‎

Copy file name to clipboardExpand all lines: docker-java-api/src/main/java/com/github/dockerjava/api/model/ServicePlacement.java
+33Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public class ServicePlacement implements Serializable {
2828
@JsonProperty("Platforms")
2929
private List<SwarmNodePlatform> platforms;
3030

31+
/**
32+
* @since 1.40
33+
*/
34+
@JsonProperty("MaxReplicas")
35+
private Integer maxReplicas;
36+
3137
/**
3238
* @see #constraints
3339
*/
@@ -54,4 +60,31 @@ public List<SwarmNodePlatform> getPlatforms() {
5460
public void setPlatforms(List<SwarmNodePlatform> platforms) {
5561
this.platforms = platforms;
5662
}
63+
64+
/**
65+
* Specifies the maximum amount of replicas / tasks that can run on one node.
66+
* 0 means unlimited replicas per node.
67+
*
68+
* @param maxReplicas Max number of replicas
69+
* @return This instance of ServicePlacement
70+
* @throws IllegalArgumentException if maxReplicas is less than 0
71+
*/
72+
public ServicePlacement withMaxReplicas(int maxReplicas) {
73+
if (maxReplicas < 0) {
74+
throw new IllegalArgumentException("The Value for MaxReplicas must be greater or equal to 0");
75+
}
76+
77+
this.maxReplicas = maxReplicas;
78+
return this;
79+
}
80+
81+
/**
82+
* Getter for maxReplicas
83+
*
84+
* @return The maximum amount of replicas / tasks that can run on one node.
85+
*/
86+
public Integer getMaxReplicas() {
87+
return this.maxReplicas;
88+
}
89+
5790
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.