Skip to content

Commit be59a2e

Browse files
authored
Merge pull request #27 from oracle/release_2020-10-13
Releasing version 1.6.0
2 parents c49c11a + 2970ec2 commit be59a2e

File tree

404 files changed

+10897
-1190
lines changed

Some content is hidden

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

404 files changed

+10897
-1190
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/).
55

6+
## 1.6.0 - 2020-10-13
7+
### Added
8+
- Support for API definitions in the API Gateway service
9+
- Support for pattern-based logical entities, namespace-bound custom properties, and faceted search in the Data Catalog service
10+
- Support for autonomous Data Guard on autonomous infrastructure in the Database service
11+
- Support for creating a Data Guard association on an existing standby database home in the Database service
12+
- Support for upgrading cloud VM cluster grid infrastructure in the Database service
13+
- Support for Circuit Breakers
14+
15+
16+
### Breaking
17+
- Attribute `isQuickStart` in models `CreateLogSavedSearchDetails`, `LogSavedSearchSummary`,`UpdateLogSavedSearchDetails` and `LogSavedSearch` is removed from the Logging Management service
18+
- Lifecycle State `DELETED` is removed from the Logging Management service
19+
620
## 1.5.7 - 2020-10-06
721
### Added
822
- Support for calling Oracle Cloud Infrastructure services in the me-dubai-1 region
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4+
*/
5+
6+
const common = require("oci-common");
7+
const identity = require("oci-identity");
8+
const audit = require("oci-audit");
9+
const configurationFilePath = "~/.oci/config";
10+
const configProfile = "DEFAULT";
11+
12+
/* This script demostrates how to create a circuit breaker and share the circuit breaker among clients.
13+
*/
14+
const provider = new common.ConfigFileAuthenticationDetailsProvider(
15+
configurationFilePath,
16+
configProfile
17+
);
18+
const compartmentId = provider.getTenantId();
19+
20+
(async () => {
21+
// Options for creating a circuit breaker
22+
const options = {
23+
timeout: 10000, // If our function takes longer than 10 seconds, trigger a failure
24+
errorThresholdPercentage: 50, // When 50% of requests fail, trip the circuit
25+
resetTimeout: 30000 // After 30 seconds, try again.
26+
};
27+
const clientConfiguration = {
28+
circuitBreaker: new common.CircuitBreaker(options)
29+
};
30+
// Use the circuitBreaker to create identity client
31+
const identityClient = new identity.IdentityClient(
32+
{ authenticationDetailsProvider: provider },
33+
clientConfiguration
34+
);
35+
36+
// Share the same circuitBreaker to create audit client.
37+
const auditClient = new audit.AuditClient(
38+
{ authenticationDetailsProvider: provider },
39+
clientConfiguration
40+
);
41+
42+
let listUserReq = {
43+
compartmentId: compartmentId
44+
};
45+
46+
const response = await identityClient.listUsers(listUserReq);
47+
console.log("List User Repsonse: ", response);
48+
49+
const endTime = new Date();
50+
const offset = new Date().setDate(new Date().getDate() - 5);
51+
const startTime = new Date(offset);
52+
const listEventRequest = {
53+
compartmentId: compartmentId,
54+
startTime: startTime,
55+
endTime: endTime
56+
};
57+
try {
58+
const listEventResponse = await auditClient.listEvents(listEventRequest);
59+
console.log("response: ", listEventResponse);
60+
} catch (err) {
61+
console.log("what is err: ", err);
62+
}
63+
})();
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4+
*/
5+
6+
import common = require("oci-common");
7+
import * as identity from "oci-identity";
8+
import * as audit from "oci-audit";
9+
10+
const configurationFilePath = "~/.oci/config";
11+
const configProfile = "DEFAULT";
12+
13+
/* This script demostrates how to create a circuit breaker and share the circuit breaker among clients.
14+
*/
15+
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider(
16+
configurationFilePath,
17+
configProfile
18+
);
19+
const compartmentId = provider.getTenantId();
20+
21+
(async () => {
22+
// Options for creating a circuit breaker
23+
const options = {
24+
timeout: 10000, // If our function takes longer than 10 seconds, trigger a failure
25+
errorThresholdPercentage: 50, // When 50% of requests fail, trip the circuit
26+
resetTimeout: 30000 // After 30 seconds, try again.
27+
};
28+
const clientConfiguration = {
29+
circuitBreaker: new common.CircuitBreaker(options)
30+
};
31+
32+
// Use the circuitBreaker to create identity client
33+
const identityClient = new identity.IdentityClient(
34+
{ authenticationDetailsProvider: provider },
35+
clientConfiguration
36+
);
37+
38+
// Share the same circuitBreaker to create audit client.
39+
const auditClient = new audit.AuditClient(
40+
{ authenticationDetailsProvider: provider },
41+
clientConfiguration
42+
);
43+
44+
let listUserReq: identity.requests.ListUsersRequest;
45+
listUserReq = {
46+
compartmentId: compartmentId
47+
};
48+
49+
const response = await identityClient.listUsers(listUserReq);
50+
console.log("List User Repsonse: ", response);
51+
52+
const endTime: Date = new Date();
53+
const offset = new Date().setDate(new Date().getDate() - 5);
54+
const startTime: Date = new Date(offset);
55+
const listEventRequest: audit.requests.ListEventsRequest = {
56+
compartmentId: compartmentId,
57+
startTime: startTime,
58+
endTime: endTime
59+
};
60+
try {
61+
const listEventResponse = await auditClient.listEvents(listEventRequest);
62+
console.log("response: ", listEventResponse);
63+
} catch (err) {
64+
console.log("what is err: ", err);
65+
}
66+
})();

