// 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 UpdateRoverNodeExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateRoverNodeDetails = new Oci.RoverService.Models.UpdateRoverNodeDetails
{
DisplayName = "EXAMPLE-displayName-Value",
Shape = "EXAMPLE-shape-Value",
SerialNumber = "EXAMPLE-serialNumber-Value",
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"
},
NodeWorkloads = 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"
}
},
SuperUserPassword = "EXAMPLE-superUserPassword-Value",
UnlockPassphrase = "EXAMPLE-unlockPassphrase-Value",
PointOfContact = "EXAMPLE-pointOfContact-Value",
PointOfContactPhoneNumber = "EXAMPLE-pointOfContactPhoneNumber-Value",
OracleShippingTrackingUrl = "EXAMPLE-oracleShippingTrackingUrl-Value",
ShippingPreference = Oci.RoverService.Models.UpdateRoverNodeDetails.ShippingPreferenceEnum.CustomerPickup,
ShippingVendor = "EXAMPLE-shippingVendor-Value",
TimePickupExpected = DateTime.Parse("02/08/2035 10:25:54"),
LifecycleState = Oci.RoverService.Models.LifecycleState.Deleting,
EnclosureType = Oci.RoverService.Models.EnclosureType.Ruggadized,
LifecycleStateDetails = "EXAMPLE-lifecycleStateDetails-Value",
TimeReturnWindowStarts = DateTime.Parse("01/22/2032 16:09:29"),
TimeReturnWindowEnds = DateTime.Parse("12/08/2028 10:41:12"),
IsImportRequested = true,
ImportCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-importCompartmentId-Value",
ImportFileBucket = "EXAMPLE-importFileBucket-Value",
DataValidationCode = "EXAMPLE-dataValidationCode-Value",
PublicKey = "EXAMPLE-publicKey-Value",
CertificateAuthorityId = "ocid1.test.oc1..<unique_ID>EXAMPLE-certificateAuthorityId-Value",
TimeCertValidityEnd = DateTime.Parse("01/16/2007 02:10:43"),
CommonName = "EXAMPLE-commonName-Value",
CertCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-certCompartmentId-Value",
CertKeyAlgorithm = Oci.RoverService.Models.CertKeyAlgorithm.Rsa2048,
CertSignatureAlgorithm = Oci.RoverService.Models.CertSignatureAlgorithm.Sha512WithRsa,
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_oS9Rj",
"EXAMPLE_VALUE_IOfO1D7fqvuWRaa4tFpK"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_ez8zi",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_CKCJO",
"EXAMPLE--Value"
}
}
}
},
SystemTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_FKQRW",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_n0dOG",
"EXAMPLE--Value"
}
}
}
}
};
var updateRoverNodeRequest = new Oci.RoverService.Requests.UpdateRoverNodeRequest
{
RoverNodeId = "ocid1.test.oc1..<unique_ID>EXAMPLE-roverNodeId-Value",
UpdateRoverNodeDetails = updateRoverNodeDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "LTDOM2ZTMKGR7CCFDFPB<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 RoverNodeClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateRoverNode(updateRoverNodeRequest);
// Retrieve value from the response.
var id = response.RoverNode.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateRoverNode Failed with {e.Message}");
throw e;
}
}
}
}