// 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 = false,
CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Greek,
CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.Koi8RGeneralCi,
ConnectionMemoryChunkSize = 155587256,
ConnectionMemoryLimit = 1010913139382900224,
DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.MysqlNativePassword,
GlobalConnectionMemoryLimit = 5576825818880092160,
GlobalConnectionMemoryTracking = true,
TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.RepeatableRead,
InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
Autocommit = false,
ForeignKeyChecks = false,
GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.BeforeAndAfter,
GroupConcatMaxLen = 694278274605225988,
InnodbFtEnableStopword = false,
InnodbLogWriterThreads = true,
LocalInfile = false,
MysqlFirewallMode = true,
MysqlxEnableHelloNotice = true,
SqlRequirePrimaryKey = false,
SqlWarnings = true,
BinlogExpireLogsSeconds = 230,
BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Minimal,
BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
BinlogTransactionCompression = true,
InnodbBufferPoolSize = 7652005598453521408,
InnodbFtResultCacheLimit = 1167584162,
MaxBinlogCacheSize = 58532038242775,
MaxConnectErrors = 8737900424138652673,
MaxHeapTableSize = 6756216397491087360,
MaxConnections = 78931,
MaxPreparedStmtCount = 3240994,
ConnectTimeout = 18179975,
CteMaxRecursionDepth = 1100459801,
GeneratedRandomPasswordLength = 126,
InformationSchemaStatsExpiry = 27195254,
InnodbBufferPoolDumpPct = 31,
InnodbBufferPoolInstances = 48,
InnodbDdlBufferSize = 1266170961,
InnodbDdlThreads = 36,
InnodbFtMaxTokenSize = 71,
InnodbFtMinTokenSize = 13,
InnodbFtNumWordOptimize = 840,
InnodbLockWaitTimeout = 1018327348,
InnodbMaxPurgeLag = 1464471547,
InnodbMaxPurgeLagDelay = 462620,
InteractiveTimeout = 11425440,
InnodbStatsPersistentSamplePages = 2773084887133524993,
InnodbStatsTransientSamplePages = 4509648343962838017,
InnodbStrictMode = true,
MaxAllowedPacket = 681308034,
MaxExecutionTime = 8434732970849599488,
MysqlxConnectTimeout = 308246748,
MysqlxDocumentIdUniquePrefix = 62186,
MysqlxIdleWorkerThreadTimeout = 2464,
MysqlxInteractiveTimeout = 775779,
MysqlxMaxAllowedPacket = 984201637,
MysqlxMinWorkerThreads = 79,
MysqlxReadTimeout = 1818803,
MysqlxWaitTimeout = 1900148,
MysqlxWriteTimeout = 753578,
NetReadTimeout = 3634663,
NetWriteTimeout = 20015970,
ParserMaxMemSize = 5510306916160672384,
QueryAllocBlockSize = 4241561787,
QueryPreallocSize = 6152717556700739584,
RegexpTimeLimit = 97263987,
SqlMode = "EXAMPLE-sqlMode-Value",
TmpTableSize = 6029654210432235520,
MysqlxDeflateDefaultCompressionLevel = 5,
MysqlxDeflateMaxClientCompressionLevel = 8,
MysqlxLz4MaxClientCompressionLevel = 13,
MysqlxLz4DefaultCompressionLevel = 12,
MysqlxZstdMaxClientCompressionLevel = 10,
MysqlxZstdDefaultCompressionLevel = 3,
MysqlZstdDefaultCompressionLevel = 10,
SortBufferSize = 1438247181402431488,
WaitTimeout = 2093257,
ThreadPoolDedicatedListeners = false,
ThreadPoolMaxTransactionsLimit = 75913,
TimeZone = "EXAMPLE-timeZone-Value",
BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
BinlogGroupCommitSyncDelay = 560700,
BinlogGroupCommitSyncNoDelayCount = 79859,
ReplicaNetTimeout = 20438916,
RequireSecureTransport = true,
InnodbRedoLogCapacity = 113450800337,
ThreadPoolTransactionDelay = 117899,
ThreadPoolQueryThreadsPerGroup = 968,
ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Traditional,
ExplicitDefaultsForTimestamp = true,
SqlGenerateInvisiblePrimaryKey = true,
TemptableMaxRam = 3651067211040596480,
InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Inserts,
InnodbAdaptiveHashIndex = true,
InnodbUndoLogTruncate = true,
TableDefinitionCache = 80992,
TableOpenCache = 388640,
RelayLogSpaceLimit = 8139164391184299008,
OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
ReplicaParallelWorkers = 718,
SkipNameResolve = true,
MaxUserConnections = 3788784130,
JoinBufferSize = 5404115377216538752,
MaxSeeksForKey = 3442381487526021121,
RangeOptimizerMaxMemSize = 3069672618682009600,
AutoIncrementIncrement = 28995,
AutoIncrementOffset = 1176,
InnodbAutoincLockMode = 901,
InnodbRollbackOnTimeout = false,
InnodbOnlineAlterLogMaxSize = 8969711164800224256,
InnodbSortBufferSize = 53970829,
InnodbNumaInterleave = false,
ThreadPoolSize = 47,
LongQueryTime = 12496061
},
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_p3zDk",
"EXAMPLE_VALUE_pu5Z94qaExTvFtgRooYj"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_y8InL",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_hPpIu",
"EXAMPLE--Value"
}
}
}
}
};
var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
{
CreateConfigurationDetails = createConfigurationDetails,
OpcRequestId = "EEJMMFY6Z5Z9JVLHGJOY<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;
}
}
}
}