// 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.MysqlService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Mysql
{
public class CreateConfigurationExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var createConfigurationDetails = new Oci.MysqlService.Models.CreateConfigurationDetails
{
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
Description = "EXAMPLE-description-Value",
DisplayName = "EXAMPLE-displayName-Value",
ShapeName = "EXAMPLE-shapeName-Value",
InitVariables = new Oci.MysqlService.Models.InitializationVariables
{
LowerCaseTableNames = Oci.MysqlService.Models.InitializationVariables.LowerCaseTableNamesEnum.CaseInsensitiveLowercase
},
Variables = new Oci.MysqlService.Models.ConfigurationVariables
{
CompletionType = Oci.MysqlService.Models.ConfigurationVariables.CompletionTypeEnum.Chain,
BigTables = true,
CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Cp1257,
CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.HebrewBin,
ConnectionMemoryChunkSize = 146439380,
ConnectionMemoryLimit = 5312765046677894144,
DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.MysqlNativePassword,
GlobalConnectionMemoryLimit = 8193455536351705088,
GlobalConnectionMemoryTracking = false,
TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.ReadCommitted,
InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
Autocommit = false,
ForeignKeyChecks = false,
GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.Eventual,
GroupConcatMaxLen = 7426589762976925700,
InnodbFtEnableStopword = false,
InnodbLogWriterThreads = true,
LocalInfile = true,
MysqlFirewallMode = true,
MysqlxEnableHelloNotice = false,
SqlRequirePrimaryKey = true,
SqlWarnings = false,
BinlogExpireLogsSeconds = 778,
BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Full,
BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
BinlogTransactionCompression = false,
InnodbBufferPoolSize = 876659492478982528,
InnodbFtResultCacheLimit = 1834590155,
MaxBinlogCacheSize = 55407927270321,
MaxConnectErrors = 6920414763550136321,
MaxHeapTableSize = 3084679267481314816,
MaxConnections = 30706,
MaxPreparedStmtCount = 1449430,
ConnectTimeout = 29995792,
CteMaxRecursionDepth = 376057107,
GeneratedRandomPasswordLength = 88,
InformationSchemaStatsExpiry = 22162160,
InnodbBufferPoolDumpPct = 83,
InnodbBufferPoolInstances = 59,
InnodbDdlBufferSize = 2570884294,
InnodbDdlThreads = 29,
InnodbFtMaxTokenSize = 78,
InnodbFtMinTokenSize = 2,
InnodbFtNumWordOptimize = 768,
InnodbLockWaitTimeout = 196877516,
InnodbMaxPurgeLag = 2391739688,
InnodbMaxPurgeLagDelay = 957928,
InteractiveTimeout = 23178739,
InnodbStatsPersistentSamplePages = 6609200818946495489,
InnodbStatsTransientSamplePages = 7357073303169218561,
InnodbStrictMode = false,
MaxAllowedPacket = 281411347,
MaxExecutionTime = 1872740871949623296,
MysqlxConnectTimeout = 260312623,
MysqlxDocumentIdUniquePrefix = 41698,
MysqlxIdleWorkerThreadTimeout = 1024,
MysqlxInteractiveTimeout = 963167,
MysqlxMaxAllowedPacket = 1056780886,
MysqlxMinWorkerThreads = 10,
MysqlxReadTimeout = 931872,
MysqlxWaitTimeout = 1703234,
MysqlxWriteTimeout = 541705,
NetReadTimeout = 4612322,
NetWriteTimeout = 942138,
ParserMaxMemSize = 1454790105300452480,
QueryAllocBlockSize = 1806186621,
QueryPreallocSize = 3770283651398260224,
RegexpTimeLimit = 696375445,
SqlMode = "EXAMPLE-sqlMode-Value",
TmpTableSize = 5074012278212700160,
MysqlxDeflateDefaultCompressionLevel = 8,
MysqlxDeflateMaxClientCompressionLevel = 8,
MysqlxLz4MaxClientCompressionLevel = 13,
MysqlxLz4DefaultCompressionLevel = 14,
MysqlxZstdMaxClientCompressionLevel = 1,
MysqlxZstdDefaultCompressionLevel = 4,
MysqlZstdDefaultCompressionLevel = 7,
SortBufferSize = 366094917241049856,
WaitTimeout = 651475,
ThreadPoolDedicatedListeners = true,
ThreadPoolMaxTransactionsLimit = 77347,
TimeZone = "EXAMPLE-timeZone-Value",
BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
BinlogGroupCommitSyncDelay = 12671,
BinlogGroupCommitSyncNoDelayCount = 18031,
ReplicaNetTimeout = 5569880,
RequireSecureTransport = false,
InnodbRedoLogCapacity = 60075705041,
ThreadPoolTransactionDelay = 17153,
ThreadPoolQueryThreadsPerGroup = 345,
ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Tree,
ExplicitDefaultsForTimestamp = true,
SqlGenerateInvisiblePrimaryKey = true,
TemptableMaxRam = 7578501854817728512,
InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Purges,
InnodbAdaptiveHashIndex = false,
InnodbUndoLogTruncate = true,
TableDefinitionCache = 381143,
TableOpenCache = 149188,
RelayLogSpaceLimit = 1724953080181174272,
OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
ReplicaParallelWorkers = 867,
SkipNameResolve = true,
MaxUserConnections = 2605200199,
JoinBufferSize = 4671653046858999936,
MaxSeeksForKey = 5215716661265231873,
RangeOptimizerMaxMemSize = 8882341888198788096,
AutoIncrementIncrement = 25999,
AutoIncrementOffset = 3928,
InnodbAutoincLockMode = 415,
InnodbRollbackOnTimeout = true,
InnodbOnlineAlterLogMaxSize = 7208163932047637504,
InnodbSortBufferSize = 59292447,
InnodbNumaInterleave = true,
ThreadPoolSize = 216,
LongQueryTime = 11379096
},
Options = new List<Oci.MysqlService.Models.Option>
{
new Oci.MysqlService.Models.Option
{
Name = "EXAMPLE-name-Value",
Value = "EXAMPLE-value-Value"
}
},
ParentConfigurationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_e9diB",
"EXAMPLE_VALUE_UlBLQkw3GrstcOM9G3j6"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_RDJiK",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_XnBo8",
"EXAMPLE--Value"
}
}
}
}
};
var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
{
CreateConfigurationDetails = createConfigurationDetails,
OpcRequestId = "O1UL1ID9RTRVHKIQTU5U<unique_ID>",
OpcRetryToken = "EXAMPLE-opcRetryToken-Value"
};
// 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 MysqlaasClient(provider, new ClientConfiguration()))
{
var response = await client.CreateConfiguration(createConfigurationRequest);
// Retrieve value from the response.
var id = response.Configuration.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"CreateConfiguration Failed with {e.Message}");
throw e;
}
}
}
}