// 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).
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.RoverService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Rover
{
public class CreateRoverClusterExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var createRoverClusterDetails = new Oci.RoverService.Models.CreateRoverClusterDetails
{
DisplayName = "EXAMPLE-displayName-Value",
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
ClusterSize = 22,
CustomerShippingAddress = new Oci.RoverService.Models.ShippingAddress
{
Addressee = "EXAMPLE-addressee-Value",
CareOf = "EXAMPLE-careOf-Value",
Address1 = "EXAMPLE-address1-Value",
Address2 = "EXAMPLE-address2-Value",
Address3 = "EXAMPLE-address3-Value",
Address4 = "EXAMPLE-address4-Value",
CityOrLocality = "EXAMPLE-cityOrLocality-Value",
StateOrRegion = "EXAMPLE-stateOrRegion-Value",
Zipcode = "EXAMPLE-zipcode-Value",
Country = "EXAMPLE-country-Value",
PhoneNumber = "EXAMPLE-phoneNumber-Value",
Email = "EXAMPLE-email-Value"
},
ClusterWorkloads = new List<Oci.RoverService.Models.RoverWorkload>
{
new Oci.RoverService.Models.RoverWorkload
{
Name = "EXAMPLE-name-Value",
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
Id = "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
Size = "EXAMPLE-size-Value",
ObjectCount = "EXAMPLE-objectCount-Value",
Prefix = "EXAMPLE-prefix-Value",
RangeStart = "EXAMPLE-rangeStart-Value",
RangeEnd = "EXAMPLE-rangeEnd-Value",
WorkloadType = "EXAMPLE-workloadType-Value",
WorkRequestId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workRequestId-Value"
}
},
ClusterType = Oci.RoverService.Models.ClusterType.Standalone,
SuperUserPassword = "EXAMPLE-superUserPassword-Value",
EnclosureType = Oci.RoverService.Models.EnclosureType.Ruggadized,
UnlockPassphrase = "EXAMPLE-unlockPassphrase-Value",
PointOfContact = "EXAMPLE-pointOfContact-Value",
PointOfContactPhoneNumber = "EXAMPLE-pointOfContactPhoneNumber-Value",
ShippingPreference = Oci.RoverService.Models.CreateRoverClusterDetails.ShippingPreferenceEnum.OracleShipped,
ShippingVendor = "EXAMPLE-shippingVendor-Value",
TimePickupExpected = DateTime.Parse("01/12/2019 06:11:03"),
OracleShippingTrackingUrl = "EXAMPLE-oracleShippingTrackingUrl-Value",
SubscriptionId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
LifecycleState = Oci.RoverService.Models.LifecycleState.Deleted,
LifecycleStateDetails = "EXAMPLE-lifecycleStateDetails-Value",
IsImportRequested = true,
ImportCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-importCompartmentId-Value",
ImportFileBucket = "EXAMPLE-importFileBucket-Value",
DataValidationCode = "EXAMPLE-dataValidationCode-Value",
MasterKeyId = "ocid1.test.oc1..<unique_ID>EXAMPLE-masterKeyId-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_HKvlE",
"EXAMPLE_VALUE_EULOU1Jon8ofEy72m2IS"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_K43bq",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_A9o2l",
"EXAMPLE--Value"
}
}
}
},
SystemTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_vTH54",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_boSTb",
"EXAMPLE--Value"
}
}
}
}
};
var createRoverClusterRequest = new Oci.RoverService.Requests.CreateRoverClusterRequest
{
CreateRoverClusterDetails = createRoverClusterDetails,
OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
OpcRequestId = "DHQXO6ACO1EZFD9M7R4F<unique_ID>"
};
// 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.
var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
try
{
// Create a service client and send the request.
using (var client = new RoverClusterClient(provider, new ClientConfiguration()))
{
var response = await client.CreateRoverCluster(createRoverClusterRequest);
// Retrieve value from the response.
var id = response.RoverCluster.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"CreateRoverCluster Failed with {e.Message}");
throw e;
}
}
}
}