// 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.BringYourOwnLicense,
environmentType: goldengate.models.EnvironmentType.Production,
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_A56It :"EXAMPLE_VALUE_87uKkkBCOyVmW0aOkzQY"
},
definedTags: {
EXAMPLE_KEY_cleTH :{
EXAMPLE_KEY_7vbRt :"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: true,
cpuCoreCount: 2,
isAutoScalingEnabled: false,
deploymentType: goldengate.models.DeploymentType.DatabaseMicrosoftSqlserver,
oggData: {
deploymentName: "EXAMPLE-deploymentName-Value",
credentialStore: goldengate.models.CredentialStore.Iam,
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.Sunday,
startHour: 15,
}
,
maintenanceConfiguration: {
isInterimReleaseAutoUpgradeEnabled: true,
interimReleaseUpgradePeriodInDays: 998,
bundleReleaseUpgradePeriodInDays: 503,
majorReleaseUpgradePeriodInDays: 30,
securityPatchUpgradePeriodInDays: 406,
}
,
backupSchedule: {
timeBackupScheduled: new Date("Fri Aug 24 13:34:41 UTC 2029"),
frequencyBackupScheduled: goldengate.models.CreateBackupScheduleDetails.FrequencyBackupScheduled.Daily,
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: "GJ6U6YUKCCP7LBKQZLVI<unique_ID>",
};
// Send request to the Client.
const createDeploymentResponse = await client.createDeployment(createDeploymentRequest);
}
catch (error) {
console.log("createDeployment Failed with error " + error);
}
})();