// 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 databasemigration from "oci-databasemigration";
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 databasemigration.DatabaseMigrationClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  createMigrationDetails = {
		databaseCombination: "ORACLE",		dataTransferMediumDetails: {
			type: "NFS",			objectStorageBucket: {
				namespaceName: "EXAMPLE-namespaceName-Value",
				bucketName: "EXAMPLE-bucketName-Value",

				}
,
			source: {
				kind: "CURL",				walletLocation: "EXAMPLE-walletLocation-Value"

				}
,
			target: {
				kind: "CURL",				walletLocation: "EXAMPLE-walletLocation-Value"

				}
,
			sharedStorageMountTargetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-sharedStorageMountTargetId-Value"

			}
,
		initialLoadSettings: {
			dataPumpParameters: {
				isCluster: false,
				estimate: databasemigration.models.DataPumpEstimate.Blocks,
				tableExistsAction: databasemigration.models.DataPumpTableExistsAction.Skip,
				excludeParameters: [databasemigration.models.DataPumpExcludeParameters.Index,databasemigration.models.DataPumpExcludeParameters.MaterializedView,databasemigration.models.DataPumpExcludeParameters.MaterializedViewLog						],
				importParallelismDegree: 14,
				exportParallelismDegree: 90,

				}
,
			tablespaceDetails: {
				targetType: "ADB_D_AUTOCREATE",				isAutoCreate: false,
				isBigFile: false,
				extendSizeInMBs: 82181516,
				blockSizeInKBs: databasemigration.models.DataPumpTablespaceBlockSizesInKb.Size32K

				}
,
			exportDirectoryObject: {
				name: "EXAMPLE-name-Value",
				path: "EXAMPLE-path-Value",

				}
,
			importDirectoryObject: {
				name: "EXAMPLE-name-Value",
				path: "EXAMPLE-path-Value",

				}
,
			jobMode: databasemigration.models.JobModeOracle.Transportable,
			metadataRemaps: [{
					type: databasemigration.models.MetadataRemap.Type.Tablespace,
					oldValue: "EXAMPLE-oldValue-Value",
					newValue: "EXAMPLE-newValue-Value",

					}
					],

			}
,
		advisorSettings: {
			isSkipAdvisor: true,
			isIgnoreErrors: true,

			}
,
		hubDetails: {
			restAdminCredentials: {
				username: "EXAMPLE-username-Value",
				password: "EXAMPLE-password-Value",

				}
,
			url: "EXAMPLE-url-Value",
			computeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-computeId-Value",
			vaultId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
			keyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value",
			extract: {
				performanceProfile: databasemigration.models.ExtractPerformanceProfile.Low,
				longTransDuration: 701,

				}
,
			replicat: {
				performanceProfile: databasemigration.models.ReplicatPerformanceProfile.Low,

				}
,
			acceptableLag: 10,

			}
,
		ggsDetails: {
			extract: {
				performanceProfile: databasemigration.models.ExtractPerformanceProfile.Low,
				longTransDuration: 622,

				}
,
			replicat: {
				performanceProfile: databasemigration.models.ReplicatPerformanceProfile.High,

				}
,
			acceptableLag: 19,

			}
,
		advancedParameters: [{
				value: "EXAMPLE-value-Value",
				name: "EXAMPLE-name-Value",
				dataType: databasemigration.models.AdvancedParameterDataTypes.Integer,

				}
				],
		sourceContainerDatabaseConnectionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-sourceContainerDatabaseConnectionId-Value",
		sourceStandbyDatabaseConnectionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-sourceStandbyDatabaseConnectionId-Value",
		excludeObjects: [{
				owner: "EXAMPLE-owner-Value",
				objectName: "EXAMPLE-objectName-Value",
				type: "EXAMPLE-type-Value",
				isOmitExcludedTableFromReplication: false,

				}
				],
		includeObjects: [{
				owner: "EXAMPLE-owner-Value",
				objectName: "EXAMPLE-objectName-Value",
				type: "EXAMPLE-type-Value",
				isOmitExcludedTableFromReplication: false,

				}
				],
		bulkIncludeExcludeData: "EXAMPLE-bulkIncludeExcludeData-Value",
		description: "EXAMPLE-description-Value",
		compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
		type: databasemigration.models.MigrationTypes.Online,
		displayName: "EXAMPLE-displayName-Value",
		sourceDatabaseConnectionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value",
		targetDatabaseConnectionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value",
		freeformTags: {
			EXAMPLE_KEY_HWcoc :"EXAMPLE_VALUE_TU5LFGu8B0ASRNwmwzQ9"
			},
		definedTags: {
			EXAMPLE_KEY_Zx4X2 :{
				EXAMPLE_KEY_6z452 :"EXAMPLE--Value"
				}
			}

		}

	const createMigrationRequest: databasemigration.requests.CreateMigrationRequest = { 
	createMigrationDetails: createMigrationDetails,
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",
	opcRequestId: "0LKU0Q7BVBS8ICHFVF2G<unique_ID>",

		}; 


     // Send request to the Client.
     const createMigrationResponse = await client.createMigration(createMigrationRequest);
     }
     catch (error) {
         console.log("createMigration Failed with error  " + error);
     }
})();