// 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/dataflow"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleCreateSqlEndpoint() {
// 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 := dataflow.NewDataFlowClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := dataflow.CreateSqlEndpointRequest{CreateSqlEndpointDetails: dataflow.CreateSqlEndpointDetails{FreeformTags: map[string]string{"EXAMPLE_KEY_rOnoT": "EXAMPLE_VALUE_0leQvzl4gJjTwIw6qMk3"},
LogGroupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value"),
MetastoreId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-metastoreId-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_TQMTp": map[string]interface{}{"EXAMPLE_KEY_uSI89": "EXAMPLE--Value"}},
DriverShapeConfig: &dataflow.ShapeConfig{MemoryInGBs: common.Float32(1256.4736),
Ocpus: common.Float32(1451.8076)},
LakeId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-lakeId-Value"),
LogCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logCompartmentId-Value"),
LogDisplayName: common.String("EXAMPLE-logDisplayName-Value"),
LogRetentionDuration: common.Int(126),
MaxExecutorCount: common.Int(507),
NetworkConfiguration: dataflow.SqlEndpointSecureAccessConfig{PublicEndpointIp: common.String("EXAMPLE-publicEndpointIp-Value"),
AccessControlRules: []dataflow.SecureAccessControlRule{dataflow.SecureAccessControlRule{IpNotation: dataflow.IpNotationTypeVcnOcid,
Value: common.String("EXAMPLE-value-Value"),
VcnIps: common.String("EXAMPLE-vcnIps-Value")}}},
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
MinExecutorCount: common.Int(571),
SparkAdvancedConfigurations: map[string]string{"EXAMPLE_KEY_afhUe": "EXAMPLE_VALUE_IaZbv9TEb3tKvnGY23pI"},
SqlEndpointVersion: common.String("EXAMPLE-sqlEndpointVersion-Value"),
WarehouseBucketUri: common.String("EXAMPLE-warehouseBucketUri-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
DriverShape: common.String("EXAMPLE-driverShape-Value"),
ExecutorShape: common.String("EXAMPLE-executorShape-Value"),
ExecutorShapeConfig: &dataflow.ShapeConfig{MemoryInGBs: common.Float32(5604.493),
Ocpus: common.Float32(8209.102)}},
OpcRequestId: common.String("JVCELJ9TI04ORFFML3UF<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}
// Send the request using the service client
resp, err := client.CreateSqlEndpoint(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}