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 — ULB和UNET部分参数更新 · ucloud/ucloud-sdk-java@51eac1b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • ucloud-sdk-java-ulb/src/main/java/cn/ucloud/ulb/model
    • AllocateBackendParam.java
    • DeleteULBParam.java
  • ucloud-sdk-java-unet/src/main/java/cn/ucloud/unet/model
    • CreateFirewallParam.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎ucloud-sdk-java-ulb/src/main/java/cn/ucloud/ulb/model/AllocateBackendParam.java‎

Copy file name to clipboardExpand all lines: ucloud-sdk-java-ulb/src/main/java/cn/ucloud/ulb/model/AllocateBackendParam.java
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ public class AllocateBackendParam extends BaseRequestParam {
6565
@UcloudParam("Enabled")
6666
private Integer enabled;
6767

68+
/**
69+
* 所添加的后端服务器的资源实例IP
70+
* 当ResourceType 为 UHybrid 时,必填
71+
*/
72+
@UcloudParam("ResourceIP")
73+
private String resourceIP;
74+
6875
public AllocateBackendParam( @NotEmpty(message = "region can not be empty") String region,
6976
@NotEmpty(message = "ulbId can not be empty") String ulbId,
7077
@NotEmpty(message = "vserverId can not be empty") String vserverId,
@@ -78,6 +85,16 @@ public AllocateBackendParam( @NotEmpty(message = "region can not be empty") Stri
7885
this.resourceId = resourceId;
7986
}
8087

88+
89+
90+
public String getResourceIP() {
91+
return resourceIP;
92+
}
93+
94+
public void setResourceIP(String resourceIP) {
95+
this.resourceIP = resourceIP;
96+
}
97+
8198
public String getRegion() {
8299
return region;
83100
}
Collapse file

‎ucloud-sdk-java-ulb/src/main/java/cn/ucloud/ulb/model/DeleteULBParam.java‎

Copy file name to clipboardExpand all lines: ucloud-sdk-java-ulb/src/main/java/cn/ucloud/ulb/model/DeleteULBParam.java
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,29 @@ public class DeleteULBParam extends BaseRequestParam {
2727
@UcloudParam("ULBId")
2828
private String ulbId;
2929

30+
/**
31+
* 删除ulb时是否释放绑定的EIP,
32+
* false标识只解绑EIP,
33+
* true表示会释放绑定的EIP,默认是false
34+
*/
35+
@UcloudParam("ReleaseEip")
36+
private Boolean releaseEip;
37+
3038
public DeleteULBParam( @NotEmpty(message = "region can not be empty") String region,
3139
@NotEmpty(message = "ulbId can not be empty") String ulbId) {
3240
super("DeleteULB");
3341
this.region = region;
3442
this.ulbId = ulbId;
3543
}
3644

45+
public Boolean getReleaseEip() {
46+
return releaseEip;
47+
}
48+
49+
public void setReleaseEip(Boolean releaseEip) {
50+
this.releaseEip = releaseEip;
51+
}
52+
3753
public String getRegion() {
3854
return region;
3955
}
Collapse file

‎ucloud-sdk-java-unet/src/main/java/cn/ucloud/unet/model/CreateFirewallParam.java‎

Copy file name to clipboardExpand all lines: ucloud-sdk-java-unet/src/main/java/cn/ucloud/unet/model/CreateFirewallParam.java
+17-19Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public List<Param> checkFirewallRule() throws ValidatorException {
5959
throw new ValidatorException("rule can not be empty");
6060
}
6161
List<Rule> rules = this.getRule();
62-
String exceptionFormat = "rule[%d].%s";
62+
String exceptionFormat = "rule[%d] %s";
6363
for (int i = 0, len = rules.size(); i < len; i++) {
6464
Rule rule = rules.get(i);
6565
if (rule == null) {
@@ -68,9 +68,6 @@ public List<Param> checkFirewallRule() throws ValidatorException {
6868
if (StringUtils.isBlank(rule.getProtocol())) {
6969
throw new ValidatorException(String.format(exceptionFormat, i, "protocol can not be empty"));
7070
}
71-
if (rule.getPort() == null || rule.getPort() <= 0) {
72-
throw new ValidatorException(String.format(exceptionFormat, i, "port can not be null or value <= 0"));
73-
}
7471
if (StringUtils.isBlank(rule.getIp())) {
7572
throw new ValidatorException(String.format(exceptionFormat, i, "ip can not be empty"));
7673
}
@@ -87,9 +84,9 @@ public List<Param> checkFirewallRule() throws ValidatorException {
8784
}
8885

8986

90-
public CreateFirewallParam(@NotEmpty(message = "region can not be empty") String region,
91-
@NotNull(message = "rule can not be empty") List<Rule> rule,
92-
@NotNull(message = "name can not be empty") String name) {
87+
public CreateFirewallParam(String region,
88+
List<Rule> rule,
89+
String name) {
9390
super("CreateFirewall");
9491
this.region = region;
9592
this.rule = rule;
@@ -139,45 +136,42 @@ public void setRule(List<Rule> rule) {
139136

140137
public static class Rule {
141138
@SuppressWarnings("squid:S1170")
142-
private final String ruleFormat = "%s|%d|%s|%s|%s";
139+
private final String ruleFormatWithPort = "%s|%d|%s|%s|%s";
140+
@SuppressWarnings("squid:S1170")
141+
private final String ruleFormatWithoutPort = "%s||%s|%s|%s";
143142
@SuppressWarnings("squid:S1700")
144143
private String rule;
145144

146145
/**
147146
* 协议: TCP, UDP, ...
148147
*/
149-
@NotEmpty(message = "protocol can not be empty")
150148
private String protocol;
151149

152150
/**
153151
* 端口号
154152
*/
155-
@NotNull(message = "port can not be null")
156153
private Integer port;
157154

158155
/**
159156
* IP
160157
*/
161-
@NotEmpty(message = "ip can not be empty")
162158
private String ip;
163159

164160
/**
165161
* ACCEPT(接受), DROP(拒绝)
166162
*/
167-
@NotEmpty(message = "acceptOrNot can not be empty")
168163
private String acceptOrNot;
169164

170165
/**
171166
* 优先级:HIGH(高),MEDIUM(中),LOW(低)
172167
*/
173-
@NotEmpty(message = "priority can not be empty")
174168
private String priority;
175169

176-
public Rule(@NotEmpty(message = "protocol can not be empty") String protocol,
177-
@NotNull(message = "port can not be null") Integer port,
178-
@NotEmpty(message = "ip can not be empty") String ip,
179-
@NotEmpty(message = "acceptOrNot can not be empty") String acceptOrNot,
180-
@NotEmpty(message = "priority can not be empty") String priority) {
170+
public Rule(String protocol,
171+
Integer port,
172+
String ip,
173+
String acceptOrNot,
174+
String priority) {
181175
this.protocol = protocol;
182176
this.port = port;
183177
this.ip = ip;
@@ -186,7 +180,11 @@ public Rule(@NotEmpty(message = "protocol can not be empty") String protocol,
186180
}
187181

188182
public String getRule() {
189-
rule = String.format(ruleFormat, protocol, port, ip, acceptOrNot, priority);
183+
if (port == null){
184+
rule = String.format(ruleFormatWithoutPort, protocol, ip, acceptOrNot, priority);
185+
}else {
186+
rule = String.format(ruleFormatWithPort, protocol, port, ip, acceptOrNot, priority);
187+
}
190188
return rule;
191189
}
192190

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.