// 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"
"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 ExampleCreateWorkspace() {
// 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).
req := dataintegration.CreateWorkspaceRequest{CreateWorkspaceDetails: dataintegration.CreateWorkspaceDetails{IsPrivateNetworkEnabled: common.Bool(true),
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
Description: common.String("EXAMPLE-description-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_8Udtj": map[string]interface{}{"EXAMPLE_KEY_BxWPh": "EXAMPLE--Value"}},
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
SubnetId: common.String("o7H3vBaY5vQeNDwii5copEEwCiyf2rcDzcmdbEFkp2Tdmc8T9MKHE57TikbD8sux9YpSndTAst04alKudpTxHOOuiao5J30AUISKIAlPQ6M9GiGf5nthYrIkD4nFwX6aE5QY3c3963gkramphhZhhtaiiYiLzgRIazftUxQbckXdP2uFeDpFkhydlvvXytCVsFvGvuHME9EAI6oNWU6tdpj1ZgAsD736WAj1rrc6vXsSC4QGC2j0x669OPhwuHJ"),
VcnId: common.String("pFX1tMXaYi7Yc1q9M9jpzvqYL3HY6hCMi0QQ3xTjlCveOnmtPU96VIjbS3tDQPkz553N7l4x0RcOnWwR6OG6alF2DXC0YHpA7KwYtIsE742zbGfJHCoXyTYb1LxyWdGmyyTcCfM4bQzbRk09OVD4b2jAqLmjGNGtwKWvnfp6qGeHXhZspnabhYZoGRfRqA2jLc4UHfjf8JrdzQ4joEbNzf5utLUiB3oDduyjtQxUFgaZEzaNbhyn2p4XxaNjNbk"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_B8DHc": "EXAMPLE_VALUE_iFujDgO1dnFPHEKkAmuS"},
CompartmentId: common.String("QHbGCXcBeRlos81Mb8fsDw76i15Hvca4XDGq7wuLSiBfjjEAbL04Dyp7aEMslSI2xIcl3qpuDsBfsx7iPCgRqKEEpQQWeC2BJafiC1eSf1P4xiYLk6RLB6h9bzMkC7UVrAXDIyWjbTlpWkt1ov3Jhi4wfPRzUFtIbeari2NTtcp1xBHTjtmIyS59N0jZHQo1HgA4IWrOpl8bnEZrEVsiqUZjDb9NbOSQMVlo7HHvG4ydUrCGRVNtbZOEFXeqbAf"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_VRiwy": "EXAMPLE_VALUE_RM7YQeKS8szT5xzGDkxS"}},
OpcRequestId: common.String("JOVBQDCOPF0IXXSEQXZO<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}
// Send the request using the service client
resp, err := client.CreateWorkspace(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}