// 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{OpcRequestId: common.String("G8VQUUAADKYCVIFRGQ8U<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
CreateWorkspaceDetails: dataintegration.CreateWorkspaceDetails{EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
VcnId: common.String("YFRYpolQk00jIAF2X8Nz3C5T42RPc0WasrXXQSa4nSKoK41Zb4U6Z2kEzQgLJOkmZa7u9HWgswPRC8TSLJ2XZKRQsBfhd059hDf3hPIDhNia4V1pfL1G3pgvkzEwxqbADffYR9H9o1er28Y9kNCTWyHWwGDyt8CfznHrosHViiFOzzheOvy8BTkiCbz1NyWoJiK6YJ2XL7Bbm9mj7XLRjSswVZlLYzlFFbaX2Cps7lIuDe56NGjRfctjBIB8I6c"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_gPiNy": "EXAMPLE_VALUE_lFXfJd9pd7HEJCaIr8eB"},
CompartmentId: common.String("gdulBobIZW415xbsUFk5o51UTpx8wHGG04QsGVEfKDidxAVbygsBqOgyFf5UATS3Cq7EyOIWIoDZPPVci7i6gLwWgkzMYSgGEfA9pZo9j1CSzEt8D29L8MQ7or6SfLBDpcTwXHs7Riwfce6b6MDd1NeTOq8Pm9Lah7L52umG1TH2fY5fG6RLBsT6pnertlDQ8I0DufjaQ2eN3Ptpbz3ZHFpoNhKWQv9f6GXrzHgjIic6UevHJH80eOlpkuO92EK"),
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_pDkt9": "EXAMPLE_VALUE_vaCqeCx6iCVuAHglkrqt"},
IsPrivateNetworkEnabled: common.Bool(true),
SubnetId: common.String("6Je1JBjSoUsdnGu3Iy0G3DeDiW8hcZrYkDdadQDXOgeeGiWIn9POtwIRAal7hXaGcubjTQvye1MxVhN0wUalmRf09qqx0hSSHqhgIxrkH2RPUUgN2bUPbBYlNsYuapqJ8lTqooPYgHvUf21Zs82R4HhC7aNsdkLcQN5BiQQtSwc9Svgt2Tvlcnw0vYDKS5L0LuW3eyfLCFaeBeDzmOlSnkCYOg5CSZinUbIL5j01FYamFc4luSAGFT2Uyrz6hof"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_n7uDN": map[string]interface{}{"EXAMPLE_KEY_W1teA": "EXAMPLE--Value"}},
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-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)
}