// 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/datacc"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleUpdateInfrastructure() {
// 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 := datacc.NewBaseinfraClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := datacc.UpdateInfrastructureRequest{UpdateInfrastructureDetails: datacc.UpdateInfrastructureDetails{CorporateProxy: common.String("EXAMPLE-corporateProxy-Value"),
CpsNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond6,
Netmask: common.String("EXAMPLE-netmask-Value"),
NtpServers: []string{"EXAMPLE--Value"},
SystemModel: datacc.SystemModelEnumX11Ha768,
AdminNetworkcidr: common.String("EXAMPLE-adminNetworkcidr-Value"),
ClientNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond5,
Contacts: []datacc.InfrastructureContact{datacc.InfrastructureContact{Email: common.String("EXAMPLE-email-Value"),
IsContactMosValidated: common.Bool(false),
IsPrimary: common.Bool(false),
Name: common.String("EXAMPLE-name-Value"),
PhoneNumber: common.String("EXAMPLE-phoneNumber-Value")}},
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_UwcKJ": map[string]interface{}{"EXAMPLE_KEY_cA6ne": "EXAMPLE--Value"}},
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServers: []string{"EXAMPLE--Value"},
Shape: datacc.ShapeEnumEighteenSsds,
VlanId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value"),
AcfsFileSystemStorageInGbs: common.Float64(8596.117),
BackupNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond2,
BackupNetworkBondingMode: datacc.NetworkBondingModeLacp,
CpsNetworkBondingMode: datacc.NetworkBondingModeActiveBackup,
DataDiskPercentage: common.Int(22),
FreeformTags: map[string]string{"EXAMPLE_KEY_A5Gqv": "EXAMPLE_VALUE_bp3GVRPiDgSZmyTLN1C7"},
Gateway: common.String("EXAMPLE-gateway-Value"),
MaintenanceWindow: &datacc.MaintenanceWindow{Preference: datacc.MaintenancePreferenceNoPreference,
CustomActionTimeoutInMins: common.Int(337),
DaysOfWeek: []datacc.MaintenanceWindowDaysOfWeekEnum{datacc.MaintenanceWindowDaysOfWeekSaturday},
LeadTimeInWeeks: common.Int(2),
PatchingMode: datacc.BasePatchingModeRolling,
WeeksOfMonth: []int{1},
HoursOfDay: []int{17},
IsCustomActionTimeoutEnabled: common.Bool(false),
IsMonthlyPatchingEnabled: common.Bool(false),
Months: []datacc.MaintenanceWindowMonthsEnum{datacc.MaintenanceWindowMonthsOctober}},
ClientNetworkBondingMode: datacc.NetworkBondingModeLacp,
CloudControlPlaneServer1: common.String("EXAMPLE-cloudControlPlaneServer1-Value"),
CloudControlPlaneServer2: common.String("EXAMPLE-cloudControlPlaneServer2-Value")},
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
InfrastructureId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-infrastructureId-Value"),
OpcRequestId: common.String("W9ZXDU9GN93Y4QIPS98G<unique_ID>")}
// Send the request using the service client
resp, err := client.UpdateInfrastructure(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}