// 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.Release,
BigTables = false,
CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Latin1,
CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.GbkChineseCi,
ConnectionMemoryChunkSize = 360504027,
ConnectionMemoryLimit = 1809751928859729152,
DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.CachingSha2Password,
GlobalConnectionMemoryLimit = 5666887171946682368,
GlobalConnectionMemoryTracking = true,
TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.ReadCommitted,
InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
Autocommit = true,
ForeignKeyChecks = false,
GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.BeforeAndAfter,
GroupConcatMaxLen = 6061424763038233604,
InnodbFtEnableStopword = true,
InnodbLogWriterThreads = false,
LocalInfile = false,
MysqlFirewallMode = false,
MysqlxEnableHelloNotice = true,
SqlRequirePrimaryKey = false,
SqlWarnings = false,
BinlogExpireLogsSeconds = 722,
BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Full,
BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
BinlogTransactionCompression = true,
InnodbBufferPoolSize = 952985485964199936,
InnodbFtResultCacheLimit = 1690782160,
MaxBinlogCacheSize = 51513364471084,
MaxConnectErrors = 5029483842106526721,
MaxHeapTableSize = 9160803912198447104,
MaxConnections = 15592,
MaxPreparedStmtCount = 2113668,
ConnectTimeout = 28841629,
CteMaxRecursionDepth = 1711707935,
GeneratedRandomPasswordLength = 61,
InformationSchemaStatsExpiry = 16880623,
InnodbBufferPoolDumpPct = 98,
InnodbBufferPoolInstances = 37,
InnodbDdlBufferSize = 3161674780,
InnodbDdlThreads = 54,
InnodbFtMaxTokenSize = 62,
InnodbFtMinTokenSize = 5,
InnodbFtNumWordOptimize = 448,
InnodbLockWaitTimeout = 99266600,
InnodbMaxPurgeLag = 3956955916,
InnodbMaxPurgeLagDelay = 510504,
InteractiveTimeout = 30315980,
InnodbStatsPersistentSamplePages = 5883937798738074625,
InnodbStatsTransientSamplePages = 6496695777161671681,
InnodbStrictMode = false,
MaxAllowedPacket = 94668454,
MaxExecutionTime = 7028718782630618112,
MysqlxConnectTimeout = 960193538,
MysqlxDocumentIdUniquePrefix = 34982,
MysqlxIdleWorkerThreadTimeout = 2274,
MysqlxInteractiveTimeout = 949240,
MysqlxMaxAllowedPacket = 933539658,
MysqlxMinWorkerThreads = 7,
MysqlxReadTimeout = 411072,
MysqlxWaitTimeout = 1702112,
MysqlxWriteTimeout = 1999916,
NetReadTimeout = 6731270,
NetWriteTimeout = 11431532,
ParserMaxMemSize = 484873778350361856,
QueryAllocBlockSize = 2001679561,
QueryPreallocSize = 4748031504534738944,
RegexpTimeLimit = 966307672,
SqlMode = "EXAMPLE-sqlMode-Value",
TmpTableSize = 3369307445825612288,
MysqlxDeflateDefaultCompressionLevel = 6,
MysqlxDeflateMaxClientCompressionLevel = 5,
MysqlxLz4MaxClientCompressionLevel = 14,
MysqlxLz4DefaultCompressionLevel = 14,
MysqlxZstdMaxClientCompressionLevel = 13,
MysqlxZstdDefaultCompressionLevel = 16,
MysqlZstdDefaultCompressionLevel = 15,
SortBufferSize = 7458569574555768832,
WaitTimeout = 1032294,
ThreadPoolDedicatedListeners = false,
ThreadPoolMaxTransactionsLimit = 79220,
TimeZone = "EXAMPLE-timeZone-Value",
BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
BinlogGroupCommitSyncDelay = 230343,
BinlogGroupCommitSyncNoDelayCount = 81786,
ReplicaNetTimeout = 19205348,
RequireSecureTransport = true,
InnodbRedoLogCapacity = 933818265,
ThreadPoolTransactionDelay = 5301,
ThreadPoolQueryThreadsPerGroup = 4018,
ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Json,
ExplicitDefaultsForTimestamp = true,
SqlGenerateInvisiblePrimaryKey = false,
TemptableMaxRam = 4133683936705811456,
InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Purges,
InnodbAdaptiveHashIndex = true,
InnodbUndoLogTruncate = false,
TableDefinitionCache = 455357,
TableOpenCache = 253424,
RelayLogSpaceLimit = 210298023914660864,
OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
ReplicaParallelWorkers = 108,
SkipNameResolve = true,
MaxUserConnections = 4020046013,
JoinBufferSize = 6778040141204400256,
MaxSeeksForKey = 1858689865558256641,
RangeOptimizerMaxMemSize = 6059234639805874176,
AutoIncrementIncrement = 22504,
AutoIncrementOffset = 61912,
InnodbAutoincLockMode = 100,
InnodbRollbackOnTimeout = false,
InnodbOnlineAlterLogMaxSize = 4513709070730112512,
InnodbSortBufferSize = 30024917,
InnodbNumaInterleave = false,
ThreadPoolSize = 356,
LongQueryTime = 9487300
},
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_Gi1Fx",
"EXAMPLE_VALUE_AtrWoehMtzBHuLkbcCc9"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_oVhuS",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_4NE1X",
"EXAMPLE--Value"
}
}
}
}
};
var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
{
CreateConfigurationDetails = createConfigurationDetails,
OpcRequestId = "1QKUFHYQ7L6SVIQ39VRB<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;
}
}
}
}