// 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.NoChain,
BigTables = false,
ConnectionMemoryChunkSize = 264656567,
ConnectionMemoryLimit = 5082413452996207616,
DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.Sha256Password,
GlobalConnectionMemoryLimit = 5848263798121863168,
GlobalConnectionMemoryTracking = false,
TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.ReadCommitted,
InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
Autocommit = false,
ForeignKeyChecks = true,
GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.Eventual,
InnodbFtEnableStopword = false,
InnodbLogWriterThreads = true,
LocalInfile = true,
MysqlFirewallMode = false,
MysqlxEnableHelloNotice = true,
SqlRequirePrimaryKey = false,
SqlWarnings = true,
BinlogExpireLogsSeconds = 755,
BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Minimal,
BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
BinlogTransactionCompression = true,
InnodbBufferPoolSize = 8960721187112890368,
InnodbFtResultCacheLimit = 2804949353,
MaxBinlogCacheSize = 65657598380079,
MaxConnectErrors = 6055925199060217857,
MaxHeapTableSize = 6459870808769727488,
MaxConnections = 35742,
MaxPreparedStmtCount = 2382156,
ConnectTimeout = 22150952,
CteMaxRecursionDepth = 2861293450,
GeneratedRandomPasswordLength = 101,
InformationSchemaStatsExpiry = 19092921,
InnodbBufferPoolDumpPct = 99,
InnodbBufferPoolInstances = 11,
InnodbDdlBufferSize = 600391474,
InnodbDdlThreads = 4,
InnodbFtMaxTokenSize = 72,
InnodbFtMinTokenSize = 12,
InnodbFtNumWordOptimize = 607,
InnodbLockWaitTimeout = 701613807,
InnodbMaxPurgeLag = 4249995245,
InnodbMaxPurgeLagDelay = 97434,
InteractiveTimeout = 3669345,
InnodbStatsPersistentSamplePages = 2889306246261959681,
InnodbStatsTransientSamplePages = 5548173996507821057,
MaxAllowedPacket = 353657050,
MaxExecutionTime = 1775319325852203008,
MysqlxConnectTimeout = 455362753,
MysqlxDocumentIdUniquePrefix = 41339,
MysqlxIdleWorkerThreadTimeout = 2578,
MysqlxInteractiveTimeout = 2129559,
MysqlxMaxAllowedPacket = 955788917,
MysqlxMinWorkerThreads = 17,
MysqlxReadTimeout = 1303861,
MysqlxWaitTimeout = 431757,
MysqlxWriteTimeout = 218352,
NetReadTimeout = 30864174,
NetWriteTimeout = 20578789,
ParserMaxMemSize = 998391481485091328,
QueryAllocBlockSize = 4152372630,
QueryPreallocSize = 8712992094385236992,
RegexpTimeLimit = 1556007583,
SqlMode = "EXAMPLE-sqlMode-Value",
TmpTableSize = 6098776025655454720,
MysqlxDeflateDefaultCompressionLevel = 1,
MysqlxDeflateMaxClientCompressionLevel = 4,
MysqlxLz4MaxClientCompressionLevel = 14,
MysqlxLz4DefaultCompressionLevel = 3,
MysqlxZstdMaxClientCompressionLevel = 3,
MysqlxZstdDefaultCompressionLevel = 7,
MysqlZstdDefaultCompressionLevel = 17,
SortBufferSize = 658425459337262848,
WaitTimeout = 559867,
ThreadPoolDedicatedListeners = true,
ThreadPoolMaxTransactionsLimit = 20139,
TimeZone = "EXAMPLE-timeZone-Value"
},
ParentConfigurationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_LmtkX",
"EXAMPLE_VALUE_oBLrbPg8WPZN7tJ8VUCA"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_tkEjg",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_LP0GB",
"EXAMPLE--Value"
}
}
}
}
};
var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
{
CreateConfigurationDetails = createConfigurationDetails,
OpcRequestId = "SGTICKNNBZHXZYUN5XVM<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;
}
}
}
}