Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file.

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

## 1.4.0 - 2020-08-04
### Added
- Support for calling Oracle Cloud Infrastructure services in the uk-gov-cardiff-1 region
- Support for creating and managing private endpoints in the Data Flow service
- Support for changing instance shapes and restarting nodes in the Big Data service
- Support for additional versions (for example CSQL) in the Big Data service
- Support for creating stacks from compartments in the Resource Manager service
- Support for retry mechanism


### Breaking
- Updated the property of `LifeCycleDetails` to `LifecycleDetails` from the model of `BlockchainPlatformSummary` and `BlockchainPlatformByHostname` in the blockchain service
- Change all enums to pascal case.

## 1.3.0 - 2020-07-28
### Added
- Support for calling Oracle Cloud Infrastructure services in the us-sanjose-1 region
Expand Down
8 changes: 4 additions & 4 deletions examples/javascript/containerengine-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async function createVcn(client, compartmentId) {
const getVcnRequest = { vcnId: response.vcn.id };
const getVcnResponse = await VirtualNetworkWaiter.forVcn(
getVcnRequest,
core.models.Vcn.LifecycleState.AVAILABLE
core.models.Vcn.LifecycleState.Available
);
return getVcnResponse.vcn;
}
Expand Down Expand Up @@ -228,7 +228,7 @@ async function waitForWorkRequestFinished(client, workRequestId) {
async function isWorkRequestInSuccessState(workRequestResponse) {
let inSuccessState = false;
const workRequestStatus = workRequestResponse.workRequest.status;
if (workRequestStatus === oke.models.WorkRequestStatus.SUCCEEDED) {
if (workRequestStatus === oke.models.WorkRequestStatus.Succeeded) {
inSuccessState = true;
}
return inSuccessState;
Expand Down Expand Up @@ -284,7 +284,7 @@ async function deleteSubnet(client, subnet) {
// // Wait for some time for subnet lifecycle staus changed to terminated.
// await VirtualNetworkWaiter.forSubnet(
// getSubnetRequest,
// core.models.Subnet.LifecycleState.TERMINATED
// core.models.Subnet.LifecycleState.Terminated
// );
}

Expand All @@ -293,7 +293,7 @@ async function deleteVcn(client, vcn) {
await client.deleteVcn(request);
const getVcnRequest = { vcnId: vcn.id };
// Wait for some time for VCN lifecycle staus changed to terminated.
// await VirtualNetworkWaiter.forVcn(getVcnRequest, core.models.Vcn.LifecycleState.TERMINATED);
// await VirtualNetworkWaiter.forVcn(getVcnRequest, core.models.Vcn.LifecycleState.Terminated);
}

const run = main();
77 changes: 77 additions & 0 deletions examples/javascript/custom-retry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* 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.

@param args Arguments to provide to the example. The following arguments are expected:
* <ul>
* <li>The first argument is the OCID of the tenancy.</li>
* <li>The second argument is the OCID of the compartment.</li>
* <li>The third argument is region.</li>
* </ul>
*/

const identity = require("oci-identity");
const common = require("oci-common");

const configurationFilePath = "~/.oci/config";
const configProfile = "DEFAULT";

const provider = new common.ConfigFileAuthenticationDetailsProvider(
configurationFilePath,
configProfile
);
const args = process.argv.slice(2);
console.log(args);
if (args.length !== 3) {
console.error(
"Unexpected number of arguments received. Consult the script header comments for expected arguments"
);
process.exit(-1);
}

const tenancyId = args[0];
const compartmentId = args[1];
const region = args[2];

let subnetId = null;
let vcnId = null;
let instanceId = null;

const identityClient = new identity.IdentityClient({
authenticationDetailsProvider: provider
});
identityClient.regionId = region;

async function getAvailabilityDomain() {
const request = {
compartmentId: tenancyId
};

identityClient.clientConfiguration = {
retryConfiguration: {
terminationStrategy: new common.MaxTimeTerminationStrategy(200),
delayStrategy: new common.ExponentialBackoffDelayStrategy(30),
retryCondition: response => {
return response.status === 409;
}
}
};
request.retryConfiguration = {
terminationStrategy: new common.MaxAttemptsTerminationStrategy(5),
delayStrategy: new common.ExponentialBackoffDelayStrategy(80),
retryCondition: response => {
return response.status === 405;
}
};
const response = await identityClient.listAvailabilityDomains(request);
return response.items[0];
}

(async () => {
try {
const availabilityDomain = await getAvailabilityDomain();
console.log("Availability Domain :" + availabilityDomain.name);
} catch (error) {
console.log("Error executing example" + error);
}
})();
14 changes: 7 additions & 7 deletions examples/javascript/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function deleteSubnet() {

await virtualNetworkWaiter.forSubnet(
getSubnetRequest,
core.models.Subnet.LifecycleState.TERMINATED
core.models.Subnet.LifecycleState.Terminated
);

subnetId = null;
Expand All @@ -108,7 +108,7 @@ async function deleteVcn() {
vcnId: vcnId
};

await virtualNetworkWaiter.forVcn(getVcnRequest, core.models.Vcn.LifecycleState.TERMINATED);
await virtualNetworkWaiter.forVcn(getVcnRequest, core.models.Vcn.LifecycleState.Terminated);

vcnId = null;
}
Expand All @@ -132,7 +132,7 @@ async function terminateDbSystem() {

await databaseWaiter.forDbSystem(
getDbSystemRequest,
database.models.DbSystem.LifecycleState.TERMINATED
database.models.DbSystem.LifecycleState.Terminated
);

dbSystemId = null;
Expand Down Expand Up @@ -165,7 +165,7 @@ async function terminateDbSystem() {

const getVcnResponse = await virtualNetworkWaiter.forVcn(
getVcnRequest,
core.models.Vcn.LifecycleState.AVAILABLE
core.models.Vcn.LifecycleState.Available
);

vcnId = getVcnResponse.vcn.id;
Expand All @@ -188,7 +188,7 @@ async function terminateDbSystem() {

const getSubnetResponse = await virtualNetworkWaiter.forSubnet(
getSubnetRequest,
core.models.Subnet.LifecycleState.AVAILABLE
core.models.Subnet.LifecycleState.Available
);

subnetId = getSubnetResponse.subnet.id;
Expand All @@ -205,7 +205,7 @@ async function terminateDbSystem() {
},
compartmentId: compartmentId,
cpuCoreCount: 4,
databaseEdition: database.models.LaunchDbSystemDetails.DatabaseEdition.ENTERPRISEEDITION,
databaseEdition: database.models.LaunchDbSystemDetails.DatabaseEdition.EnterpriseEdition,
displayName: "typescript database",
hostname: "typescript-sdk-example-db-host",
shape: "BM.DenseIO1.36",
Expand All @@ -228,7 +228,7 @@ async function terminateDbSystem() {

const getDbSystemResponse = await databaseWaiter.forDbSystem(
getDbSystemRequest,
database.models.DbSystem.LifecycleState.AVAILABLE
database.models.DbSystem.LifecycleState.Available
);
dbSystemId = getDbSystemResponse.dbSystem.id;
} catch (error) {
Expand Down
22 changes: 11 additions & 11 deletions examples/javascript/filestorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async function createVcn(client, compartmentId) {
const getVcnRequest = { vcnId: response.vcn.id };
const getVcnResponse = await vcnWaiter.forVcn(
getVcnRequest,
core.models.Vcn.LifecycleState.AVAILABLE
core.models.Vcn.LifecycleState.Available
);
return getVcnResponse.vcn;
}
Expand Down Expand Up @@ -234,7 +234,7 @@ async function createSubnet(client, compartmentId, availabilityDomain, vcnId) {
const getSubnetRequest = { subnetId: response.subnet.id };
const getSubnetResponse = await vcnWaiter.forSubnet(
getSubnetRequest,
core.models.Subnet.LifecycleState.AVAILABLE
core.models.Subnet.LifecycleState.Available
);
return getSubnetResponse.subnet;
}
Expand Down Expand Up @@ -275,7 +275,7 @@ async function createFileSystem(client, compartmentId, fileSystemDisplayName, ad
};
const getFileSystemResponse = await filestorageWaiter.forFileSystem(
getFsSyetemRequest,
fs.models.FileSystem.LifecycleState.ACTIVE
fs.models.FileSystem.LifecycleState.Active
);
/*
* If we try and send through the same request with the same retry token then this will not create a
Expand Down Expand Up @@ -350,7 +350,7 @@ async function createMountTarget(
};
const getMountTargetResponse = await filestorageWaiter.forMountTarget(
getMtTargetRequest,
fs.models.MountTarget.LifecycleState.ACTIVE
fs.models.MountTarget.LifecycleState.Active
);

/*
Expand Down Expand Up @@ -445,7 +445,7 @@ async function createExport(client, fileSystemId, exportSetId) {
const getExportRequest = { exportId: response.export.id };
const getExportResponse = await filestorageWaiter.forExport(
getExportRequest,
fs.models.Export.LifecycleState.ACTIVE
fs.models.Export.LifecycleState.Active
);
/*
* If we try and send through the same request with the same retry token then this will not create a
Expand Down Expand Up @@ -551,7 +551,7 @@ async function createSnapshot(client, fileSystem) {

const getSnapShotResponse = await filestorageWaiter.forSnapshot(
getSnapShotRequest,
fs.models.Snapshot.LifecycleState.ACTIVE
fs.models.Snapshot.LifecycleState.Active
);

/*
Expand Down Expand Up @@ -587,7 +587,7 @@ async function deleteSnapshot(client, snapshot) {
const getSnapshotRequest = { snapshotId: snapshot.id };
await filestorageWaiter.forSnapshot(
getSnapshotRequest,
fs.models.Snapshot.LifecycleState.DELETED
fs.models.Snapshot.LifecycleState.Deleted
);
}

Expand All @@ -602,7 +602,7 @@ async function deleteExport(client, exportModel) {
await client.deleteExport(request);
// Waiting for export to be deleted
const getExportRequest = { exportId: exportModel.id };
await filestorageWaiter.forExport(getExportRequest, fs.models.Export.LifecycleState.DELETED);
await filestorageWaiter.forExport(getExportRequest, fs.models.Export.LifecycleState.Deleted);
}

/**
Expand All @@ -623,7 +623,7 @@ async function deleteMountTarget(client, mountTarget) {
};
await filestorageWaiter.forMountTarget(
getMountTargetRequest,
fs.models.MountTarget.LifecycleState.DELETED
fs.models.MountTarget.LifecycleState.Deleted
);
}

Expand All @@ -640,7 +640,7 @@ async function deleteFileSystem(client, fileSystem) {
const getFileSystemRequest = { fileSystemId: fileSystem.id };
await filestorageWaiter.forFileSystem(
getFileSystemRequest,
fs.models.FileSystem.LifecycleState.DELETED
fs.models.FileSystem.LifecycleState.Deleted
);
}

Expand Down Expand Up @@ -688,7 +688,7 @@ async function deleteVcn(client, vcn) {
// wait for VCN to be deleted
// NOTE: Not needed because VCN gets delete already. When getting the Request, it won't be found.
// const getVcnRequest = { vcnId: vcn.id };
// await vcnWaiter.forVcn(getVcnRequest, core.models.Vcn.LifecycleState.TERMINATED);
// await vcnWaiter.forVcn(getVcnRequest, core.models.Vcn.LifecycleState.Terminated);
}

/**
Expand Down
Loading