// 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.Release,
BigTables = true,
CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Macroman,
CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.Ucs2LithuanianCi,
ConnectionMemoryChunkSize = 505358355,
ConnectionMemoryLimit = 2731972749558064640,
DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.MysqlNativePassword,
GlobalConnectionMemoryLimit = 7571001556924667904,
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 = 7447632229731688452,
InnodbFtEnableStopword = false,
InnodbLogWriterThreads = true,
LocalInfile = true,
MysqlFirewallMode = false,
MysqlxEnableHelloNotice = false,
SqlRequirePrimaryKey = true,
SqlWarnings = false,
BinlogExpireLogsSeconds = 736,
BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Minimal,
BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
BinlogTransactionCompression = true,
InnodbBufferPoolSize = 4198143262885920256,
InnodbFtResultCacheLimit = 1388114215,
MaxBinlogCacheSize = 9689579197956,
MaxConnectErrors = 3418100143144721409,
MaxHeapTableSize = 1572337583019793664,
MaxConnections = 73580,
MaxPreparedStmtCount = 475998,
ConnectTimeout = 386836,
CteMaxRecursionDepth = 2950992971,
GeneratedRandomPasswordLength = 177,
InformationSchemaStatsExpiry = 3413869,
InnodbBufferPoolDumpPct = 26,
InnodbBufferPoolInstances = 39,
InnodbDdlBufferSize = 54967095,
InnodbDdlThreads = 55,
InnodbFtMaxTokenSize = 83,
InnodbFtMinTokenSize = 0,
InnodbFtNumWordOptimize = 404,
InnodbLockWaitTimeout = 234345745,
InnodbMaxPurgeLag = 1838630373,
InnodbMaxPurgeLagDelay = 553842,
InteractiveTimeout = 20669097,
InnodbStatsPersistentSamplePages = 3171768235087385601,
InnodbStatsTransientSamplePages = 2303356472636623873,
InnodbStrictMode = true,
MaxAllowedPacket = 1064326117,
MaxExecutionTime = 4261978766105009152,
MysqlxConnectTimeout = 814115004,
MysqlxDocumentIdUniquePrefix = 38631,
MysqlxIdleWorkerThreadTimeout = 42,
MysqlxInteractiveTimeout = 1319856,
MysqlxMaxAllowedPacket = 743531573,
MysqlxMinWorkerThreads = 48,
MysqlxReadTimeout = 2060046,
MysqlxWaitTimeout = 158246,
MysqlxWriteTimeout = 2048033,
NetReadTimeout = 4481702,
NetWriteTimeout = 2310070,
ParserMaxMemSize = 4501424350634958976,
QueryAllocBlockSize = 2606314592,
QueryPreallocSize = 3452756452437547008,
RegexpTimeLimit = 1394249863,
SqlMode = "EXAMPLE-sqlMode-Value",
TmpTableSize = 3758825634105453056,
MysqlxDeflateDefaultCompressionLevel = 3,
MysqlxDeflateMaxClientCompressionLevel = 3,
MysqlxLz4MaxClientCompressionLevel = 9,
MysqlxLz4DefaultCompressionLevel = 3,
MysqlxZstdMaxClientCompressionLevel = 15,
MysqlxZstdDefaultCompressionLevel = 15,
MysqlZstdDefaultCompressionLevel = 3,
SortBufferSize = 5858900955838228480,
WaitTimeout = 866919,
ThreadPoolDedicatedListeners = true,
ThreadPoolMaxTransactionsLimit = 54762,
TimeZone = "EXAMPLE-timeZone-Value",
BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
BinlogGroupCommitSyncDelay = 409778,
BinlogGroupCommitSyncNoDelayCount = 4141,
ReplicaNetTimeout = 2947397,
RequireSecureTransport = true,
InnodbRedoLogCapacity = 116888456831,
ThreadPoolTransactionDelay = 153174,
ThreadPoolQueryThreadsPerGroup = 3754,
ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Json,
ExplicitDefaultsForTimestamp = true,
SqlGenerateInvisiblePrimaryKey = false,
TemptableMaxRam = 2925605737271093760,
InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.All,
InnodbAdaptiveHashIndex = true,
InnodbUndoLogTruncate = true,
TableDefinitionCache = 494476,
TableOpenCache = 23294,
RelayLogSpaceLimit = 7297580985183297536,
OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
ReplicaParallelWorkers = 840,
SkipNameResolve = true,
MaxUserConnections = 303813677,
JoinBufferSize = 2892061324047812736,
MaxSeeksForKey = 1897424356280647681,
RangeOptimizerMaxMemSize = 8772276113411191808,
AutoIncrementIncrement = 27663,
AutoIncrementOffset = 46024,
InnodbAutoincLockMode = 241,
InnodbRollbackOnTimeout = true,
InnodbOnlineAlterLogMaxSize = 2252871219640531200,
InnodbSortBufferSize = 3318246,
InnodbNumaInterleave = true,
ThreadPoolSize = 73,
LongQueryTime = 3712907
},
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_sMVJ2",
"EXAMPLE_VALUE_xE2QNDgMwt8HbkidpJDb"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_hVOA8",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_wMXBO",
"EXAMPLE--Value"
}
}
}
}
};
var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
{
CreateConfigurationDetails = createConfigurationDetails,
OpcRequestId = "DPATJAZFCKWLKCSFSATE<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;
}
}
}
}