Skip to content

Commit a88f284

Browse files
committed
update to 0.10.358
1 parent da0f85a commit a88f284

File tree

942 files changed

+44211
-1239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

942 files changed

+44211
-1239
lines changed

Release Notes.txt

+87
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,92 @@
11
发行说明:记录每次SDK更新的说明,最新版本的SDK包含以前所有版本的更新内容。
22
---------------------------------------------------------------------
3+
【版本:v0.10.358】
4+
涉及产品:VPC 新增参数模板、专线网关、安全组、子网等接口;新增CSN带宽包询价接口,更新查询列表、详情等接口出入参字段。
5+
6+
【版本:v0.10.357】
7+
涉及产品:BLB HTTPS监听器支持扩展域名
8+
9+
【版本:v0.10.356】
10+
涉及产品:CDN 域名列表支持IP或域名源站筛选
11+
12+
【版本:v0.10.355】
13+
涉及产品:BOS 新增细粒度权限列表
14+
15+
【版本:v0.10.354】
16+
涉及产品:VOD, 更新媒资任务详情数据结构
17+
18+
【版本:v0.10.353】
19+
涉及产品:VOD 增加拉取上传方法
20+
21+
【版本:v0.10.352】
22+
涉及产品:MCP 多路音频支持音频流pad策略配置
23+
24+
【版本:v0.10.351】
25+
涉及产品:BEC, 更新虚机实例创建变配等接口、新增部署集、虚机镜像相关接口;新增网络部分VPC、子网、安全组、NAT、路由表、ACL相关接口;新增负载均衡applb相关接口。
26+
27+
【版本:v0.10.350】
28+
涉及产品:MCP 支持多路音频混流调节音量
29+
30+
【版本:v0.10.349】
31+
涉及产品:CDN CDN缓存规则设置接口升级
32+
33+
【版本:v0.10.348】
34+
涉及产品:MCP 创建模板和任务新增参数
35+
36+
【版本:v0.10.347】
37+
涉及产品:MCP 创建模板和任务新增参数
38+
39+
【版本:v0.10.346】
40+
涉及产品:BOS 修复文件后缀识别的bug
41+
42+
【版本:v0.10.345】
43+
涉及产品:BOS 修复setBucketLifecycle的bug && 新增webp格式自动识别 && 支持多版本功能 && 修改请求默认同步模式
44+
45+
【版本:v0.10.344】
46+
涉及产品:aihc, aihc 新增java sdk
47+
48+
【版本:v0.10.343】
49+
涉及产品:MMS, MMS 追加媒资ID字段
50+
51+
【版本:v0.10.342】
52+
涉及产品:vod, vod 新增java sdk
53+
54+
【版本:v0.10.341】
55+
涉及产品:Billing, 账单支持查询调减金额
56+
57+
【版本:v0.10.340】
58+
涉及产品:BCC,后转预支持同时开启自动续费
59+
60+
【版本:v0.10.339】
61+
涉及产品:VCA,新增图片摘要分析功能
62+
63+
【版本:v0.10.338】
64+
涉及产品:BOS 修复endpoint设置https的bug && 新增acl支持not ipaddress字段
65+
66+
【版本:v0.10.337】
67+
涉及产品:BCI openApi 查询实例详情和实例列表增加规格信息返回
68+
69+
【版本:v0.10.336】
70+
涉及产品:BCM openApi 新增报警经历相关接口
71+
72+
【版本:v0.10.335】
73+
涉及产品:bcc openApi 查询套餐价格返回折扣价
74+
75+
【版本:v0.10.334】
76+
涉及产品:KAFKA, 新增流控管理相关接口
77+
78+
【版本:v0.10.333】
79+
涉及产品:bbc openApi 虚机列表和虚机详情增加tag信息返回
80+
81+
【版本:v0.10.332】
82+
涉及产品:BOS,修复list bug & 重定向默认开启
83+
84+
【版本:v0.10.331】
85+
涉及产品:billing openApi 增加成本拆分账单查询接口
86+
87+
【版本:v0.10.330】
88+
涉及产品:BOS,修复url生成bug
89+
390
【版本:v0.10.329】
491
涉及产品:BOS,默认不支持重定向,新增自定义重定向接口
592

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.baidubce</groupId>
88
<artifactId>bce-java-sdk</artifactId>
9-
<version>0.10.313</version>
9+
<version>0.10.358</version>
1010
<name>bce-sdk-java</name>
1111
<description>The BCE SDK for Java provides Java APIs for all of BCE services.</description>
1212
<url>http://bce.baidu.com/sdk/index.html</url>

