Skip to content

Commit 39bc716

Browse files
committed
Releasing version 1.2.5 of the Java SDK for Oracle Bare Metal Cloud Services.
1 parent d1b2ef5 commit 39bc716

32 files changed

+530
-74
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
1313
### Added
1414
- N/A
1515

16+
## 1.2.5 - 2017-04-06
17+
### Changed
18+
- Added opc-client-request-id truncation logic in MultipartObjectAssembler to prevent failures
19+
20+
### Added
21+
- Support for DHCP Search Domain Option
22+
- Support for Compute API 'getWindowsInstanceInitialCredentials'
23+
1624
## 1.2.4 - 2017-03-28
1725
### Fixed
1826
- Allow UUID in path elements

bmc-audit/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.bmc.sdk</groupId>
77
<artifactId>oracle-bmc-java-sdk</artifactId>
8-
<version>1.2.4</version>
8+
<version>1.2.5</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>com.oracle.bmc.sdk</groupId>
2020
<artifactId>oracle-bmc-java-sdk-common</artifactId>
21-
<version>1.2.4</version>
21+
<version>1.2.5</version>
2222
</dependency>
2323
</dependencies>
2424

bmc-bom/pom.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.oracle.bmc.sdk</groupId>
99
<artifactId>oracle-bmc-java-sdk</artifactId>
10-
<version>1.2.4</version>
10+
<version>1.2.5</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313

@@ -24,7 +24,7 @@
2424
<dependency>
2525
<groupId>com.oracle.bmc.sdk</groupId>
2626
<artifactId>oracle-bmc-java-sdk-common</artifactId>
27-
<version>1.2.4</version>
27+
<version>1.2.5</version>
2828
<optional>false</optional>
2929
</dependency>
3030

@@ -33,25 +33,25 @@
3333
<dependency>
3434
<groupId>com.oracle.bmc.sdk</groupId>
3535
<artifactId>oracle-bmc-java-sdk-audit</artifactId>
36-
<version>1.2.4</version>
36+
<version>1.2.5</version>
3737
<optional>false</optional>
3838
</dependency>
3939
<dependency>
4040
<groupId>com.oracle.bmc.sdk</groupId>
4141
<artifactId>oracle-bmc-java-sdk-core</artifactId>
42-
<version>1.2.4</version>
42+
<version>1.2.5</version>
4343
<optional>false</optional>
4444
</dependency>
4545
<dependency>
4646
<groupId>com.oracle.bmc.sdk</groupId>
4747
<artifactId>oracle-bmc-java-sdk-identity</artifactId>
48-
<version>1.2.4</version>
48+
<version>1.2.5</version>
4949
<optional>false</optional>
5050
</dependency>
5151
<dependency>
5252
<groupId>com.oracle.bmc.sdk</groupId>
5353
<artifactId>oracle-bmc-java-sdk-objectstorage</artifactId>
54-
<version>1.2.4</version>
54+
<version>1.2.5</version>
5555
<optional>false</optional>
5656
</dependency>
5757
</dependencies>

bmc-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.bmc.sdk</groupId>
77
<artifactId>oracle-bmc-java-sdk</artifactId>
8-
<version>1.2.4</version>
8+
<version>1.2.5</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

bmc-core/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.bmc.sdk</groupId>
77
<artifactId>oracle-bmc-java-sdk</artifactId>
8-
<version>1.2.4</version>
8+
<version>1.2.5</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>com.oracle.bmc.sdk</groupId>
2020
<artifactId>oracle-bmc-java-sdk-common</artifactId>
21-
<version>1.2.4</version>
21+
<version>1.2.5</version>
2222
</dependency>
2323
</dependencies>
2424

bmc-core/src/main/java/com/oracle/bmc/core/Compute.java

