Skip to content

Commit dd553de

Browse files
author
liyan.90210
committed
feat auto update sdk
1 parent 36ea08a commit dd553de

File tree

13 files changed

+232
-14
lines changed

13 files changed

+232
-14
lines changed

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Change log
22

3+
2025-07-10 Bumped to version v1.0.228
4+
- Updated apis for imagex/livesaas/vikingDB/vms
5+
36
2025-07-03 Bumped to version v1.0.227
47
- Updated apis for imagex/livesaas/vms
58

volc-sdk-java/pom.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.volcengine</groupId>
7-
<version>1.0.227</version>
7+
<version>1.0.228</version>
88
<artifactId>volc-sdk-java</artifactId>
99

1010
<name>volc-sdk-java</name>
@@ -215,26 +215,25 @@
215215
</executions>
216216
</plugin>
217217
<plugin>
218-
<groupId>org.sonatype.plugins</groupId>
219-
<artifactId>nexus-staging-maven-plugin</artifactId>
220-
<version>1.6.7</version>
218+
<groupId>org.sonatype.central</groupId>
219+
<artifactId>central-publishing-maven-plugin</artifactId>
220+
<version>0.8.0</version>
221221
<extensions>true</extensions>
222222
<configuration>
223-
<serverId>sonatype-nexus-staging</serverId>
224-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
225-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
223+
<publishingServerId>sonatype-nexus-staging</publishingServerId>
224+
<autoPublish>true</autoPublish>
226225
</configuration>
227226
</plugin>
228227
</plugins>
229228
</build>
230229
<distributionManagement>
231230
<snapshotRepository>
232231
<id>sonatype-nexus-staging</id>
233-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
232+
<url>https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots</url>
234233
</snapshotRepository>
235234
<repository>
236235
<id>sonatype-nexus-staging</id>
237-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
236+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
238237
</repository>
239238
</distributionManagement>
240239
</project>

