// 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.CaseSensitive
},
Variables = new Oci.MysqlService.Models.ConfigurationVariables
{
CompletionType = Oci.MysqlService.Models.ConfigurationVariables.CompletionTypeEnum.Chain,
BigTables = true,
CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Swe7,
CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.Ucs2SlovakCi,
ConnectionMemoryChunkSize = 211172774,
ConnectionMemoryLimit = 5914603325197068288,
DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.MysqlNativePassword,
GlobalConnectionMemoryLimit = 5638513912336824320,
GlobalConnectionMemoryTracking = true,
TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.RepeatableRead,
InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
Autocommit = true,
ForeignKeyChecks = false,
GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.Before,
GroupConcatMaxLen = 5851281095736049668,
InnodbFtEnableStopword = true,
InnodbLogWriterThreads = false,
LocalInfile = false,
MysqlFirewallMode = false,
MysqlxEnableHelloNotice = false,
SqlRequirePrimaryKey = false,
SqlWarnings = false,
BinlogExpireLogsSeconds = 946,
BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Full,
BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
BinlogTransactionCompression = false,
InnodbBufferPoolSize = 3203276864298139648,
InnodbFtResultCacheLimit = 1461637825,
MaxBinlogCacheSize = 39557217684795,
MaxConnectErrors = 3317118213064538113,
MaxHeapTableSize = 8820321049590506496,
MaxConnections = 36388,
MaxPreparedStmtCount = 2610291,
ConnectTimeout = 21944672,
CteMaxRecursionDepth = 3724164541,
GeneratedRandomPasswordLength = 168,
InformationSchemaStatsExpiry = 17506814,
InnodbBufferPoolDumpPct = 13,
InnodbBufferPoolInstances = 41,
InnodbDdlBufferSize = 2299901489,
InnodbDdlThreads = 40,
InnodbFtMaxTokenSize = 75,
InnodbFtMinTokenSize = 8,
InnodbFtNumWordOptimize = 879,
InnodbLockWaitTimeout = 1067191887,
InnodbMaxPurgeLag = 3061751410,
InnodbMaxPurgeLagDelay = 237956,
InteractiveTimeout = 14057608,
InnodbStatsPersistentSamplePages = 438600557388884993,
InnodbStatsTransientSamplePages = 1507524116633150465,
InnodbStrictMode = false,
MaxAllowedPacket = 357352062,
MaxExecutionTime = 6810803834958841856,
MysqlxConnectTimeout = 315821974,
MysqlxDocumentIdUniquePrefix = 50931,
MysqlxIdleWorkerThreadTimeout = 1522,
MysqlxInteractiveTimeout = 1286094,
MysqlxMaxAllowedPacket = 1018991113,
MysqlxMinWorkerThreads = 29,
MysqlxReadTimeout = 1668337,
MysqlxWaitTimeout = 321505,
MysqlxWriteTimeout = 2123460,
NetReadTimeout = 24287015,
NetWriteTimeout = 24614896,
ParserMaxMemSize = 1515020861214225792,
QueryAllocBlockSize = 1827199660,
QueryPreallocSize = 9052672034020131840,
RegexpTimeLimit = 822759582,
SqlMode = "EXAMPLE-sqlMode-Value",
TmpTableSize = 1188598917348797184,
MysqlxDeflateDefaultCompressionLevel = 4,
MysqlxDeflateMaxClientCompressionLevel = 8,
MysqlxLz4MaxClientCompressionLevel = 8,
MysqlxLz4DefaultCompressionLevel = 5,
MysqlxZstdMaxClientCompressionLevel = 8,
MysqlxZstdDefaultCompressionLevel = 15,
MysqlZstdDefaultCompressionLevel = 10,
SortBufferSize = 7863306361015161856,
WaitTimeout = 1627108,
ThreadPoolDedicatedListeners = true,
ThreadPoolMaxTransactionsLimit = 5187,
TimeZone = "EXAMPLE-timeZone-Value",
BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
BinlogGroupCommitSyncDelay = 830079,
BinlogGroupCommitSyncNoDelayCount = 70441,
ReplicaNetTimeout = 11566821,
RequireSecureTransport = true,
InnodbRedoLogCapacity = 75898622158,
ThreadPoolTransactionDelay = 133303,
ThreadPoolQueryThreadsPerGroup = 2594,
ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Json,
ExplicitDefaultsForTimestamp = false,
SqlGenerateInvisiblePrimaryKey = true,
TemptableMaxRam = 7855572720953407488,
InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Inserts,
InnodbAdaptiveHashIndex = true,
InnodbUndoLogTruncate = false,
TableDefinitionCache = 313939,
TableOpenCache = 68327,
RelayLogSpaceLimit = 723885579817763840,
OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
ReplicaParallelWorkers = 239,
SkipNameResolve = true,
MaxUserConnections = 2702580483,
JoinBufferSize = 8578002226621826176,
MaxSeeksForKey = 3075692983017196545,
RangeOptimizerMaxMemSize = 179418343238363136,
AutoIncrementIncrement = 50520,
AutoIncrementOffset = 22273,
InnodbAutoincLockMode = 545,
InnodbRollbackOnTimeout = false,
InnodbOnlineAlterLogMaxSize = 471705887474016000,
InnodbSortBufferSize = 57242925,
InnodbNumaInterleave = false,
ThreadPoolSize = 476,
LongQueryTime = 23607636
},
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_ZMRmX",
"EXAMPLE_VALUE_MLilh4e9UDq91tl9y2h5"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_CUReg",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_tZXcK",
"EXAMPLE--Value"
}
}
}
}
};
var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
{
CreateConfigurationDetails = createConfigurationDetails,
OpcRequestId = "NGETZ0RM9TJUEYDVHQNG<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;
}
}
}
}