// 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/dif"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleAddService() {
// 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 := dif.NewStackClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := dif.AddServiceRequest{AddServiceDetails: dif.AddServiceDetails{Objectstorage: []dif.ObjectStorageDetail{dif.ObjectStorageDetail{StorageTier: dif.StorageTierArchive,
AutoTiering: dif.AutoTieringDisabled,
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
ObjectVersioning: dif.ObjectVersioningDisabled}},
Omk: []dif.OmkDetail{dif.OmkDetail{ClusterId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value"),
ClusterNamespaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterNamespaceId-Value"),
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
NamespaceName: common.String("EXAMPLE-namespaceName-Value")}},
Services: []dif.ServiceEnum{dif.ServiceOke},
Aidataplatform: []dif.AiDataPlatformDetail{dif.AiDataPlatformDetail{DefaultWorkspaceName: common.String("EXAMPLE-defaultWorkspaceName-Value"),
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
Dataflow: []dif.DataflowDetail{dif.DataflowDetail{LogBucketInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logBucketInstanceId-Value"),
NumExecutors: common.Int(435),
PrivateEndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value"),
SparkVersion: common.String("EXAMPLE-sparkVersion-Value"),
WarehouseBucketInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-warehouseBucketInstanceId-Value"),
DriverShape: common.String("EXAMPLE-driverShape-Value"),
DriverShapeConfig: &dif.ShapeConfig{MemoryInGBs: common.Int(432),
Ocpus: common.Int(233)},
ExecutorShape: common.String("EXAMPLE-executorShape-Value"),
ExecutorShapeConfig: &dif.ShapeConfig{Ocpus: common.Int(154),
MemoryInGBs: common.Int(784)},
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
Connections: &dif.DataflowConnections{ConnectionDetails: &dif.DataflowConnectionDetails{DifDependencies: []dif.DifDependencyDetails{dif.DifDependencyDetails{ServiceInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value"),
ServiceType: common.String("EXAMPLE-serviceType-Value")}},
DomainNames: []string{"EXAMPLE--Value"}},
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}}},
Ggcs: []dif.GgcsDetail{dif.GgcsDetail{Connections: []dif.GgcsConnectionDetails{dif.GgcsConnectionDetails{ConnectionName: common.String("EXAMPLE-connectionName-Value"),
DifDependencies: []dif.DifDependencyDetails{dif.DifDependencyDetails{ServiceInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value"),
ServiceType: common.String("EXAMPLE-serviceType-Value")}},
GgAdminSecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-ggAdminSecretId-Value"),
ConnectionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-connectionId-Value")}},
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
Ocpu: common.Int(709),
OggVersion: common.String("EXAMPLE-oggVersion-Value"),
PasswordSecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value"),
PublicSubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-publicSubnetId-Value"),
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}},
Oke: []dif.OkeDetail{dif.OkeDetail{ClusterId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value"),
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
NamespaceName: common.String("EXAMPLE-namespaceName-Value")}},
StackTemplates: []dif.StackTemplateEnum{dif.StackTemplateDatapipeline},
Adb: []dif.AdbDetail{dif.AdbDetail{DbWorkload: dif.DbWorkloadOltp,
Ecpu: common.Int(320),
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
ToolsPublicAccess: common.String("EXAMPLE-toolsPublicAccess-Value"),
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
IsMtlsConnectionRequired: common.Bool(true),
IsPublic: common.Bool(true),
AdminPasswordId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-adminPasswordId-Value"),
DataStorageSizeInTBs: common.Int(827),
DbVersion: common.String("EXAMPLE-dbVersion-Value")}},
Genai: []dif.GenAiDetail{dif.GenAiDetail{ClusterType: dif.ClusterTypeHosting,
Endpoints: []dif.EndpointDetails{dif.EndpointDetails{EndpointName: common.String("EXAMPLE-endpointName-Value"),
IsContentModerationEnabled: common.Bool(false)}},
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
OciRegion: common.String("EXAMPLE-ociRegion-Value"),
UnitCount: common.Int(595),
BaseModel: common.String("EXAMPLE-baseModel-Value")}}},
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcRequestId: common.String("PTTIJAKJO5GRA3TGTFUK<unique_ID>"),
StackId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-stackId-Value")}
// Send the request using the service client
resp, err := client.AddService(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}