// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
import * as goldengate from "oci-goldengate";
import common = require("oci-common");
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new goldengate.GoldenGateClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createDeploymentDetails = {
displayName: "EXAMPLE-displayName-Value",
licenseModel: goldengate.models.LicenseModel.LicenseIncluded,
isByolCpuCoreCountLimitEnabled: true,
byolCpuCoreCountLimit: 206,
environmentType: goldengate.models.EnvironmentType.DevelopmentOrTesting,
description: "EXAMPLE-description-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
sourceDeploymentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDeploymentId-Value",
availabilityDomain: "EXAMPLE-availabilityDomain-Value",
faultDomain: "EXAMPLE-faultDomain-Value",
placements: [{
availabilityDomain: "EXAMPLE-availabilityDomain-Value",
faultDomain: "EXAMPLE-faultDomain-Value",
}
],
freeformTags: {
EXAMPLE_KEY_SxV6t :"EXAMPLE_VALUE_5ul1qTf0S3WSxzc1Z4nA"
},
definedTags: {
EXAMPLE_KEY_OTqZ4 :{
EXAMPLE_KEY_UyhLD :"EXAMPLE--Value"
}
},
locks: [{
type: goldengate.models.AddResourceLockDetails.Type.Delete,
message: "EXAMPLE-message-Value",
}
],
deploymentBackupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-deploymentBackupId-Value",
subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
loadBalancerSubnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-loadBalancerSubnetId-Value",
fqdn: "EXAMPLE-fqdn-Value",
nsgIds: ["EXAMPLE--Value" ],
isPublic: false,
cpuCoreCount: 8,
isAutoScalingEnabled: false,
deploymentType: goldengate.models.DeploymentType.Bigdata,
subscriptionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
clusterPlacementGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value",
securityAttributes: {
EXAMPLE_KEY_7w1TL :{
EXAMPLE_KEY_jBXUh :"EXAMPLE--Value"
}
},
oggData: {
deploymentName: "EXAMPLE-deploymentName-Value",
credentialStore: goldengate.models.CredentialStore.Goldengate,
identityDomainId: "ocid1.test.oc1..<unique_ID>EXAMPLE-identityDomainId-Value",
passwordSecretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value",
adminUsername: "EXAMPLE-adminUsername-Value",
adminPassword: "EXAMPLE-adminPassword-Value",
certificate: "EXAMPLE-certificate-Value",
key: "EXAMPLE-key-Value",
oggVersion: "EXAMPLE-oggVersion-Value",
groupToRolesMapping: {
securityGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-securityGroupId-Value",
administratorGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-administratorGroupId-Value",
operatorGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-operatorGroupId-Value",
userGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-userGroupId-Value",
}
,
}
,
maintenanceWindow: {
day: goldengate.models.Day.Wednesday,
startHour: 6,
}
,
maintenanceConfiguration: {
isInterimReleaseAutoUpgradeEnabled: true,
interimReleaseUpgradePeriodInDays: 376,
bundleReleaseUpgradePeriodInDays: 594,
majorReleaseUpgradePeriodInDays: 850,
securityPatchUpgradePeriodInDays: 996,
}
,
backupSchedule: {
timeBackupScheduled: new Date("Mon Feb 11 04:57:14 UTC 2030"),
frequencyBackupScheduled: goldengate.models.CreateBackupScheduleDetails.FrequencyBackupScheduled.Weekly,
bucketName: "EXAMPLE-bucketName-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
namespaceName: "EXAMPLE-namespaceName-Value",
isMetadataOnly: false,
}
,
}
const createDeploymentRequest: goldengate.requests.CreateDeploymentRequest = {
createDeploymentDetails: createDeploymentDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "4F5GLKI7ZVBH7Y67YRL9<unique_ID>",
};
// Send request to the Client.
const createDeploymentResponse = await client.createDeployment(createDeploymentRequest);
}
catch (error) {
console.log("createDeployment Failed with error " + error);
}
})();