Skip to content

Commit bbfd3a9

Browse files
RachelTuckerrpmoore
authored andcommitted
Generating BP 5.1.x API using BP last commit change 1664144 (#576)
* Generating BP 5.1.x API using BP last commit change 1664144 * OTHER: specifying distribution for travis since oraclejdk8 no longer works with default * Fixing copyright date in autogenerated files.
1 parent 9067518 commit bbfd3a9

16 files changed

+312
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: java
2+
dist: trusty
23
jdk:
34
- oraclejdk8
45
script: ./gradlew -S clean jar ds3-sdk:test ds3-utils:test ds3-metadata:test

ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3Client.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ AbortMultiPartUploadResponse abortMultiPartUpload(final AbortMultiPartUploadRequ
4242

4343

4444

45+
CompleteBlobResponse completeBlob(final CompleteBlobRequest request)
46+
throws IOException;
47+
48+
49+
4550
CompleteMultiPartUploadResponse completeMultiPartUpload(final CompleteMultiPartUploadRequest request)
4651
throws IOException;
4752

ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public AbortMultiPartUploadResponse abortMultiPartUpload(final AbortMultiPartUpl
5050
return new AbortMultiPartUploadResponseParser().response(this.netClient.getResponse(request));
5151
}
5252
@Override
53+
public CompleteBlobResponse completeBlob(final CompleteBlobRequest request) throws IOException {
54+
return new CompleteBlobResponseParser().response(this.netClient.getResponse(request));
55+
}
56+
@Override
5357
public CompleteMultiPartUploadResponse completeMultiPartUpload(final CompleteMultiPartUploadRequest request) throws IOException {
5458
return new CompleteMultiPartUploadResponseParser().response(this.netClient.getResponse(request));
5559
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* ******************************************************************************
3+
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5+
* this file except in compliance with the License. A copy of the License is located at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* or in the "license" file accompanying this file.
10+
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
* ****************************************************************************
14+
*/
15+
16+
// This code is auto-generated, do not modify
17+
package com.spectralogic.ds3client.commands;
18+
19+
import com.spectralogic.ds3client.networking.HttpVerb;
20+
import com.spectralogic.ds3client.commands.interfaces.AbstractRequest;
21+
import java.util.UUID;
22+
import com.google.common.net.UrlEscapers;
23+
24+
public class CompleteBlobRequest extends AbstractRequest {
25+
26+
// Variables
27+
28+
private final String bucketName;
29+
30+
private final String objectName;
31+
32+
private final String blob;
33+
34+
private final String job;
35+
36+
// Constructor
37+
38+
39+
public CompleteBlobRequest(final String bucketName, final String objectName, final UUID blob, final UUID job) {
40+
this.bucketName = bucketName;
41+
this.objectName = objectName;
42+
this.blob = blob.toString();
43+
this.job = job.toString();
44+
45+
this.updateQueryParam("blob", blob);
46+
47+
this.updateQueryParam("job", job);
48+
49+
}
50+
51+
52+
public CompleteBlobRequest(final String bucketName, final String objectName, final String blob, final String job) {
53+
this.bucketName = bucketName;
54+
this.objectName = objectName;
55+
this.blob = blob;
56+
this.job = job;
57+
58+
this.updateQueryParam("blob", blob);
59+
60+
this.updateQueryParam("job", job);
61+
62+
}
63+
64+
65+
@Override
66+
public HttpVerb getVerb() {
67+
return HttpVerb.POST;
68+
}
69+
70+
@Override
71+
public String getPath() {
72+
return "/" + this.bucketName + "/" + this.objectName;
73+
}
74+
75+
public String getBucketName() {
76+
return this.bucketName;
77+
}
78+
79+
80+
public String getObjectName() {
81+
return this.objectName;
82+
}
83+
84+
85+
public String getBlob() {
86+
return this.blob;
87+
}
88+
89+
90+
public String getJob() {
91+
return this.job;
92+
}
93+
94+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* ******************************************************************************
3+
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5+
* this file except in compliance with the License. A copy of the License is located at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* or in the "license" file accompanying this file.
10+
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
* ****************************************************************************
14+
*/
15+
16+
// This code is auto-generated, do not modify
17+
package com.spectralogic.ds3client.commands;
18+
19+
import com.spectralogic.ds3client.models.ChecksumType;
20+
import com.spectralogic.ds3client.commands.interfaces.AbstractResponse;
21+
22+
public class CompleteBlobResponse extends AbstractResponse {
23+
24+
public CompleteBlobResponse(final String checksum, final ChecksumType.Type checksumType) {
25+
super(checksum, checksumType);
26+
}
27+
28+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* ******************************************************************************
3+
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5+
* this file except in compliance with the License. A copy of the License is located at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* or in the "license" file accompanying this file.
10+
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
* ****************************************************************************
14+
*/
15+
16+
// This code is auto-generated, do not modify
17+
package com.spectralogic.ds3client.commands.parsers;
18+
19+
import com.spectralogic.ds3client.commands.CompleteBlobResponse;
20+
import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser;
21+
import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils;
22+
import com.spectralogic.ds3client.networking.WebResponse;
23+
import java.io.IOException;
24+
25+
public class CompleteBlobResponseParser extends AbstractResponseParser<CompleteBlobResponse> {
26+
private final int[] expectedStatusCodes = new int[]{200};
27+
28+
@Override
29+
public CompleteBlobResponse parseXmlResponse(final WebResponse response) throws IOException {
30+
final int statusCode = response.getStatusCode();
31+
if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) {
32+
switch (statusCode) {
33+
case 200:
34+
//There is no payload, return an empty response handler
35+
return new CompleteBlobResponse(this.getChecksum(), this.getChecksumType());
36+
37+
default:
38+
assert false: "validateStatusCode should have made it impossible to reach this line";
39+
}
40+
}
41+
42+
throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes);
43+
}
44+
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Request.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public class DelegateCreateUserSpectraS3Request extends AbstractRequest {
2727

2828
private final String name;
2929

30+
private String defaultDataPolicyId;
31+
3032
private String id;
3133

3234
private int maxBuckets;
@@ -43,6 +45,20 @@ public DelegateCreateUserSpectraS3Request(final String name) {
4345

4446
}
4547

48+
public DelegateCreateUserSpectraS3Request withDefaultDataPolicyId(final UUID defaultDataPolicyId) {
49+
this.defaultDataPolicyId = defaultDataPolicyId.toString();
50+
this.updateQueryParam("default_data_policy_id", defaultDataPolicyId);
51+
return this;
52+
}
53+
54+
55+
public DelegateCreateUserSpectraS3Request withDefaultDataPolicyId(final String defaultDataPolicyId) {
56+
this.defaultDataPolicyId = defaultDataPolicyId;
57+
this.updateQueryParam("default_data_policy_id", defaultDataPolicyId);
58+
return this;
59+
}
60+
61+
4662
public DelegateCreateUserSpectraS3Request withId(final UUID id) {
4763
this.id = id.toString();
4864
this.updateQueryParam("id", id);
@@ -87,6 +103,11 @@ public String getName() {
87103
}
88104

89105

106+
public String getDefaultDataPolicyId() {
107+
return this.defaultDataPolicyId;
108+
}
109+
110+
90111
public String getId() {
91112
return this.id;
92113
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Request.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest;
2121
import com.google.common.net.UrlEscapers;
2222
import com.spectralogic.ds3client.models.TargetReadPreferenceType;
23+
import com.spectralogic.ds3client.models.CloudNamingMode;
2324
import java.util.UUID;
2425
import com.spectralogic.ds3client.models.Quiesced;
2526
import com.spectralogic.ds3client.models.S3Region;
@@ -41,6 +42,8 @@ public class GetS3TargetsSpectraS3Request extends AbstractPaginationRequest {
4142

4243
private String name;
4344

45+
private CloudNamingMode namingMode;
46+
4447
private int pageLength;
4548

4649
private int pageOffset;
@@ -108,6 +111,13 @@ public GetS3TargetsSpectraS3Request withName(final String name) {
108111
}
109112

110113

114+
public GetS3TargetsSpectraS3Request withNamingMode(final CloudNamingMode namingMode) {
115+
this.namingMode = namingMode;
116+
this.updateQueryParam("naming_mode", namingMode);
117+
return this;
118+
}
119+
120+
111121
public GetS3TargetsSpectraS3Request withPageLength(final int pageLength) {
112122
this.pageLength = pageLength;
113123
this.updateQueryParam("page_length", pageLength);
@@ -205,6 +215,11 @@ public String getName() {
205215
}
206216

207217

218+
public CloudNamingMode getNamingMode() {
219+
return this.namingMode;
220+
}
221+
222+
208223
public int getPageLength() {
209224
return this.pageLength;
210225
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Request.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.google.common.net.UrlEscapers;
2222
import java.lang.Integer;
2323
import com.spectralogic.ds3client.models.TargetReadPreferenceType;
24+
import com.spectralogic.ds3client.models.CloudNamingMode;
2425
import com.spectralogic.ds3client.models.Quiesced;
2526
import com.spectralogic.ds3client.models.S3Region;
2627

@@ -46,6 +47,8 @@ public class ModifyS3TargetSpectraS3Request extends AbstractRequest {
4647

4748
private String name;
4849

50+
private CloudNamingMode namingMode;
51+
4952
private int offlineDataStagingWindowInTb;
5053

5154
private boolean permitGoingOutOfSync;
@@ -132,6 +135,13 @@ public ModifyS3TargetSpectraS3Request withName(final String name) {
132135
}
133136

134137

138+
public ModifyS3TargetSpectraS3Request withNamingMode(final CloudNamingMode namingMode) {
139+
this.namingMode = namingMode;
140+
this.updateQueryParam("naming_mode", namingMode);
141+
return this;
142+
}
143+
144+
135145
public ModifyS3TargetSpectraS3Request withOfflineDataStagingWindowInTb(final int offlineDataStagingWindowInTb) {
136146
this.offlineDataStagingWindowInTb = offlineDataStagingWindowInTb;
137147
this.updateQueryParam("offline_data_staging_window_in_tb", offlineDataStagingWindowInTb);
@@ -265,6 +275,11 @@ public String getName() {
265275
}
266276

267277

278+
public CloudNamingMode getNamingMode() {
279+
return this.namingMode;
280+
}
281+
282+
268283
public int getOfflineDataStagingWindowInTb() {
269284
return this.offlineDataStagingWindowInTb;
270285
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Request.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class PutBulkJobSpectraS3Request extends BulkRequest {
4040

4141
private String name;
4242

43+
private boolean preAllocateJobSpace;
44+
4345
private boolean verifyAfterWrite;
4446

4547
// Constructor
@@ -111,6 +113,17 @@ public PutBulkJobSpectraS3Request withName(final String name) {
111113
}
112114

113115

116+
public PutBulkJobSpectraS3Request withPreAllocateJobSpace(final boolean preAllocateJobSpace) {
117+
this.preAllocateJobSpace = preAllocateJobSpace;
118+
if (this.preAllocateJobSpace) {
119+
this.getQueryParams().put("pre_allocate_job_space", null);
120+
} else {
121+
this.getQueryParams().remove("pre_allocate_job_space");
122+
}
123+
return this;
124+
}
125+
126+
114127
@Override
115128
public PutBulkJobSpectraS3Request withPriority(final Priority priority) {
116129
super.withPriority(priority);
@@ -157,6 +170,11 @@ public String getName() {
157170
}
158171

159172

173+
public boolean getPreAllocateJobSpace() {
174+
return this.preAllocateJobSpace;
175+
}
176+
177+
160178
public boolean getVerifyAfterWrite() {
161179
return this.verifyAfterWrite;
162180
}

0 commit comments

Comments
 (0)