lib/analytics/lib/client.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,22 @@ export class AnalyticsClient {
3232
protected "_defaultHeaders": any = {};
3333
protected "_waiters": AnalyticsWaiter;
3434
protected "_clientConfiguration": common.ClientConfiguration;
35+
protected _circuitBreaker = null;
3536

3637
protected _httpClient: common.HttpClient;
3738

38-
constructor(params: common.AuthParams) {
39+
constructor(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration) {
3940
const requestSigner = params.authenticationDetailsProvider
4041
? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
4142
: null;
42-
this._httpClient = params.httpClient || new common.FetchHttpClient(requestSigner);
43+
if (clientConfiguration) {
44+
this._clientConfiguration = clientConfiguration;
45+
this._circuitBreaker = clientConfiguration.circuitBreaker
46+
? clientConfiguration.circuitBreaker!.circuit
47+
: null;
48+
}
49+
this._httpClient =
50+
params.httpClient || new common.FetchHttpClient(requestSigner, this._circuitBreaker);
4351

4452
if (
4553
params.authenticationDetailsProvider &&
@@ -123,13 +131,6 @@ export class AnalyticsClient {
123131
throw Error("Waiters do not exist. Please create waiters.");
124132
}
125133

126-
/**
127-
* Sets the client configuration for the client
128-
*/
129-
public set clientConfiguration(clientConfiguration: common.ClientConfiguration) {
130-
this._clientConfiguration = clientConfiguration;
131-
}
132-
133134
/**
134135
* Change the compartment of an Analytics instance. The operation is long-running
135136
* and creates a new WorkRequest.

lib/analytics/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oci-analytics",
3-
"version": "1.5.7",
3+
"version": "1.6.0",
44
"description": "OCI NodeJS client for Analytics Service",
55
"repository": {
66
"type": "git",

lib/announcementsservice/lib/client.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,22 @@ export class AnnouncementClient {
2828
protected "_endpoint": string = "";
2929
protected "_defaultHeaders": any = {};
3030
protected "_clientConfiguration": common.ClientConfiguration;
31+
protected _circuitBreaker = null;
3132

3233
protected _httpClient: common.HttpClient;
3334

34-
constructor(params: common.AuthParams) {
35+
constructor(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration) {
3536
const requestSigner = params.authenticationDetailsProvider
3637
? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
3738
: null;
38-
this._httpClient = params.httpClient || new common.FetchHttpClient(requestSigner);
39+
if (clientConfiguration) {
40+
this._clientConfiguration = clientConfiguration;
41+
this._circuitBreaker = clientConfiguration.circuitBreaker
42+
? clientConfiguration.circuitBreaker!.circuit
43+
: null;
44+
}
45+
this._httpClient =
46+
params.httpClient || new common.FetchHttpClient(requestSigner, this._circuitBreaker);
3947

4048
if (
4149
params.authenticationDetailsProvider &&
@@ -96,13 +104,6 @@ export class AnnouncementClient {
96104
);
97105
}
98106

99-
/**
100-
* Sets the client configuration for the client
101-
*/
102-
public set clientConfiguration(clientConfiguration: common.ClientConfiguration) {
103-
this._clientConfiguration = clientConfiguration;
104-
}
105-
106107
/**
107108
* Gets the details of a specific announcement.
108109
*

lib/announcementsservice/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oci-announcementsservice",
3-
"version": "1.5.7",
3+
"version": "1.6.0",
44
"description": "OCI NodeJS client for Announcement Service",
55
"repository": {
66
"type": "git",

lib/apigateway/lib/apigateway-waiter.ts

+19
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ export class ApiGatewayWaiter {
2626
private readonly config?: WaiterConfiguration
2727
) {}
2828

29+
/**
30+
* Waits forApi till it reaches any of the provided states
31+
*
32+
* @param request the request to send
33+
* @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states
34+
* @return response returns GetApiResponse | null (null in case of 404 response)
35+
*/
36+
public async forApi(
37+
request: serviceRequests.GetApiRequest,
38+
...targetStates: models.Api.LifecycleState[]
39+
): Promise<serviceResponses.GetApiResponse | null> {
40+
return genericTerminalConditionWaiter(
41+
this.config,
42+
() => this.client.getApi(request),
43+
response => targetStates.exists(response.api.lifecycleState),
44+
targetStates.includes(models.Api.LifecycleState.Deleted)
45+
);
46+
}
47+
2948
/**
3049
* Waits forCertificate till it reaches any of the provided states
3150
*

0 commit comments

Comments
 (0)