// 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/database"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleCreateExadataInfrastructure() {
	// 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 := database.NewDatabaseClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := database.CreateExadataInfrastructureRequest{CreateExadataInfrastructureDetails: database.CreateExadataInfrastructureDetails{MultiRackConfigurationFile: []byte("elCifUsEuhocQPY1gZVl"),
		NetworkBondingModeDetails: &database.NetworkBondingModeDetails{BackupNetworkBondingMode: database.NetworkBondingModeDetailsBackupNetworkBondingModeActiveBackup,
			ClientNetworkBondingMode: database.NetworkBondingModeDetailsClientNetworkBondingModeLacp,
			DrNetworkBondingMode:     database.NetworkBondingModeDetailsDrNetworkBondingModeLacp},
		NtpServer:                     []string{"EXAMPLE--Value"},
		Shape:                         common.String("EXAMPLE-shape-Value"),
		CompartmentId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		IsCpsOfflineReportEnabled:     common.Bool(true),
		IsMultiRackDeployment:         common.Bool(false),
		MaintenanceVersionPreferences: &database.MaintenanceVersionPreferenceDetails{ReferenceResourceIdForImageUpdates: common.String("EXAMPLE-referenceResourceIdForImageUpdates-Value")},
		TimeZone:                      common.String("EXAMPLE-timeZone-Value"),
		CloudControlPlaneServer2:      common.String("EXAMPLE-cloudControlPlaneServer2-Value"),
		FreeformTags:                  map[string]string{"EXAMPLE_KEY_NYhA1": "EXAMPLE_VALUE_nh5dR0eKgVxn10rstzeq"},
		InfiniBandNetworkCIDR:         common.String("EXAMPLE-infiniBandNetworkCIDR-Value"),
		Netmask:                       common.String("EXAMPLE-netmask-Value"),
		StorageServerType:             common.String("EXAMPLE-storageServerType-Value"),
		AdminNetworkCIDR:              common.String("EXAMPLE-adminNetworkCIDR-Value"),
		CloudControlPlaneServer1:      common.String("EXAMPLE-cloudControlPlaneServer1-Value"),
		Contacts: []database.ExadataInfrastructureContact{database.ExadataInfrastructureContact{IsContactMosValidated: common.Bool(false),
			IsPrimary:   common.Bool(true),
			Name:        common.String("EXAMPLE-name-Value"),
			PhoneNumber: common.String("EXAMPLE-phoneNumber-Value"),
			Email:       common.String("EXAMPLE-email-Value")}},
		CorporateProxy: common.String("EXAMPLE-corporateProxy-Value"),
		DefinedTags:    map[string]map[string]interface{}{"EXAMPLE_KEY_PGBTG": map[string]interface{}{"EXAMPLE_KEY_MVvsS": "EXAMPLE--Value"}},
		DnsServer:      []string{"EXAMPLE--Value"},
		MaintenanceWindow: &database.MaintenanceWindow{Preference: database.MaintenanceWindowPreferenceNoPreference,
			SkipRu: []database.bool{database.bool{"true"},
				database.bool{"false"}},
			WeeksOfMonth:                 []int{3},
			DaysOfWeek:                   []database.DayOfWeek{database.DayOfWeek{Name: database.DayOfWeekNameSaturday}},
			IsCustomActionTimeoutEnabled: common.Bool(false),
			IsMonthlyPatchingEnabled:     common.Bool(true),
			Months:                       []database.Month{database.Month{Name: database.MonthNameNovember}},
			CustomActionTimeoutInMins:    common.Int(119),
			HoursOfDay:                   []int{2},
			LeadTimeInWeeks:              common.Int(2),
			PatchingMode:                 database.MaintenanceWindowPatchingModeRolling},
		StorageCount:       common.Int(341),
		ComputeCount:       common.Int(199),
		DatabaseServerType: common.String("EXAMPLE-databaseServerType-Value"),
		DisplayName:        common.String("EXAMPLE-displayName-Value"),
		Gateway:            common.String("EXAMPLE-gateway-Value")},
		OpcRequestId:  common.String("L6F97HKIWUHD9SFV8PCA<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

	// Send the request using the service client
	resp, err := client.CreateExadataInfrastructure(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}