// 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).
package main
import (
"context"
"fmt"
"time"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/dataintegration"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleCreateDataAsset() {
// 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.
client, err := dataintegration.NewDataIntegrationClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
var defaultValue interface{}
defaultValue = "EXAMPLE-defaultValue-Value"
req := dataintegration.CreateDataAssetRequest{CreateDataAssetDetails: dataintegration.CreateDataAssetFromAdwc{AutonomousDbId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDbId-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
Description: common.String("EXAMPLE-description-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(978),
WalletPasswordSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
Value: common.String("EXAMPLE-value-Value")},
AssetProperties: map[string]string{"EXAMPLE_KEY_mXvC5": "EXAMPLE_VALUE_PNqrMdntNNRdoNe2fOjJ"},
CredentialFileContent: common.String("EXAMPLE-credentialFileContent-Value"),
DriverClass: common.String("EXAMPLE-driverClass-Value"),
RegionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-regionId-Value"),
ServiceName: common.String("EXAMPLE-serviceName-Value"),
StagingConnection: dataintegration.ConnectionFromLake{ConnectionProperties: []dataintegration.ConnectionProperty{dataintegration.ConnectionProperty{Name: common.String("EXAMPLE-name-Value"),
Value: common.String("EXAMPLE-value-Value")}},
Description: common.String("EXAMPLE-description-Value"),
IsDefault: common.Bool(true),
KeyMap: map[string]string{"EXAMPLE_KEY_vZqyS": "EXAMPLE_VALUE_JaHXJ3Mp5hIYcKHgKebY"},
Metadata: &dataintegration.ObjectMetadata{UpdatedBy: common.String("EXAMPLE-updatedBy-Value"),
CreatedByName: common.String("EXAMPLE-createdByName-Value"),
InfoFields: map[string]string{"EXAMPLE_KEY_iXs3N": "EXAMPLE_VALUE_mNb6clTfkZKqIKJijWje"},
IsFavorite: common.Bool(false),
Labels: []string{"EXAMPLE--Value"},
TimeCreated: &common.SDKTime{Time: time.Now()},
UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
Aggregator: &dataintegration.AggregatorSummary{Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: common.String("EXAMPLE-type-Value")},
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(485),
ObjectType: dataintegration.CountStatisticSummaryObjectTypeDataFlow}}},
CreatedBy: common.String("EXAMPLE-createdBy-Value"),
IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
RegistryVersion: common.Int(245),
TimeUpdated: &common.SDKTime{Time: time.Now()}},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(181),
Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectVersion: common.Int(666),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
PrimarySchema: &dataintegration.Schema{ResourceName: common.String("EXAMPLE-resourceName-Value"),
Description: common.String("EXAMPLE-description-Value"),
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
Metadata: &dataintegration.ObjectMetadata{TimeUpdated: &common.SDKTime{Time: time.Now()},
Aggregator: &dataintegration.AggregatorSummary{Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: common.String("EXAMPLE-type-Value")},
CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(775),
ObjectType: dataintegration.CountStatisticSummaryObjectTypeUserDefinedFunction}}},
IsFavorite: common.Bool(true),
RegistryVersion: common.Int(325),
UpdatedBy: common.String("EXAMPLE-updatedBy-Value"),
UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
CreatedBy: common.String("EXAMPLE-createdBy-Value"),
CreatedByName: common.String("EXAMPLE-createdByName-Value"),
IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
InfoFields: map[string]string{"EXAMPLE_KEY_8LVmb": "EXAMPLE_VALUE_t89msQEAIDMgaGF9YBku"},
Labels: []string{"EXAMPLE--Value"},
TimeCreated: &common.SDKTime{Time: time.Now()}},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(588),
ObjectVersion: common.Int(40),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
DefaultConnection: common.String("EXAMPLE-defaultConnection-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
IsHasContainers: common.Bool(true),
Key: common.String("EXAMPLE-key-Value")}},
TenancyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value"),
DefaultConnection: &dataintegration.CreateConnectionFromAdwc{TnsAlias: common.String("EXAMPLE-tnsAlias-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(340),
Password: common.String("EXAMPLE-password-Value"),
PasswordSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
Value: common.String("EXAMPLE-value-Value")},
TnsNames: []string{"EXAMPLE--Value"},
ConnectionProperties: []dataintegration.ConnectionProperty{dataintegration.ConnectionProperty{Value: common.String("EXAMPLE-value-Value"),
Name: common.String("EXAMPLE-name-Value")}},
Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
RegistryMetadata: &dataintegration.RegistryMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
IsFavorite: common.Bool(false),
Key: common.String("EXAMPLE-key-Value"),
Labels: []string{"EXAMPLE--Value"},
RegistryVersion: common.Int(243)},
Username: common.String("EXAMPLE-username-Value"),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
RegistryMetadata: &dataintegration.RegistryMetadata{RegistryVersion: common.Int(252),
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
IsFavorite: common.Bool(false),
Key: common.String("EXAMPLE-key-Value"),
Labels: []string{"EXAMPLE--Value"}},
StagingDataAsset: dataintegration.DataAssetFromOraclePeopleSoftDetails{NativeTypeSystem: &dataintegration.TypeSystem{ObjectVersion: common.Int(160),
Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
ObjectStatus: common.Int(346),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
TypeMappingFrom: map[string]string{"EXAMPLE_KEY_feAvL": "EXAMPLE_VALUE_rKNAKTazme6j2o3BP1k2"},
TypeMappingTo: map[string]string{"EXAMPLE_KEY_7Tvas": "EXAMPLE_VALUE_HuvnOUId2zVZv86VaHe1"},
Types: []dataintegration.DataType{dataintegration.DataType{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
TypeSystemName: common.String("EXAMPLE-typeSystemName-Value"),
Description: common.String("EXAMPLE-description-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ConfigDefinition: &dataintegration.ConfigDefinition{IsContained: common.Bool(false),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(252),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_hJ4VH": dataintegration.ConfigParameterDefinition{Description: common.String("EXAMPLE-description-Value"),
IsClassFieldValue: common.Bool(false),
IsStatic: common.Bool(true),
ParameterName: common.String("EXAMPLE-parameterName-Value"),
ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
DefaultValue: &defaultValue}}},
DtType: dataintegration.DataTypeDtTypeStructured,
Key: common.String("EXAMPLE-key-Value"),
ObjectStatus: common.Int(356)}},
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value")},
Sid: common.String("EXAMPLE-sid-Value"),
WalletPasswordSecret: &dataintegration.SensitiveAttribute{Value: common.String("EXAMPLE-value-Value"),
SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")}},
DriverClass: common.String("EXAMPLE-driverClass-Value"),
Metadata: &dataintegration.ObjectMetadata{Labels: []string{"EXAMPLE--Value"},
RegistryVersion: common.Int(970),
TimeUpdated: &common.SDKTime{Time: time.Now()},
Aggregator: &dataintegration.AggregatorSummary{Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: common.String("EXAMPLE-type-Value"),
Description: common.String("EXAMPLE-description-Value")},
CreatedByName: common.String("EXAMPLE-createdByName-Value"),
IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
InfoFields: map[string]string{"EXAMPLE_KEY_tacJm": "EXAMPLE_VALUE_SEoAhL01c334xSEFLwyy"},
IsFavorite: common.Bool(false),
TimeCreated: &common.SDKTime{Time: time.Now()},
UpdatedBy: common.String("EXAMPLE-updatedBy-Value"),
UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(470),
ObjectType: dataintegration.CountStatisticSummaryObjectTypeTask}}},
CreatedBy: common.String("EXAMPLE-createdBy-Value")},
Port: common.String("EXAMPLE-port-Value"),
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
KeyMap: map[string]string{"EXAMPLE_KEY_ApfXe": "EXAMPLE_VALUE_iefjPa7HAYmHA8rSb8vj"},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(198),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ServiceName: common.String("EXAMPLE-serviceName-Value"),
WalletSecret: &dataintegration.SensitiveAttribute{Value: common.String("EXAMPLE-value-Value"),
SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")}},
DefaultConnection: &dataintegration.ConnectionFromOraclePeopleSoftDetails{Description: common.String("EXAMPLE-description-Value"),
Metadata: &dataintegration.ObjectMetadata{CreatedByName: common.String("EXAMPLE-createdByName-Value"),
InfoFields: map[string]string{"EXAMPLE_KEY_F6ngg": "EXAMPLE_VALUE_utQxrsgVzZ8EgchuezoP"},
IsFavorite: common.Bool(true),
RegistryVersion: common.Int(301),
UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
Aggregator: &dataintegration.AggregatorSummary{Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: common.String("EXAMPLE-type-Value"),
Description: common.String("EXAMPLE-description-Value")},
CreatedBy: common.String("EXAMPLE-createdBy-Value"),
IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
Labels: []string{"EXAMPLE--Value"},
TimeCreated: &common.SDKTime{Time: time.Now()},
TimeUpdated: &common.SDKTime{Time: time.Now()},
UpdatedBy: common.String("EXAMPLE-updatedBy-Value"),
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(954),
ObjectType: dataintegration.CountStatisticSummaryObjectTypeProject}}}},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Password: common.String("EXAMPLE-password-Value"),
PasswordSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
Value: common.String("EXAMPLE-value-Value")},
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
ObjectStatus: common.Int(364),
ObjectVersion: common.Int(577),
PrimarySchema: &dataintegration.Schema{ObjectVersion: common.Int(825),
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")},
ResourceName: common.String("EXAMPLE-resourceName-Value"),
DefaultConnection: common.String("EXAMPLE-defaultConnection-Value"),
Description: common.String("EXAMPLE-description-Value"),
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
IsHasContainers: common.Bool(true),
Metadata: &dataintegration.ObjectMetadata{InfoFields: map[string]string{"EXAMPLE_KEY_FX2sw": "EXAMPLE_VALUE_ZPdb8l5QQKJzn73U6W0h"},
TimeCreated: &common.SDKTime{Time: time.Now()},
UpdatedBy: common.String("EXAMPLE-updatedBy-Value"),
Aggregator: &dataintegration.AggregatorSummary{Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: common.String("EXAMPLE-type-Value"),
Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value")},
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
CreatedBy: common.String("EXAMPLE-createdBy-Value"),
IsFavorite: common.Bool(false),
Labels: []string{"EXAMPLE--Value"},
RegistryVersion: common.Int(204),
TimeUpdated: &common.SDKTime{Time: time.Now()},
UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectType: dataintegration.CountStatisticSummaryObjectTypeTask,
ObjectCount: common.Int64(263)}}},
CreatedByName: common.String("EXAMPLE-createdByName-Value"),
IdentifierPath: common.String("EXAMPLE-identifierPath-Value")},
Name: common.String("EXAMPLE-name-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(315)},
ConnectionProperties: []dataintegration.ConnectionProperty{dataintegration.ConnectionProperty{Name: common.String("EXAMPLE-name-Value"),
Value: common.String("EXAMPLE-value-Value")}},
IsDefault: common.Bool(true),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
Username: common.String("EXAMPLE-username-Value")},
Host: common.String("EXAMPLE-host-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
ObjectVersion: common.Int(996),
AssetProperties: map[string]string{"EXAMPLE_KEY_7Zckd": "EXAMPLE_VALUE_3aLHm9HqWdmQBxtjzmna"},
Description: common.String("EXAMPLE-description-Value")},
BucketSchema: &dataintegration.Schema{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
DefaultConnection: common.String("EXAMPLE-defaultConnection-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
IsHasContainers: common.Bool(false),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(243),
ObjectVersion: common.Int(649),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ResourceName: common.String("EXAMPLE-resourceName-Value"),
Description: common.String("EXAMPLE-description-Value"),
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
Key: common.String("EXAMPLE-key-Value"),
Metadata: &dataintegration.ObjectMetadata{RegistryVersion: common.Int(499),
TimeCreated: &common.SDKTime{Time: time.Now()},
UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
Aggregator: &dataintegration.AggregatorSummary{Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: common.String("EXAMPLE-type-Value"),
Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value")},
AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
CreatedByName: common.String("EXAMPLE-createdByName-Value"),
IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
IsFavorite: common.Bool(true),
TimeUpdated: &common.SDKTime{Time: time.Now()},
UpdatedBy: common.String("EXAMPLE-updatedBy-Value"),
CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(65),
ObjectType: dataintegration.CountStatisticSummaryObjectTypeFolder}}},
CreatedBy: common.String("EXAMPLE-createdBy-Value"),
InfoFields: map[string]string{"EXAMPLE_KEY_zXLjk": "EXAMPLE_VALUE_Gledbd6gikPRFDEdOeiT"},
Labels: []string{"EXAMPLE--Value"}}},
Identifier: common.String("EXAMPLE-identifier-Value"),
WalletSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
Value: common.String("EXAMPLE-value-Value")}},
OpcRequestId: common.String("EOKOACR5KM9QJGDZ9WCK<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")}
// Send the request using the service client
resp, err := client.CreateDataAsset(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}