// 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{ExecutorShape: common.String("EXAMPLE-executorShape-Value"),
MinExecutorCount: common.Int(414),
LakeId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-lakeId-Value"),
MaxExecutorCount: common.Int(358),
SparkAdvancedConfigurations: map[string]string{"EXAMPLE_KEY_xkkZH": "EXAMPLE_VALUE_OVIfZ9uFNHXGNLMOn7Ui"},
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DriverShapeConfig: &dataflow.ShapeConfig{MemoryInGBs: common.Float32(2191.0227),
Ocpus: common.Float32(2062.7712)},
FreeformTags: map[string]string{"EXAMPLE_KEY_Oq1r0": "EXAMPLE_VALUE_jOypeiuTB4RZG4gV0ZHT"},
SqlEndpointVersion: common.String("EXAMPLE-sqlEndpointVersion-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_lCj2v": map[string]interface{}{"EXAMPLE_KEY_u8QBg": "EXAMPLE--Value"}},
DriverShape: common.String("EXAMPLE-driverShape-Value"),
ExecutorShapeConfig: &dataflow.ShapeConfig{MemoryInGBs: common.Float32(9176.768),
Ocpus: common.Float32(5793.4307)},
MetastoreId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-metastoreId-Value"),
NetworkConfiguration: dataflow.SqlEndpointSecureAccessConfig{AccessControlRules: []dataflow.SecureAccessControlRule{dataflow.SecureAccessControlRule{IpNotation: dataflow.IpNotationTypeCidr,
Value: common.String("EXAMPLE-value-Value"),
VcnIps: common.String("EXAMPLE-vcnIps-Value")}},
PublicEndpointIp: common.String("EXAMPLE-publicEndpointIp-Value")},
WarehouseBucketUri: common.String("EXAMPLE-warehouseBucketUri-Value")},
OpcRequestId: common.String("OFG4RYMGHZL53RJYXNOC<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)
}