src/main/java/com/baidubce/AbstractBceClient.java

+18-16
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ public abstract class AbstractBceClient {
9696
* The constructor will extract serviceId from the class name automatically.
9797
* And if there is no endpoint specified in the client configuration, the constructor will create a default one.
9898
*
99-
* @param config the client configuration. The constructor makes a copy of this parameter so that it is
100-
* safe to change the configuration after then.
101-
* @param responseHandlers a list of handlers for processing HTTP responses from services. See
102-
* {@link com.baidubce.http.BceHttpClient#execute(InternalRequest, Class, HttpResponseHandler[])}
99+
* @param config the client configuration. The constructor makes a copy of this parameter so that it is
100+
* safe to change the configuration after then.
101+
* @param responseHandlers a list of handlers for processing HTTP responses from services. See
102+
* {@link com.baidubce.http.BceHttpClient#execute(InternalRequest, Class, HttpResponseHandler[])}
103103
* @param isHttpAsyncPutEnabled whether or not PUT method use Async manner.
104-
* @throws IllegalStateException if the class name does not follow the naming convention for BCE clients.
104+
* @throws IllegalStateException if the class name does not follow the naming convention for BCE clients.
105105
* @throws IllegalArgumentException if the endpoint specified in the client configuration is not a valid URI.
106106
*/
107107
public AbstractBceClient(BceClientConfiguration config, HttpResponseHandler[] responseHandlers,
108-
boolean isHttpAsyncPutEnabled) {
108+
boolean isHttpAsyncPutEnabled) {
109109
this.serviceId = this.computeServiceId();
110110
this.config = config;
111111
this.endpoint = this.computeEndpoint();
@@ -116,11 +116,11 @@ public AbstractBceClient(BceClientConfiguration config, HttpResponseHandler[] re
116116
/**
117117
* Equivalent to AbstractBceClient(config, responseHandlers, false)
118118
*
119-
* @param config the client configuration. The constructor makes a copy of this parameter so that it is
120-
* safe to change the configuration after then.
119+
* @param config the client configuration. The constructor makes a copy of this parameter so that it is
120+
* safe to change the configuration after then.
121121
* @param responseHandlers a list of handlers for processing HTTP responses from services. See
122-
* {@link com.baidubce.http.BceHttpClient#execute(InternalRequest, Class, HttpResponseHandler[])}
123-
* @throws IllegalStateException if the class name does not follow the naming convention for BCE clients.
122+
* {@link com.baidubce.http.BceHttpClient#execute(InternalRequest, Class, HttpResponseHandler[])}
123+
* @throws IllegalStateException if the class name does not follow the naming convention for BCE clients.
124124
* @throws IllegalArgumentException if the endpoint specified in the client configuration is not a valid URI.
125125
*/
126126
public AbstractBceClient(BceClientConfiguration config, HttpResponseHandler[] responseHandlers) {
@@ -178,9 +178,9 @@ public void shutdown() {
178178
* <p>
179179
* This method will add "Content-Type" and "Date" to headers with default values if not present.
180180
*
181-
* @param request the request to build up the HTTP request.
181+
* @param request the request to build up the HTTP request.
182182
* @param responseClass the response class.
183-
* @param <T> the type of response
183+
* @param <T> the type of response
184184
* @return the final response object.
185185
*/
186186
protected <T extends AbstractBceResponse> T invokeHttpClient(InternalRequest request, Class<T> responseClass) {
@@ -276,7 +276,7 @@ public URI getBktVirEndpoint(String bucketName) {
276276

277277
/**
278278
* BOS
279-
*
279+
* <p>
280280
* Returns the bucket virtual hosting service endpoint.
281281
* <p>
282282
* The endpoint will be in the form of "http(s)://<bucket>[.<Region>].bcebos.com".
@@ -289,15 +289,17 @@ public void computeBktVirEndpoint(String bucketName) {
289289
return;
290290
}
291291
String host = this.endpoint.getHost();
292+
String protocol = this.endpoint.getScheme();
293+
292294
String uri = null;
293-
if (!host.contains("bcebos.com")){
295+
if (!host.contains("bcebos.com") && !host.contains("baidu-int.com")) {
294296
// this means host is diy, and should not compute virtual host
295297
return;
296298
}
297299
if (host.startsWith(bucketName) && host.split("\\.").length >= 4) {
298-
uri = this.config.getProtocol().toString().toLowerCase() + "://" + host;
300+
uri = protocol + "://" + host;
299301
} else {
300-
uri = this.config.getProtocol().toString().toLowerCase() + "://" + bucketName + '.' + host;
302+
uri = protocol + "://" + bucketName + '.' + host;
301303
}
302304
try {
303305
if (uri != null) {

src/main/java/com/baidubce/BceConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Common constants used by the whole SDK.
1717
*/
1818
public class BceConstants {
19-
public static final String VERSION = "0.10.293";
19+
public static final String VERSION = "0.10.355";
2020

2121
public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
2222
public static final String DEFAULT_TIME_ZONE = "UTC";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.baidubce.examples.aihc.inference;
2+
3+
import com.baidubce.BceClientConfiguration;
4+
import com.baidubce.BceClientException;
5+
import com.baidubce.Protocol;
6+
import com.baidubce.auth.DefaultBceCredentials;
7+
import com.baidubce.services.aihc.AihcInferenceClient;
8+
import com.baidubce.services.aihc.model.inference.AppDetailsRequest;
9+
import com.baidubce.services.aihc.model.inference.AppDetailsResponse;
10+
11+
public class ExampleAppDetails {
12+
public static void main(String[] args) {
13+
String ak = "Your AK";
14+
String sk = "Your SK";
15+
String endpoint = "aihc.baidubce.com";
16+
String region = "bj";
17+
18+
BceClientConfiguration config = new BceClientConfiguration();
19+
config.setCredentials(new DefaultBceCredentials(ak, sk));
20+
config.setEndpoint(endpoint);
21+
config.setProtocol(Protocol.HTTPS);
22+
AihcInferenceClient client = new AihcInferenceClient(config);
23+
24+
AppDetailsRequest request = new AppDetailsRequest();
25+
request.setAppId("test");
26+
try {
27+
AppDetailsResponse response = client.appDetails(request, region);
28+
System.out.println(response);
29+
} catch (BceClientException e) {
30+
System.out.println(e.getMessage());
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.baidubce.examples.aihc.inference;
2+
3+
import com.baidubce.BceClientConfiguration;
4+
import com.baidubce.BceClientException;
5+
import com.baidubce.Protocol;
6+
import com.baidubce.auth.DefaultBceCredentials;
7+
import com.baidubce.services.aihc.AihcInferenceClient;
8+
import com.baidubce.services.aihc.model.inference.BlockPodRequest;
9+
import com.baidubce.services.aihc.model.inference.BlockPodResponse;
10+
11+
public class ExampleBlockPod {
12+
public static void main(String[] args) {
13+
String ak = "Your AK";
14+
String sk = "Your SK";
15+
String endpoint = "aihc.baidubce.com";
16+
String region = "bj";
17+
18+
BceClientConfiguration config = new BceClientConfiguration();
19+
config.setCredentials(new DefaultBceCredentials(ak, sk));
20+
config.setEndpoint(endpoint);
21+
config.setProtocol(Protocol.HTTPS);
22+
AihcInferenceClient client = new AihcInferenceClient(config);
23+
24+
BlockPodRequest request = new BlockPodRequest();
25+
request.setAppId("test");
26+
request.setInsID("test");
27+
request.setBlock(true);
28+
29+
try {
30+
BlockPodResponse response = client.blockPod(request, region);
31+
System.out.println(response);
32+
} catch (BceClientException e) {
33+
System.out.println(e.getMessage());
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.baidubce.examples.aihc.inference;
2+
3+
import com.baidubce.BceClientConfiguration;
4+
import com.baidubce.BceClientException;
5+
import com.baidubce.Protocol;
6+
import com.baidubce.auth.DefaultBceCredentials;
7+
import com.baidubce.services.aihc.AihcInferenceClient;
8+
import com.baidubce.services.aihc.model.inference.AppChangeDetailRequest;
9+
import com.baidubce.services.aihc.model.inference.AppChangeDetailResponse;
10+
11+
public class ExampleChangeDetail {
12+
public static void main(String[] args) {
13+
String ak = "Your AK";
14+
String sk = "Your SK";
15+
String endpoint = "aihc.baidubce.com";
16+
String region = "bj";
17+
18+
BceClientConfiguration config = new BceClientConfiguration();
19+
config.setCredentials(new DefaultBceCredentials(ak, sk));
20+
config.setEndpoint(endpoint);
21+
config.setProtocol(Protocol.HTTPS);
22+
AihcInferenceClient client = new AihcInferenceClient(config);
23+
24+
AppChangeDetailRequest request = new AppChangeDetailRequest();
25+
request.setChangeId("test");
26+
27+
try {
28+
AppChangeDetailResponse response = client.appChangeDetail(request, region);
29+
System.out.println(response);
30+
} catch (BceClientException e) {
31+
System.out.println(e.getMessage());
32+
}
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package com.baidubce.examples.aihc.inference;
2+
3+
import com.baidubce.BceClientConfiguration;
4+
import com.baidubce.BceClientException;
5+
import com.baidubce.Protocol;
6+
import com.baidubce.auth.DefaultBceCredentials;
7+
import com.baidubce.services.aihc.AihcInferenceClient;
8+
import com.baidubce.services.aihc.model.inference.CreateAppRequest;
9+
import com.baidubce.services.aihc.model.inference.CreateAppResponse;
10+
11+
import java.util.ArrayList;
12+
import java.util.HashMap;
13+
import java.util.List;
14+
import java.util.Map;
15+
16+
public class ExampleCreateApp {
17+
public static void main(String[] args) {
18+
String ak = "Your AK";
19+
String sk = "Your SK";
20+
String endpoint = "aihc.baidubce.com";
21+
String region = "bj";
22+
23+
BceClientConfiguration config = new BceClientConfiguration();
24+
config.setCredentials(new DefaultBceCredentials(ak, sk));
25+
config.setEndpoint(endpoint);
26+
config.setProtocol(Protocol.HTTPS);
27+
AihcInferenceClient client = new AihcInferenceClient(config);
28+
29+
CreateAppRequest request = new CreateAppRequest();
30+
31+
request.setAppName("test");
32+
request.setChipType("test");
33+
request.setInsCount(1);
34+
35+
request.setResPool(new CreateAppRequest.ResPoolConf("test", "test"));
36+
37+
List<CreateAppRequest.VolumnConf> volumns = new ArrayList<>();
38+
volumns.add(new CreateAppRequest.VolumnConf("", "",
39+
new CreateAppRequest.PFSConfig(""),
40+
new CreateAppRequest.HostPathConfig("")));
41+
request.setStorage(new CreateAppRequest.StorageConf(16, volumns));
42+
43+
request.setAccess(new CreateAppRequest.AccessConf(false, ""));
44+
45+
request.setLog(new CreateAppRequest.LogConf(true));
46+
47+
request.setDeploy(new CreateAppRequest.DeployConf(new CreateAppRequest.CanaryStrategyConf(25, 25)));
48+
49+
Map<String, String> podLabels = new HashMap<String, String>();
50+
podLabels.put("test", "");
51+
request.setMisc(new CreateAppRequest.Misc(podLabels, null));
52+
53+
List<String> runCmd = new ArrayList<String>();
54+
runCmd.add("/bin/sh");
55+
runCmd.add("-c");
56+
runCmd.add("test");
57+
58+
Map<String, String> env = new HashMap<>();
59+
env.put("test", "test");
60+
61+
List<CreateAppRequest.ContainerConf> containers = new ArrayList<>();
62+
List<CreateAppRequest.VolumnMountConf> volumeMounts = new ArrayList<>();
63+
volumeMounts.add(new CreateAppRequest.VolumnMountConf("", "", true));
64+
65+
List<String> command = new ArrayList<>();
66+
command.add("/bin/sh");
67+
68+
containers.add(new CreateAppRequest.ContainerConf("inference", 1, 16, 1, runCmd, null, null, env,
69+
new CreateAppRequest.ImageConf(2, "registry.baidubce.com/test/test:test", "", ""),
70+
volumeMounts,
71+
new CreateAppRequest.ProbeConf(1,1,1,1,1, new CreateAppRequest.ProbeHandlerConf(
72+
new CreateAppRequest.ExecAction(command), new CreateAppRequest.HTTPGetAction("", 2000), new CreateAppRequest.TCPSocketAction(2000)
73+
)),
74+
null, null));
75+
76+
request.setContainers(containers);
77+
78+
try {
79+
CreateAppResponse response = client.createApp(request, region);
80+
System.out.println(response);
81+
} catch (BceClientException e) {
82+
System.out.println(e.getMessage());
83+
}
84+
}
85+
}

0 commit comments

Comments
 (0)