volc-sdk-java/src/main/java/com/volcengine/model/beans/CDN.java

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ public static class AddCdnDomainRequest {
215215
@JSONField(name = "OriginRange")
216216
Boolean OriginRange;
217217

218+
@JSONField(name = "OriginResponseHeader")
219+
List<OriginResponseHeader> OriginResponseHeader;
220+
218221
@JSONField(name = "OriginRetry")
219222
OriginRetry OriginRetry;
220223

@@ -254,6 +257,9 @@ public static class AddCdnDomainRequest {
254257
@JSONField(name = "ResponseHeader")
255258
List<ResponseHeaderRule> ResponseHeader;
256259

260+
@JSONField(name = "RuleEngine")
261+
RuleEngine RuleEngine;
262+
257263
@JSONField(name = "ServiceRegion")
258264
String ServiceRegion;
259265

@@ -670,6 +676,9 @@ public static class BatchUpdateCdnConfigRequest {
670676
@JSONField(name = "OriginRange")
671677
Boolean OriginRange;
672678

679+
@JSONField(name = "OriginResponseHeader")
680+
List<OriginResponseHeader> OriginResponseHeader;
681+
673682
@JSONField(name = "OriginRetry")
674683
OriginRetry OriginRetry;
675684

@@ -706,6 +715,9 @@ public static class BatchUpdateCdnConfigRequest {
706715
@JSONField(name = "RewriteHLS")
707716
RewriteHLS RewriteHLS;
708717

718+
@JSONField(name = "RuleEngine")
719+
RuleEngine RuleEngine;
720+
709721
@JSONField(name = "ServiceRegion")
710722
String ServiceRegion;
711723

@@ -3640,6 +3652,9 @@ public static class DomainConfig {
36403652
@JSONField(name = "OriginRange")
36413653
Boolean OriginRange;
36423654

3655+
@JSONField(name = "OriginResponseHeader")
3656+
List<OriginResponseHeader> OriginResponseHeader;
3657+
36433658
@JSONField(name = "OriginRetry")
36443659
OriginRetry OriginRetry;
36453660

@@ -3673,12 +3688,18 @@ public static class DomainConfig {
36733688
@JSONField(name = "RequestHeader")
36743689
List<RequestHeaderRule> RequestHeader;
36753690

3691+
@JSONField(name = "ResourceTags")
3692+
List<ResourceTag> ResourceTags;
3693+
36763694
@JSONField(name = "ResponseHeader")
36773695
List<ResponseHeaderRule> ResponseHeader;
36783696

36793697
@JSONField(name = "RewriteHLS")
36803698
RewriteHLS RewriteHLS;
36813699

3700+
@JSONField(name = "RuleEngine")
3701+
RuleEngine RuleEngine;
3702+
36823703
@JSONField(name = "ServiceRegion")
36833704
String ServiceRegion;
36843705

@@ -3830,6 +3851,9 @@ public static class DomainSummary {
38303851
@JSONField(name = "ResourceTags")
38313852
List<ResourceTag> ResourceTags;
38323853

3854+
@JSONField(name = "RuleEngine")
3855+
Boolean RuleEngine;
3856+
38333857
@JSONField(name = "ServiceRegion")
38343858
String ServiceRegion;
38353859

@@ -4297,6 +4321,9 @@ public static class ListCdnDomainsRequest {
42974321
@JSONField(name = "ResourceTags")
42984322
List<String> ResourceTags;
42994323

4324+
@JSONField(name = "RuleEngine")
4325+
Boolean RuleEngine;
4326+
43004327
@JSONField(name = "ServiceRegion")
43014328
String ServiceRegion;
43024329

@@ -4871,6 +4898,42 @@ public static class OriginLine {
48714898
String Weight;
48724899
}
48734900

4901+
@Data
4902+
@Accessors(chain = true)
4903+
public static class OriginResponseHeader {
4904+
4905+
@JSONField(name = "OriginResponseHeaderAction")
4906+
OriginResponseHeaderAction OriginResponseHeaderAction;
4907+
}
4908+
4909+
@Data
4910+
@Accessors(chain = true)
4911+
public static class OriginResponseHeaderAction {
4912+
4913+
@JSONField(name = "OriginResponseHeaderInstances")
4914+
List<OriginResponseHeaderInstance> OriginResponseHeaderInstances;
4915+
}
4916+
4917+
@Data
4918+
@Accessors(chain = true)
4919+
public static class OriginResponseHeaderInstance {
4920+
4921+
@JSONField(name = "Action")
4922+
String Action;
4923+
4924+
@JSONField(name = "Key")
4925+
String Key;
4926+
4927+
@JSONField(name = "Object")
4928+
String Object;
4929+
4930+
@JSONField(name = "Value")
4931+
String Value;
4932+
4933+
@JSONField(name = "ValueType")
4934+
String ValueType;
4935+
}
4936+
48744937
@Data
48754938
@Accessors(chain = true)
48764939
public static class OriginRetry {
@@ -5034,6 +5097,26 @@ public static class Quic {
50345097
Boolean Switch;
50355098
}
50365099

5100+
@Data
5101+
@Accessors(chain = true)
5102+
public static class RERule {
5103+
5104+
@JSONField(name = "DSLRule")
5105+
String DSLRule;
5106+
5107+
@JSONField(name = "Id")
5108+
String Id;
5109+
5110+
@JSONField(name = "Locked")
5111+
Boolean Locked;
5112+
5113+
@JSONField(name = "Name")
5114+
String Name;
5115+
5116+
@JSONField(name = "Rule")
5117+
String Rule;
5118+
}
5119+
50375120
@Data
50385121
@Accessors(chain = true)
50395122
public static class RankingDataDetail {
@@ -5412,6 +5495,16 @@ public static class RewriteM3u8Rule {
54125495
Boolean TransferEncoding;
54135496
}
54145497

5498+
@Data
5499+
@Accessors(chain = true)
5500+
public static class RuleEngine {
5501+
5502+
@JSONField(name = "Rules")
5503+
List<RERule> Rules;
5504+
5505+
@JSONField(name = "Switch")
5506+
Boolean Switch;
5507+
}
54155508

54165509
@Data
54175510
@Accessors(chain = true)
@@ -6200,6 +6293,9 @@ public static class UpdateCdnConfigRequest {
62006293
@JSONField(name = "OriginRange")
62016294
Boolean OriginRange;
62026295

6296+
@JSONField(name = "OriginResponseHeader")
6297+
List<OriginResponseHeader> OriginResponseHeader;
6298+
62036299
@JSONField(name = "OriginRetry")
62046300
OriginRetry OriginRetry;
62056301

@@ -6236,6 +6332,9 @@ public static class UpdateCdnConfigRequest {
62366332
@JSONField(name = "RewriteHLS")
62376333
RewriteHLS RewriteHLS;
62386334

6335+
@JSONField(name = "RuleEngine")
6336+
RuleEngine RuleEngine;
6337+
62396338
@JSONField(name = "ServiceRegion")
62406339
String ServiceRegion;
62416340

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/Collection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public <T> DataObject fetchData(T id) throws Exception {
152152
params.put("collection_name", collectionName);
153153
params.put("primary_keys", id);
154154
if (getIsClient()) {
155-
params.put("replace_primay", true);
156-
}
155+
params.put("replace_primay", true);
156+
}
157157
LinkedTreeMap<String, Object> resData = vikingDBService.retryRequest("FetchData", null, params, Constant.MAX_RETRIES);
158158
if (resData == null) {
159159
throw new Exception(Constant.NO_RESPONSE_DATA);

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/Index.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ public List<DataObject> search(SearchParam searchParam) throws Exception {
140140
if (getIsClient()) {
141141
search.put("replace_primay", true);
142142
}
143+
if (searchParam.getNeedReturnVector()) {
144+
search.put("need_return_vector", true);
145+
}
143146
HashMap<String, Object> params = new HashMap<>();
144147
params.put("collection_name", collectionName);
145148
params.put("index_name", indexName);
@@ -161,6 +164,9 @@ public List<DataObject> search(SearchParam searchParam) throws Exception {
161164
if (getIsClient()) {
162165
search.put("replace_primay", true);
163166
}
167+
if (searchParam.getNeedReturnVector()) {
168+
search.put("need_return_vector", true);
169+
}
164170
maybeSetPostProcessOps(searchParam, search);
165171
maybeSetPrimaryKeyFilter(searchParam, search);
166172
HashMap<String, Object> params = new HashMap<>();
@@ -263,6 +269,9 @@ public PageDataObject searchPagination(SearchParam searchParam) throws Exception
263269
if (getIsClient()) {
264270
searchBody.put("replace_primay", true);
265271
}
272+
if (searchParam.getNeedReturnVector()) {
273+
searchBody.put("need_return_vector", true);
274+
}
266275
searchBody.put("need_search_count", true);
267276
params.put("collection_name", collectionName);
268277
params.put("index_name", indexName);
@@ -284,6 +293,9 @@ public List<DataObject> searchById(SearchByIdParam searchByIdParam) throws Excep
284293
if (getIsClient()) {
285294
search.put("replace_primay", true);
286295
}
296+
if (searchByIdParam.getNeedReturnVector()) {
297+
search.put("need_return_vector", true);
298+
}
287299
HashMap<String, Object> params = new HashMap<>();
288300
params.put("collection_name", collectionName);
289301
params.put("index_name", indexName);
@@ -307,6 +319,9 @@ public List<DataObject> searchByVector(SearchByVectorParam searchByVectorParam)
307319
if (getIsClient()) {
308320
search.put("replace_primay", true);
309321
}
322+
if (searchByVectorParam.getNeedReturnVector()) {
323+
search.put("need_return_vector", true);
324+
}
310325
HashMap<String, Object> params = new HashMap<>();
311326
params.put("collection_name", collectionName);
312327
params.put("index_name", indexName);
@@ -329,6 +344,9 @@ public List<DataObject> searchWithMultiModal(SearchWithMultiModalParam searchWit
329344
if (getIsClient()) {
330345
search.put("replace_primay", true);
331346
}
347+
if (searchWithMultiModalParam.getNeedReturnVector()) {
348+
search.put("need_return_vector", true);
349+
}
332350
HashMap<String, Object> params = new HashMap<>();
333351
params.put("collection_name", collectionName);
334352
params.put("index_name", indexName);
@@ -355,6 +373,9 @@ public List<DataObject> searchByText(SearchByTextParam searchByTextParam) throws
355373
if (getIsClient()) {
356374
search.put("replace_primay", true);
357375
}
376+
if (searchByTextParam.getNeedReturnVector()) {
377+
search.put("need_return_vector", true);
378+
}
358379
HashMap<String, Object> params = new HashMap<>();
359380
params.put("collection_name", collectionName);
360381
params.put("index_name", indexName);
@@ -586,7 +607,7 @@ public List<DataObject> getDatas(LinkedTreeMap<String, Object> resData, List<Str
586607
id = (Long) item.get(requestPrimaryKey());
587608
}
588609
HashMap<String, Object> fields = new HashMap<>();
589-
if (outputFields == null || outputFields.size() != 0) {
610+
if (outputFields == null || outputFields.size() != 0 || item.get("fields") != null) {
590611
@SuppressWarnings("unchecked")
591612
LinkedTreeMap<String, Object> map = (LinkedTreeMap<String, Object>) item.get("fields");
592613
fields = vikingDBService.convertLinkedTreeMapToHashMap(map);

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/VikingDBService.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.util.Map;
4444
import java.util.Random;
4545
import java.util.Set;
46+
import java.util.Objects;
4647
import java.util.regex.Matcher;
4748
import java.util.regex.Pattern;
4849

@@ -335,6 +336,7 @@ public Collection createCollection(CreateCollectionParam createCollectionParam)
335336
HashMap<String, Object> params = new HashMap<>();
336337
params.put("collection_name", createCollectionParam.getCollectionName());
337338
params.put("description", createCollectionParam.getDescription());
339+
params.put("project", createCollectionParam.getProject());
338340
String primaryKey = null;
339341
List<Map<String, Object>> fields = new ArrayList<>();
340342
for (Field field : createCollectionParam.getFields()) {
@@ -443,7 +445,16 @@ public void dropCollection(String collectionName) throws Exception {
443445
}
444446

445447
public List<Collection> listCollections() throws Exception {
446-
LinkedTreeMap<String, Object> resData = doRequest("ListCollections", null, null);
448+
return listCollections("");
449+
}
450+
451+
public List<Collection> listCollections(String project) throws Exception {
452+
HashMap<String, Object> params = null;
453+
if (!Objects.equals(project, "")) {
454+
params = new HashMap<>();
455+
params.put("project", project);
456+
}
457+
LinkedTreeMap<String, Object> resData = doRequest("ListCollections", null, params);
447458
@SuppressWarnings("unchecked")
448459
List<LinkedTreeMap<String, Object>> res = (List<LinkedTreeMap<String, Object>>) resData.get("data");
449460
List<Collection> collections = new ArrayList<>();

volc-sdk-java/src/main/java/com/volcengine/service/vikingDB/common/CreateCollectionParam.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class CreateCollectionParam {
1111
private List<Field> fields = null;
1212
private String description = "";
1313
private List<VectorizeTuple> vectorize = null;
14+
private String project = "default";
1415
private Integer isBuild = 0;
1516

1617
public CreateCollectionParam() {
@@ -31,6 +32,11 @@ public CreateCollectionParam setDescription(String description) {
3132
return this;
3233
}
3334

35+
public CreateCollectionParam SetProject(String project) {
36+
this.project = project;
37+
return this;
38+
}
39+
3440
public CreateCollectionParam setVectorize(List<VectorizeTuple> vectorize) {
3541
this.vectorize = vectorize;
3642
return this;

0 commit comments

Comments
 (0)