// 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/blockchain"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExamplePreviewScaleBlockchainPlatform() {
// 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 := blockchain.NewBlockchainPlatformClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := blockchain.PreviewScaleBlockchainPlatformRequest{BlockchainPlatformId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-blockchainPlatformId-Value"),
OpcRequestId: common.String("MI1POE1CKHPR7ZE5ULHZ<unique_ID>"),
ScaleBlockchainPlatformDetails: blockchain.ScaleBlockchainPlatformDetails{ModifyPeers: []blockchain.ModifyPeerDetails{blockchain.ModifyPeerDetails{PeerName: common.String("EXAMPLE-peerName-Value"),
OcpuAllocationParam: &blockchain.OcpuAllocationNumberParam{OcpuAllocationNumber: common.Float32(42.6737)}}},
RemoveOsns: []string{"EXAMPLE--Value"},
RemovePeers: []string{"EXAMPLE--Value"},
RemoveReplicas: &blockchain.ReplicaDetails{CaCount: common.Int(9),
ConsoleCount: common.Int(8),
ProxyCount: common.Int(1)},
AddOsns: []blockchain.CreateOsnDetails{blockchain.CreateOsnDetails{Ad: blockchain.AvailabilityDomainAdsAd3,
OcpuAllocationParam: &blockchain.OcpuAllocationNumberParam{OcpuAllocationNumber: common.Float32(53.329353)}}},
AddPeers: []blockchain.CreatePeerDetails{blockchain.CreatePeerDetails{OcpuAllocationParam: &blockchain.OcpuAllocationNumberParam{OcpuAllocationNumber: common.Float32(18.86633)},
Role: blockchain.PeerRoleRoleMember,
Ad: blockchain.AvailabilityDomainAdsAd2,
Alias: common.String("EXAMPLE-alias-Value")}},
AddReplicas: &blockchain.ReplicaDetails{CaCount: common.Int(8),
ConsoleCount: common.Int(4),
ProxyCount: common.Int(2)},
AddStorage: &blockchain.ScaleStorageDetails{StorageSizeInTBs: common.Int(45)}}}
// Send the request using the service client
resp, err := client.PreviewScaleBlockchainPlatform(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}