+12
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,18 @@ GetConsoleHistoryContentResponse getConsoleHistoryContent(
174174
*/
175175
GetVolumeAttachmentResponse getVolumeAttachment(GetVolumeAttachmentRequest request);
176176

177+
/**
178+
* Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials
179+
* are only valid for the initial login.
180+
*
181+
*
182+
* @param request The request object containing the details to send
183+
* @return A response object containing details about the completed operation
184+
* @throws BmcException when an error occurs.
185+
*/
186+
GetWindowsInstanceInitialCredentialsResponse getWindowsInstanceInitialCredentials(
187+
GetWindowsInstanceInitialCredentialsRequest request);
188+
177189
/**
178190
* Performs one of the power actions (start, stop, softreset, or reset)
179191
* on the specified instance.

bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsync.java

+19
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,25 @@ Future<GetVolumeAttachmentResponse> getVolumeAttachment(
232232
GetVolumeAttachmentRequest request,
233233
AsyncHandler<GetVolumeAttachmentRequest, GetVolumeAttachmentResponse> handler);
234234

235+
/**
236+
* Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials
237+
* are only valid for the initial login.
238+
*
239+
*
240+
* @param request The request object containing the details to send
241+
* @param handler The request handler to invoke upon completion, may be null.
242+
* @return A Future that can be used to get the response if no AsyncHandler was
243+
* provided. Note, if you provide an AsyncHandler and use the Future, some
244+
* types of responses (like InputStream) may not be able to be read in
245+
* both places as the underlying stream may only be consumed once.
246+
*/
247+
Future<GetWindowsInstanceInitialCredentialsResponse> getWindowsInstanceInitialCredentials(
248+
GetWindowsInstanceInitialCredentialsRequest request,
249+
AsyncHandler<
250+
GetWindowsInstanceInitialCredentialsRequest,
251+
GetWindowsInstanceInitialCredentialsResponse>
252+
handler);
253+
235254
/**
236255
* Performs one of the power actions (start, stop, softreset, or reset)
237256
* on the specified instance.

bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsyncClient.java

+22
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,28 @@ public Future<GetVolumeAttachmentResponse> getVolumeAttachment(
320320
return new TransformingFuture<>(responseFuture, transformer);
321321
}
322322

323+
@Override
324+
public Future<GetWindowsInstanceInitialCredentialsResponse>
325+
getWindowsInstanceInitialCredentials(
326+
GetWindowsInstanceInitialCredentialsRequest request,
327+
AsyncHandler<
328+
GetWindowsInstanceInitialCredentialsRequest,
329+
GetWindowsInstanceInitialCredentialsResponse>
330+
handler) {
331+
LOG.trace("Called async getWindowsInstanceInitialCredentials");
332+
request = GetWindowsInstanceInitialCredentialsConverter.interceptRequest(request);
333+
Invocation.Builder ib =
334+
GetWindowsInstanceInitialCredentialsConverter.fromRequest(client, request);
335+
Function<Response, GetWindowsInstanceInitialCredentialsResponse> transformer =
336+
GetWindowsInstanceInitialCredentialsConverter.fromResponse();
337+
338+
Consumer<Response> onSuccess = new SuccessConsumer<>(handler, transformer, request);
339+
Consumer<Throwable> onError = new ErrorConsumer<>(handler, request);
340+
341+
Future<Response> responseFuture = client.get(ib, request, onSuccess, onError);
342+
return new TransformingFuture<>(responseFuture, transformer);
343+
}
344+
323345
@Override
324346
public Future<InstanceActionResponse> instanceAction(
325347
InstanceActionRequest request,

bmc-core/src/main/java/com/oracle/bmc/core/ComputeClient.java

+14
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,20 @@ public GetVolumeAttachmentResponse getVolumeAttachment(GetVolumeAttachmentReques
267267
return transformer.apply(response);
268268
}
269269

270+
@Override
271+
public GetWindowsInstanceInitialCredentialsResponse getWindowsInstanceInitialCredentials(
272+
GetWindowsInstanceInitialCredentialsRequest request) {
273+
LOG.trace("Called getWindowsInstanceInitialCredentials");
274+
request = GetWindowsInstanceInitialCredentialsConverter.interceptRequest(request);
275+
Invocation.Builder ib =
276+
GetWindowsInstanceInitialCredentialsConverter.fromRequest(client, request);
277+
Function<Response, GetWindowsInstanceInitialCredentialsResponse> transformer =
278+
GetWindowsInstanceInitialCredentialsConverter.fromResponse();
279+
280+
Response response = client.get(ib, request);
281+
return transformer.apply(response);
282+
}
283+
270284
@Override
271285
public InstanceActionResponse instanceAction(InstanceActionRequest request) {
272286
LOG.trace("Called instanceAction");

bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ public interface VirtualNetwork extends AutoCloseable {
263263
* You may optionally specify a *display name* for the subnet, otherwise a default is provided.
264264
* It does not have to be unique, and you can change it.
265265
* <p>
266-
* You can also add a DNS label for the subnet, which is required if you want the VCN Resolver to resolve
267-
* hostnames for instances in the subnet. For more information, see
266+
* You can also add a DNS label for the subnet, which is required if you want the Internet and
267+
* VCN Resolver to resolve hostnames for instances in the subnet. For more information, see
268268
* [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
269269
*
270270
*
@@ -293,8 +293,8 @@ public interface VirtualNetwork extends AutoCloseable {
293293
* You may optionally specify a *display name* for the VCN, otherwise a default is provided. It does not have to
294294
* be unique, and you can change it.
295295
* <p>
296-
* You can also add a DNS label for the VCN, which is required if you want the instances to use the VCN Resolver
297-
* option for DNS in the VCN. For more information, see
296+
* You can also add a DNS label for the VCN, which is required if you want the instances to use the
297+
* Interent and VCN Resolver option for DNS in the VCN. For more information, see
298298
* [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
299299
* <p>
300300
* The VCN automatically comes with a default route table, default security list, and default set of DHCP options.

bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ Future<CreateSecurityListResponse> createSecurityList(
305305
* You may optionally specify a *display name* for the subnet, otherwise a default is provided.
306306
* It does not have to be unique, and you can change it.
307307
* <p>
308-
* You can also add a DNS label for the subnet, which is required if you want the VCN Resolver to resolve
309-
* hostnames for instances in the subnet. For more information, see
308+
* You can also add a DNS label for the subnet, which is required if you want the Internet and
309+
* VCN Resolver to resolve hostnames for instances in the subnet. For more information, see
310310
* [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
311311
*
312312
*
@@ -340,8 +340,8 @@ Future<CreateSubnetResponse> createSubnet(
340340
* You may optionally specify a *display name* for the VCN, otherwise a default is provided. It does not have to
341341
* be unique, and you can change it.
342342
* <p>
343-
* You can also add a DNS label for the VCN, which is required if you want the instances to use the VCN Resolver
344-
* option for DNS in the VCN. For more information, see
343+
* You can also add a DNS label for the VCN, which is required if you want the instances to use the
344+
* Interent and VCN Resolver option for DNS in the VCN. For more information, see
345345
* [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
346346
* <p>
347347
* The VCN automatically comes with a default route table, default security list, and default set of DHCP options.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/**
2+
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3+
*/
4+
package com.oracle.bmc.core.internal.http;
5+
6+
import java.io.InputStream;
7+
import java.util.Date;
8+
import java.util.List;
9+
import java.util.Map;
10+
import java.util.HashMap;
11+
12+
import javax.ws.rs.client.*;
13+
import javax.ws.rs.core.*;
14+
15+
import com.oracle.bmc.http.internal.*;
16+
import static com.oracle.bmc.util.internal.HttpUtils.*;
17+
import com.oracle.bmc.model.*;
18+
import com.oracle.bmc.core.model.*;
19+
import com.oracle.bmc.core.requests.*;
20+
import com.oracle.bmc.core.responses.*;
21+
22+
import com.google.common.base.Function;
23+
import com.google.common.base.Optional;
24+
25+
import lombok.extern.slf4j.Slf4j;
26+
27+
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918")
28+
@Slf4j
29+
public class GetWindowsInstanceInitialCredentialsConverter {
30+
private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY =
31+
new ResponseConversionFunctionFactory();
32+
33+
public static GetWindowsInstanceInitialCredentialsRequest interceptRequest(
34+
GetWindowsInstanceInitialCredentialsRequest request) {
35+
36+
return request;
37+
}
38+
39+
public static Invocation.Builder fromRequest(
40+
RestClient client, GetWindowsInstanceInitialCredentialsRequest request) {
41+
if (request == null) {
42+
throw new NullPointerException("request instance is required");
43+
}
44+
45+
if (request.getInstanceId() == null) {
46+
throw new NullPointerException("instanceId is required");
47+
}
48+
49+
WebTarget target =
50+
client.getBaseTarget()
51+
.path("/20160918")
52+
.path("instances")
53+
.path(encodePathSegment(request.getInstanceId()))
54+
.path("initialCredentials");
55+
56+
Invocation.Builder ib = target.request();
57+
58+
ib.accept(MediaType.APPLICATION_JSON);
59+
60+
return ib;
61+
}
62+
63+
public static Function<Response, GetWindowsInstanceInitialCredentialsResponse> fromResponse() {
64+
final Function<Response, GetWindowsInstanceInitialCredentialsResponse> transformer =
65+
new Function<Response, GetWindowsInstanceInitialCredentialsResponse>() {
66+
@Override
67+
public GetWindowsInstanceInitialCredentialsResponse apply(
68+
Response rawResponse) {
69+
LOG.trace(
70+
"Transform function invoked for GetWindowsInstanceInitialCredentialsResponse");
71+
Function<Response, WithHeaders<InstanceCredentials>> responseFn =
72+
RESPONSE_CONVERSION_FACTORY.create(InstanceCredentials.class);
73+
74+
WithHeaders<InstanceCredentials> response = responseFn.apply(rawResponse);
75+
MultivaluedMap<String, String> headers = response.getHeaders();
76+
77+
GetWindowsInstanceInitialCredentialsResponse.Builder builder =
78+
GetWindowsInstanceInitialCredentialsResponse.builder();
79+
80+
builder.instanceCredentials(response.getItem());
81+
82+
Optional<List<String>> opcRequestIdHeader =
83+
HeaderUtils.get(headers, "opc-request-id");
84+
if (opcRequestIdHeader.isPresent()) {
85+
builder.opcRequestId(
86+
HeaderUtils.toValue(
87+
"opc-request-id",
88+
opcRequestIdHeader.get().get(0),
89+
String.class));
90+
}
91+
92+
GetWindowsInstanceInitialCredentialsResponse responseWrapper =
93+
builder.build();
94+
95+
return responseWrapper;
96+
}
97+
};
98+
return transformer;
99+
}
100+
}

bmc-core/src/main/java/com/oracle/bmc/core/model/CreateSubnetDetails.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,22 @@ public static Builder builder() {
135135
/**
136136
* A DNS label for the subnet, used in conjunction with the VNIC's hostname and
137137
* VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
138-
* within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
139-
* Must be unique within the VCN and comply with
140-
* [RFC 952](https://tools.ietf.org/html/rfc952) and
141-
* [RFC 1123](https://tools.ietf.org/html/rfc1123). The value cannot be changed.
138+
* within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
139+
* Must be an alphanumeric string that begins with a letter and is unique within the VCN.
140+
* The value cannot be changed.
142141
* <p>
143-
* This value must be set if you want to use the VCN Resolver to resolve the
142+
* This value must be set if you want to use the Internet and VCN Resolver to resolve the
144143
* hostnames of instances in the subnet. It can only be set if the VCN itself
145144
* was created with a DNS label.
146145
* <p>
147146
* For more information, see
148147
* [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
149148
* <p>
150-
* Example: `subnet-123`
149+
* Example: `subnet123`
151150
*
152151
**/
153152
@JsonProperty("dnsLabel")
154-
@Size(min = 1, max = 63)
153+
@Size(min = 1, max = 15)
155154
String dnsLabel;
156155

157156
/**

0 commit comments

Comments
 (0)