// 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).
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.DataintegrationService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Dataintegration
{
public class CreateExternalPublicationExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var createExternalPublicationDetails = new Oci.DataintegrationService.Models.CreateExternalPublicationDetails
{
ApplicationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value",
ApplicationCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value",
DisplayName = "EXAMPLE-displayName-Value",
Description = "EXAMPLE-description-Value",
ResourceConfiguration = new Oci.DataintegrationService.Models.ResourceConfiguration
{
SparkVersion = "EXAMPLE-sparkVersion-Value",
DriverShape = "EXAMPLE-driverShape-Value",
ExecutorShape = "EXAMPLE-executorShape-Value",
TotalExecutors = 370
},
ConfigurationDetails = new Oci.DataintegrationService.Models.ConfigurationDetails
{
DataAsset = new Oci.DataintegrationService.Models.DataAssetFromObjectStorageDetails
{
OciRegion = "EXAMPLE-ociRegion-Value",
Url = "EXAMPLE-url-Value",
TenancyId = "ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value",
Namespace = "EXAMPLE-namespace-Value",
DefaultConnection = new Oci.DataintegrationService.Models.ConnectionFromObjectStorageDetails
{
CredentialFileContent = "EXAMPLE-credentialFileContent-Value",
UserId = "ocid1.test.oc1..<unique_ID>EXAMPLE-userId-Value",
FingerPrint = "EXAMPLE-fingerPrint-Value",
PassPhrase = "EXAMPLE-passPhrase-Value",
Key = "EXAMPLE-key-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
Description = "EXAMPLE-description-Value",
ObjectVersion = 866,
ObjectStatus = 227,
Identifier = "EXAMPLE-identifier-Value",
PrimarySchema = new Oci.DataintegrationService.Models.Schema
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
ResourceName = "EXAMPLE-resourceName-Value",
Description = "EXAMPLE-description-Value",
ObjectVersion = 367,
ExternalKey = "EXAMPLE-externalKey-Value",
IsHasContainers = false,
DefaultConnection = "EXAMPLE-defaultConnection-Value",
ObjectStatus = 559,
Identifier = "EXAMPLE-identifier-Value",
Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
{
CreatedBy = "EXAMPLE-createdBy-Value",
CreatedByName = "EXAMPLE-createdByName-Value",
UpdatedBy = "EXAMPLE-updatedBy-Value",
UpdatedByName = "EXAMPLE-updatedByName-Value",
TimeCreated = DateTime.Parse("12/15/2017 16:32:51"),
TimeUpdated = DateTime.Parse("10/19/2001 07:03:50"),
AggregatorKey = "EXAMPLE-aggregatorKey-Value",
Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
{
Type = "EXAMPLE-type-Value",
Key = "EXAMPLE-key-Value",
Name = "EXAMPLE-name-Value",
Identifier = "EXAMPLE-identifier-Value",
Description = "EXAMPLE-description-Value"
},
IdentifierPath = "EXAMPLE-identifierPath-Value",
InfoFields = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_SzE3q",
"EXAMPLE_VALUE_An5VTuWjEGfzsjvNpVjH"
}
},
RegistryVersion = 413,
Labels = new List<string>
{
"EXAMPLE--Value"
},
IsFavorite = true,
CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
{
ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
{
new Oci.DataintegrationService.Models.CountStatisticSummary
{
ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Application,
ObjectCount = 73
}
}
}
}
},
ConnectionProperties = new List<Oci.DataintegrationService.Models.ConnectionProperty>
{
new Oci.DataintegrationService.Models.ConnectionProperty
{
Name = "EXAMPLE-name-Value",
Value = "EXAMPLE-value-Value"
}
},
IsDefault = false,
Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
{
CreatedBy = "EXAMPLE-createdBy-Value",
CreatedByName = "EXAMPLE-createdByName-Value",
UpdatedBy = "EXAMPLE-updatedBy-Value",
UpdatedByName = "EXAMPLE-updatedByName-Value",
TimeCreated = DateTime.Parse("01/16/2039 10:42:41"),
TimeUpdated = DateTime.Parse("03/25/2011 16:18:53"),
AggregatorKey = "EXAMPLE-aggregatorKey-Value",
Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
{
Type = "EXAMPLE-type-Value",
Key = "EXAMPLE-key-Value",
Name = "EXAMPLE-name-Value",
Identifier = "EXAMPLE-identifier-Value",
Description = "EXAMPLE-description-Value"
},
IdentifierPath = "EXAMPLE-identifierPath-Value",
InfoFields = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_k5mKY",
"EXAMPLE_VALUE_sgI6lL9jycVEemHLa9jS"
}
},
RegistryVersion = 327,
Labels = new List<string>
{
"EXAMPLE--Value"
},
IsFavorite = true,
CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
{
ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
{
new Oci.DataintegrationService.Models.CountStatisticSummary
{
ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Project,
ObjectCount = 187
}
}
}
}
},
Key = "EXAMPLE-key-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
Name = "EXAMPLE-name-Value",
Description = "EXAMPLE-description-Value",
ObjectStatus = 535,
Identifier = "EXAMPLE-identifier-Value",
ExternalKey = "EXAMPLE-externalKey-Value",
AssetProperties = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_QJMkE",
"EXAMPLE_VALUE_WDKPo0OiHgW5Idizb6An"
}
},
NativeTypeSystem = new Oci.DataintegrationService.Models.TypeSystem
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
Description = "EXAMPLE-description-Value",
ObjectVersion = 212,
TypeMappingTo = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_EzPAV",
"EXAMPLE_VALUE_QIx8m8o1ODIAakdLiNez"
}
},
TypeMappingFrom = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_TTmFm",
"EXAMPLE_VALUE_118GxyCPF4K8mZQD7P0k"
}
},
ObjectStatus = 127,
Identifier = "EXAMPLE-identifier-Value",
Types = new List<Oci.DataintegrationService.Models.DataType>
{
new Oci.DataintegrationService.Models.DataType
{
DtType = Oci.DataintegrationService.Models.DataType.DtTypeEnum.Structured,
TypeSystemName = "EXAMPLE-typeSystemName-Value",
ConfigDefinition = new Oci.DataintegrationService.Models.ConfigDefinition
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
IsContained = true,
ObjectStatus = 749,
ConfigParameterDefinitions = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterDefinition>()
{
{
"EXAMPLE_KEY_JSUcJ",
new Oci.DataintegrationService.Models.ConfigParameterDefinition
{
ParameterType = new Oci.DataintegrationService.Models.ConfiguredType
{
WrappedType = "EXAMPLE-wrappedType-Value",
ConfigValues = new Oci.DataintegrationService.Models.ConfigValues
{
ConfigParamValues = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterValue>()
{
{
"EXAMPLE_KEY_qSf0S",
new Oci.DataintegrationService.Models.ConfigParameterValue
{
StringValue = "EXAMPLE-stringValue-Value",
IntValue = 60,
ObjectValue = "EXAMPLE-objectValue-Value",
RefValue = "EXAMPLE-refValue-Value",
ParameterValue = "EXAMPLE-parameterValue-Value",
RootObjectValue = "EXAMPLE-rootObjectValue-Value"
}
}
},
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
}
},
Key = "EXAMPLE-key-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
ObjectStatus = 209,
Description = "EXAMPLE-description-Value"
},
ParameterName = "EXAMPLE-parameterName-Value",
Description = "EXAMPLE-description-Value",
DefaultValue = "EXAMPLE-defaultValue-Value",
ClassFieldName = "EXAMPLE-classFieldName-Value",
IsStatic = false,
IsClassFieldValue = true
}
}
}
},
Key = "EXAMPLE-key-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
ObjectStatus = 670,
Description = "EXAMPLE-description-Value"
}
}
},
ObjectVersion = 30,
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
{
CreatedBy = "EXAMPLE-createdBy-Value",
CreatedByName = "EXAMPLE-createdByName-Value",
UpdatedBy = "EXAMPLE-updatedBy-Value",
UpdatedByName = "EXAMPLE-updatedByName-Value",
TimeCreated = DateTime.Parse("10/27/2039 12:19:17"),
TimeUpdated = DateTime.Parse("11/28/2044 09:52:07"),
AggregatorKey = "EXAMPLE-aggregatorKey-Value",
Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
{
Type = "EXAMPLE-type-Value",
Key = "EXAMPLE-key-Value",
Name = "EXAMPLE-name-Value",
Identifier = "EXAMPLE-identifier-Value",
Description = "EXAMPLE-description-Value"
},
IdentifierPath = "EXAMPLE-identifierPath-Value",
InfoFields = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_7vdoY",
"EXAMPLE_VALUE_78ekKD5GoZ9Vgh7yieuG"
}
},
RegistryVersion = 823,
Labels = new List<string>
{
"EXAMPLE--Value"
},
IsFavorite = true,
CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
{
ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
{
new Oci.DataintegrationService.Models.CountStatisticSummary
{
ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Task,
ObjectCount = 784
}
}
}
},
KeyMap = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_5NswV",
"EXAMPLE_VALUE_AKO0fMPT62mRF9XRKfNv"
}
}
},
Connection = new Oci.DataintegrationService.Models.ConnectionFromAdwc
{
TnsAlias = "EXAMPLE-tnsAlias-Value",
TnsNames = new List<string>
{
"EXAMPLE--Value"
},
Username = "EXAMPLE-username-Value",
Password = "EXAMPLE-password-Value",
PasswordSecret = new Oci.DataintegrationService.Models.SensitiveAttribute
{
SecretConfig = new Oci.DataintegrationService.Models.OciVaultSecretConfig
{
SecretId = "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"
},
Value = "EXAMPLE-value-Value"
},
Key = "EXAMPLE-key-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
Description = "EXAMPLE-description-Value",
ObjectVersion = 934,
ObjectStatus = 459,
Identifier = "EXAMPLE-identifier-Value",
PrimarySchema = new Oci.DataintegrationService.Models.Schema
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
ResourceName = "EXAMPLE-resourceName-Value",
Description = "EXAMPLE-description-Value",
ObjectVersion = 498,
ExternalKey = "EXAMPLE-externalKey-Value",
IsHasContainers = true,
DefaultConnection = "EXAMPLE-defaultConnection-Value",
ObjectStatus = 962,
Identifier = "EXAMPLE-identifier-Value",
Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
{
CreatedBy = "EXAMPLE-createdBy-Value",
CreatedByName = "EXAMPLE-createdByName-Value",
UpdatedBy = "EXAMPLE-updatedBy-Value",
UpdatedByName = "EXAMPLE-updatedByName-Value",
TimeCreated = DateTime.Parse("11/07/2040 20:52:26"),
TimeUpdated = DateTime.Parse("05/16/2015 04:49:10"),
AggregatorKey = "EXAMPLE-aggregatorKey-Value",
Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
{
Type = "EXAMPLE-type-Value",
Key = "EXAMPLE-key-Value",
Name = "EXAMPLE-name-Value",
Identifier = "EXAMPLE-identifier-Value",
Description = "EXAMPLE-description-Value"
},
IdentifierPath = "EXAMPLE-identifierPath-Value",
InfoFields = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_Q7MY7",
"EXAMPLE_VALUE_Icm4zciRhkYOQZoHbeUL"
}
},
RegistryVersion = 620,
Labels = new List<string>
{
"EXAMPLE--Value"
},
IsFavorite = true,
CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
{
ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
{
new Oci.DataintegrationService.Models.CountStatisticSummary
{
ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Application,
ObjectCount = 818
}
}
}
}
},
ConnectionProperties = new List<Oci.DataintegrationService.Models.ConnectionProperty>
{
new Oci.DataintegrationService.Models.ConnectionProperty
{
Name = "EXAMPLE-name-Value",
Value = "EXAMPLE-value-Value"
}
},
IsDefault = false,
Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
{
CreatedBy = "EXAMPLE-createdBy-Value",
CreatedByName = "EXAMPLE-createdByName-Value",
UpdatedBy = "EXAMPLE-updatedBy-Value",
UpdatedByName = "EXAMPLE-updatedByName-Value",
TimeCreated = DateTime.Parse("01/19/2011 22:35:36"),
TimeUpdated = DateTime.Parse("04/24/2029 02:02:15"),
AggregatorKey = "EXAMPLE-aggregatorKey-Value",
Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
{
Type = "EXAMPLE-type-Value",
Key = "EXAMPLE-key-Value",
Name = "EXAMPLE-name-Value",
Identifier = "EXAMPLE-identifier-Value",
Description = "EXAMPLE-description-Value"
},
IdentifierPath = "EXAMPLE-identifierPath-Value",
InfoFields = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_85NbV",
"EXAMPLE_VALUE_9pRK0RiWfT0HUdghxC2C"
}
},
RegistryVersion = 77,
Labels = new List<string>
{
"EXAMPLE--Value"
},
IsFavorite = false,
CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
{
ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
{
new Oci.DataintegrationService.Models.CountStatisticSummary
{
ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Application,
ObjectCount = 731
}
}
}
},
KeyMap = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_oM0xm",
"EXAMPLE_VALUE_WiuWUJizT6Wq2J5Xe89u"
}
}
},
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
Schema = new Oci.DataintegrationService.Models.Schema
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
Name = "EXAMPLE-name-Value",
ResourceName = "EXAMPLE-resourceName-Value",
Description = "EXAMPLE-description-Value",
ObjectVersion = 277,
ExternalKey = "EXAMPLE-externalKey-Value",
IsHasContainers = false,
DefaultConnection = "EXAMPLE-defaultConnection-Value",
ObjectStatus = 40,
Identifier = "EXAMPLE-identifier-Value",
Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
{
CreatedBy = "EXAMPLE-createdBy-Value",
CreatedByName = "EXAMPLE-createdByName-Value",
UpdatedBy = "EXAMPLE-updatedBy-Value",
UpdatedByName = "EXAMPLE-updatedByName-Value",
TimeCreated = DateTime.Parse("02/19/2010 05:40:20"),
TimeUpdated = DateTime.Parse("08/01/2027 10:41:29"),
AggregatorKey = "EXAMPLE-aggregatorKey-Value",
Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
{
Type = "EXAMPLE-type-Value",
Key = "EXAMPLE-key-Value",
Name = "EXAMPLE-name-Value",
Identifier = "EXAMPLE-identifier-Value",
Description = "EXAMPLE-description-Value"
},
IdentifierPath = "EXAMPLE-identifierPath-Value",
InfoFields = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_S0Fnm",
"EXAMPLE_VALUE_u9lLoHxdHJWgh1vFrGSG"
}
},
RegistryVersion = 775,
Labels = new List<string>
{
"EXAMPLE--Value"
},
IsFavorite = false,
CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
{
ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
{
new Oci.DataintegrationService.Models.CountStatisticSummary
{
ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.FunctionLibrary,
ObjectCount = 874
}
}
}
}
}
}
};
var createExternalPublicationRequest = new Oci.DataintegrationService.Requests.CreateExternalPublicationRequest
{
WorkspaceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
TaskKey = "EXAMPLE-taskKey-Value",
CreateExternalPublicationDetails = createExternalPublicationDetails,
OpcRequestId = "YWUJFT79X3PXMY5DGMFF<unique_ID>",
OpcRetryToken = "EXAMPLE-opcRetryToken-Value"
};
// 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.
var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
try
{
// Create a service client and send the request.
using (var client = new DataIntegrationClient(provider, new ClientConfiguration()))
{
var response = await client.CreateExternalPublication(createExternalPublicationRequest);
// Retrieve value from the response.
var applicationIdValue = response.ExternalPublication.ApplicationId;
}
}
catch (Exception e)
{
Console.WriteLine($"CreateExternalPublication Failed with {e.Message}");
throw e;
}
}
}
}