diff --git a/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md b/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md index c766954e9165..f27bb465bf59 100644 --- a/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md +++ b/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.2 (2023-04-23) +### Other Changes + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/mysql/armmysql/advisors_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/advisors_client_example_test.go deleted file mode 100644 index 5644d7b186b2..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/advisors_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/AdvisorsGet.json -func ExampleAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdvisorsClient().Get(ctx, "testResourceGroupName", "testServerName", "Index", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Advisor = armmysql.Advisor{ - // Name: to.Ptr("Index"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/advisors/Index"), - // Properties: map[string]any{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/AdvisorsListByServer.json -func ExampleAdvisorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdvisorsClient().NewListByServerPager("testResourceGroupName", "testServerName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdvisorsResultList = armmysql.AdvisorsResultList{ - // Value: []*armmysql.Advisor{ - // { - // Name: to.Ptr("Index"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/advisors/Index"), - // Properties: map[string]any{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/autorest.md b/sdk/resourcemanager/mysql/armmysql/autorest.md index 558cfd99f9d5..2388896d4924 100644 --- a/sdk/resourcemanager/mysql/armmysql/autorest.md +++ b/sdk/resourcemanager/mysql/armmysql/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mysql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mysql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 1.1.2 package-singleservers: true directive: - from: Servers.json diff --git a/sdk/resourcemanager/mysql/armmysql/checknameavailability_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/checknameavailability_client_example_test.go deleted file mode 100644 index 292c760c06f1..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/checknameavailability_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armmysql.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforMySQL"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailability = armmysql.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/mysql/armmysql/configurations_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/configurations_client_example_test.go deleted file mode 100644 index 9c741fc4c748..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/configurations_client_example_test.go +++ /dev/null @@ -1,707 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.json -func ExampleConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "event_scheduler", armmysql.Configuration{ - Properties: &armmysql.ConfigurationProperties{ - Source: to.Ptr("user-override"), - Value: to.Ptr("off"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armmysql.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/configurations/event_scheduler"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("ON"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationGet.json -func ExampleConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestGroup", "testserver", "event_scheduler", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armmysql.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/configurations/event_scheduler"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("ON"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationListByServer.json -func ExampleConfigurationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "mysqltestsvc1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationListResult = armmysql.ConfigurationListResult{ - // Value: []*armmysql.Configuration{ - // { - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/event_scheduler"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("div_precision_increment"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/div_precision_increment"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Number of digits by which to increase the scale of the result of division operations."), - // AllowedValues: to.Ptr("0-30"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }, - // { - // Name: to.Ptr("group_concat_max_len"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/group_concat_max_len"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Maximum allowed result length in bytes for the GROUP_CONCAT()."), - // AllowedValues: to.Ptr("4-16777216"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("innodb_adaptive_hash_index"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_adaptive_hash_index"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Whether innodb adaptive hash indexes are enabled or disabled."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("ON"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("ON"), - // }, - // }, - // { - // Name: to.Ptr("innodb_lock_wait_timeout"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_lock_wait_timeout"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The length of time in seconds an InnoDB transaction waits for a row lock before giving up."), - // AllowedValues: to.Ptr("1-3600"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("50"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50"), - // }, - // }, - // { - // Name: to.Ptr("interactive_timeout"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/interactive_timeout"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Number of seconds the server waits for activity on an interactive connection before closing it."), - // AllowedValues: to.Ptr("10-1800"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1800"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1800"), - // }, - // }, - // { - // Name: to.Ptr("log_queries_not_using_indexes"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_queries_not_using_indexes"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Logs queries that are expected to retrieve all rows to slow query log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("log_throttle_queries_not_using_indexes"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_throttle_queries_not_using_indexes"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Limits the number of such queries per minute that can be written to the slow query log."), - // AllowedValues: to.Ptr("0-4294967295"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("log_slow_admin_statements"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_slow_admin_statements"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Include slow administrative statements in the statements written to the slow query log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("log_slow_slave_statements"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_slow_slave_statements"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("When the slow query log is enabled, this variable enables logging for queries that have taken more than long_query_time seconds to execute on the slave."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("log_bin_trust_function_creators"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_bin_trust_function_creators"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("This variable applies when binary logging is enabled. It controls whether stored function creators can be trusted not to create stored functions that will cause unsafe events to be written to the binary log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("long_query_time"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/long_query_time"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("If a query takes longer than this many seconds, the server increments the Slow_queries status variable."), - // AllowedValues: to.Ptr("0-1E+100"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("10"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("10"), - // }, - // }, - // { - // Name: to.Ptr("min_examined_row_limit"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/min_examined_row_limit"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Can be used to cause queries which examine fewer than the stated number of rows not to be logged."), - // AllowedValues: to.Ptr("0-18446744073709551615"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("slow_query_log"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/slow_query_log"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Enable or disable the slow query log"), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("sql_mode"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/sql_mode"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The current server SQL mode."), - // AllowedValues: to.Ptr(",ALLOW_INVALID_DATES,ANSI_QUOTES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE,IGNORE_SPACE,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_FIELD_OPTIONS,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_UNSIGNED_SUBTRACTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,PAD_CHAR_TO_FULL_LENGTH,PIPES_AS_CONCAT,REAL_AS_FLOAT,STRICT_ALL_TABLES,STRICT_TRANS_TABLES"), - // DataType: to.Ptr("Set"), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("wait_timeout"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/wait_timeout"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of seconds the server waits for activity on a noninteractive connection before closing it."), - // AllowedValues: to.Ptr("60-86400"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("120"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("120"), - // }, - // }, - // { - // Name: to.Ptr("net_read_timeout"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/net_read_timeout"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of seconds the server waits for network reading action, especially for LOAD DATA LOCAL FILE."), - // AllowedValues: to.Ptr("10-3600"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("120"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("120"), - // }, - // }, - // { - // Name: to.Ptr("net_write_timeout"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/net_write_timeout"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of seconds the server waits for network writing action, especially for LOAD DATA LOCAL FILE."), - // AllowedValues: to.Ptr("10-3600"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("240"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("240"), - // }, - // }, - // { - // Name: to.Ptr("server_id"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/server_id"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The server ID, used in replication to give each master and slave a unique identity."), - // AllowedValues: to.Ptr("1000-4294967295"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("1381286943"), - // }, - // }, - // { - // Name: to.Ptr("max_allowed_packet"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/max_allowed_packet"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The maximum size of one packet or any generated/intermediate string, or any parameter sent by the mysql_stmt_send_long_data() C API function."), - // AllowedValues: to.Ptr("1024-1073741824"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("536870912"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("536870912"), - // }, - // }, - // { - // Name: to.Ptr("slave_net_timeout"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/slave_net_timeout"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of seconds to wait for more data from the master before the slave considers the connection broken, aborts the read, and tries to reconnect."), - // AllowedValues: to.Ptr("30-3600"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("60"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("60"), - // }, - // }, - // { - // Name: to.Ptr("time_zone"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/time_zone"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The server time zone"), - // AllowedValues: to.Ptr("[+|-][0]{0,1}[0-9]:[0-5][0-9]|[+|-][1][0-2]:[0-5][0-9]|SYSTEM"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("SYSTEM"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("SYSTEM"), - // }, - // }, - // { - // Name: to.Ptr("binlog_group_commit_sync_delay"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/binlog_group_commit_sync_delay"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Controls how many microseconds the binary log commit waits before synchronizing the binary log file to disk."), - // AllowedValues: to.Ptr("0,11-1000000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("binlog_group_commit_sync_no_delay_count"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/binlog_group_commit_sync_no_delay_count"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The maximum number of transactions to wait for before aborting the current delay as specified by binlog-group-commit-sync-delay."), - // AllowedValues: to.Ptr("0-1000000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("character_set_server"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/character_set_server"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Use charset_name as the default server character set."), - // AllowedValues: to.Ptr("BIG5,DEC8,CP850,HP8,KOI8R,LATIN1,LATIN2,SWE7,ASCII,UJIS,SJIS,HEBREW,TIS620,EUCKR,KOI8U,GB2312,GREEK,CP1250,GBK,LATIN5,ARMSCII8,UTF8,UCS2,CP866,KEYBCS2,MACCE,MACROMAN,CP852,LATIN7,UTF8MB4,CP1251,UTF16,CP1256,CP1257,UTF32,BINARY,GEOSTD8,CP932,EUCJPMS"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("latin1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("latin1"), - // }, - // }, - // { - // Name: to.Ptr("join_buffer_size"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/join_buffer_size"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use indexes and thus perform full table scans."), - // AllowedValues: to.Ptr("128-2097152"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("262144"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("262144"), - // }, - // }, - // { - // Name: to.Ptr("table_open_cache"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/table_open_cache"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of open tables for all threads."), - // AllowedValues: to.Ptr("1-4000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("2000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2000"), - // }, - // }, - // { - // Name: to.Ptr("lower_case_table_names"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/lower_case_table_names"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase."), - // AllowedValues: to.Ptr("1,2"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("slave_compressed_protocol"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/slave_compressed_protocol"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("This option places an upper limit on the total size in bytes of all relay logs on the slave."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("innodb_io_capacity"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_io_capacity"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Sets an upper limit on I/O activity performed by InnoDB background tasks, such as flushing pages from the buffer pool and merging data from the change buffer."), - // AllowedValues: to.Ptr("100-1500"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("innodb_read_io_threads"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_read_io_threads"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of I/O threads for read operations in InnoDB."), - // AllowedValues: to.Ptr("1-64"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }, - // { - // Name: to.Ptr("innodb_thread_concurrency"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_thread_concurrency"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("InnoDB tries to keep the number of operating system threads concurrently inside InnoDB less than or equal to the limit given by this variable."), - // AllowedValues: to.Ptr("0-1000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("innodb_write_io_threads"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_write_io_threads"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of I/O threads for write operations in InnoDB."), - // AllowedValues: to.Ptr("1-64"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }, - // { - // Name: to.Ptr("innodb_page_cleaners"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_page_cleaners"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The number of page cleaner threads that flush dirty pages from buffer pool instances."), - // AllowedValues: to.Ptr("1-64"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }, - // { - // Name: to.Ptr("innodb_online_alter_log_max_size"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_online_alter_log_max_size"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Specifies an upper limit on the size of the temporary log files used during online DDL operations for InnoDB tables."), - // AllowedValues: to.Ptr("65536-2147483648"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("134217728"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("134217728"), - // }, - // }, - // { - // Name: to.Ptr("init_connect"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/init_connect"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("A string to be executed by the server for each client that connects."), - // AllowedValues: to.Ptr(""), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("tx_isolation"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/tx_isolation"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The default transaction isolation level."), - // AllowedValues: to.Ptr("READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLE"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("REPEATABLE-READ"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("REPEATABLE-READ"), - // }, - // }, - // { - // Name: to.Ptr("eq_range_index_dive_limit"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/eq_range_index_dive_limit"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("This variable indicates the number of equality ranges in an equality comparison condition when the optimizer should switch from using index dives to index statistics in estimating the number of qualifying rows."), - // AllowedValues: to.Ptr("0-4294967295"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("innodb_old_blocks_pct"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_old_blocks_pct"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Specifies the approximate percentage of the InnoDB buffer pool used for the old block sublist."), - // AllowedValues: to.Ptr("5-95"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("37"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("37"), - // }, - // }, - // { - // Name: to.Ptr("innodb_old_blocks_time"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_old_blocks_time"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Non-zero values protect against the buffer pool being filled by data that is referenced only for a brief period, such as during a full table scan."), - // AllowedValues: to.Ptr("0-4294967295"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("innodb_read_ahead_threshold"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_read_ahead_threshold"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Controls the sensitivity of linear read-ahead that InnoDB uses to prefetch pages into the buffer pool."), - // AllowedValues: to.Ptr("0-64"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("56"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("56"), - // }, - // }, - // { - // Name: to.Ptr("max_length_for_sort_data"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/max_length_for_sort_data"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("The cutoff on the size of index values that determines which filesort algorithm to use."), - // AllowedValues: to.Ptr("4-8388608"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("max_connect_errors"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/max_connect_errors"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("If more than this many successive connection requests from a host are interrupted without a successful connection, the server blocks that host from further connections."), - // AllowedValues: to.Ptr("1-18446744073709551615"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("innodb_thread_sleep_delay"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_thread_sleep_delay"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Defines how long InnoDB threads sleep before joining the InnoDB queue, in microseconds."), - // AllowedValues: to.Ptr("0-1000000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("10000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("10000"), - // }, - // }, - // { - // Name: to.Ptr("innodb_file_format"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_file_format"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Indicates the InnoDB file format for file-per-table tablespaces."), - // AllowedValues: to.Ptr("Antelope,Barracuda"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("Barracuda"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("Barracuda"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/constants.go b/sdk/resourcemanager/mysql/armmysql/constants.go index f8b5b8ca9253..a5eb8bf190ac 100644 --- a/sdk/resourcemanager/mysql/armmysql/constants.go +++ b/sdk/resourcemanager/mysql/armmysql/constants.go @@ -11,7 +11,7 @@ package armmysql const ( moduleName = "armmysql" - moduleVersion = "v1.1.1" + moduleVersion = "v1.1.2" ) // CreateMode - The mode to create a new server. diff --git a/sdk/resourcemanager/mysql/armmysql/databases_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/databases_client_example_test.go deleted file mode 100644 index 061c00be4c0a..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/databases_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseCreate.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armmysql.Database{ - Properties: &armmysql.DatabaseProperties{ - Charset: to.Ptr("utf8"), - Collation: to.Ptr("utf8_general_ci"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armmysql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db1"), - // Properties: &armmysql.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "TestGroup", "testserver", "db1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "TestGroup", "testserver", "db1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armmysql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db1"), - // Properties: &armmysql.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseListByServer.json -func ExampleDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armmysql.DatabaseListResult{ - // Value: []*armmysql.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db1"), - // Properties: &armmysql.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db2"), - // Properties: &armmysql.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/firewallrules_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/firewallrules_client_example_test.go deleted file mode 100644 index f9e1bafc177c..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/firewallrules_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armmysql.FirewallRule{ - Properties: &armmysql.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armmysql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule1"), - // Properties: &armmysql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "testserver", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "testserver", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armmysql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule1"), - // Properties: &armmysql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleListByServer.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armmysql.FirewallRuleListResult{ - // Value: []*armmysql.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule1"), - // Properties: &armmysql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule2"), - // Properties: &armmysql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/go.mod b/sdk/resourcemanager/mysql/armmysql/go.mod index b2df71c63ef9..38185b2f308d 100644 --- a/sdk/resourcemanager/mysql/armmysql/go.mod +++ b/sdk/resourcemanager/mysql/armmysql/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/mysql/armmysql/go.sum b/sdk/resourcemanager/mysql/armmysql/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/mysql/armmysql/go.sum +++ b/sdk/resourcemanager/mysql/armmysql/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/mysql/armmysql/locationbasedperformancetier_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/locationbasedperformancetier_client_example_test.go deleted file mode 100644 index 8aa5bc724673..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/locationbasedperformancetier_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json -func ExampleLocationBasedPerformanceTierClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedPerformanceTierClient().NewListPager("WestUS", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PerformanceTierListResult = armmysql.PerformanceTierListResult{ - // Value: []*armmysql.PerformanceTierProperties{ - // { - // ID: to.Ptr("Basic"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](0), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_1"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](1), - // }, - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }}, - // }, - // { - // ID: to.Ptr("GeneralPurpose"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_64"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }, - // { - // ID: to.Ptr("MemoryOptimized"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/locationbasedrecommendedactionsessionsoperationstatus_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/locationbasedrecommendedactionsessionsoperationstatus_client_example_test.go deleted file mode 100644 index feb7f25fcb94..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/locationbasedrecommendedactionsessionsoperationstatus_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json -func ExampleLocationBasedRecommendedActionSessionsOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationBasedRecommendedActionSessionsOperationStatusClient().Get(ctx, "WestUS", "aaaabbbb-cccc-dddd-0000-111122223333", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecommendedActionSessionsOperationStatus = armmysql.RecommendedActionSessionsOperationStatus{ - // Name: to.Ptr("aaaabbbb-cccc-dddd-0000-111122223333"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:15:00Z"); return t}()), - // Status: to.Ptr("succeeded"), - // } -} diff --git a/sdk/resourcemanager/mysql/armmysql/locationbasedrecommendedactionsessionsresult_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/locationbasedrecommendedactionsessionsresult_client_example_test.go deleted file mode 100644 index 40c90f5d226b..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/locationbasedrecommendedactionsessionsresult_client_example_test.go +++ /dev/null @@ -1,96 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionSessionResult.json -func ExampleLocationBasedRecommendedActionSessionsResultClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedRecommendedActionSessionsResultClient().NewListPager("WestUS", "aaaabbbb-cccc-dddd-0000-111122223333", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecommendationActionsResultList = armmysql.RecommendationActionsResultList{ - // Value: []*armmysql.RecommendationAction{ - // { - // Name: to.Ptr("Index-1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1"), - // Properties: &armmysql.RecommendationActionProperties{ - // ActionID: to.Ptr[int32](1), - // AdvisorName: to.Ptr("Index"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24Z"); return t}()), - // Reason: to.Ptr("Column `movies_genres`.`movie_id` appear in Join On clause(s)."), - // RecommendationType: to.Ptr("Add"), - // SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"), - // Details: map[string]*string{ - // "engine": to.Ptr("InnoDB"), - // "indexColumns": to.Ptr("`movies_genres`.`movie_id`"), - // "indexName": to.Ptr("idx_movie_id"), - // "indexType": to.Ptr("BTREE"), - // "parentTableName": to.Ptr("movies_genres"), - // "queryIds": to.Ptr("779"), - // "schemaName": to.Ptr("movies"), - // "script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)"), - // "tableName": to.Ptr("movies_genres"), - // }, - // }, - // }, - // { - // Name: to.Ptr("Index-2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2"), - // Properties: &armmysql.RecommendationActionProperties{ - // ActionID: to.Ptr[int32](2), - // AdvisorName: to.Ptr("Index"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24Z"); return t}()), - // Reason: to.Ptr("Column `movies_genres`.`genre` appear in Group By clause(s)."), - // RecommendationType: to.Ptr("Add"), - // SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"), - // Details: map[string]*string{ - // "engine": to.Ptr("InnoDB"), - // "indexColumns": to.Ptr("`movies_genres`.`genre`"), - // "indexName": to.Ptr("idx_genre"), - // "indexType": to.Ptr("BTREE"), - // "parentTableName": to.Ptr("movies_genres"), - // "queryIds": to.Ptr("779"), - // "schemaName": to.Ptr("movies"), - // "script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)"), - // "tableName": to.Ptr("movies_genres"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/logfiles_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/logfiles_client_example_test.go deleted file mode 100644 index 93ac8283e600..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/logfiles_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/LogFileListByServer.json -func ExampleLogFilesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLogFilesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogFileListResult = armmysql.LogFileListResult{ - // Value: []*armmysql.LogFile{ - // { - // Name: to.Ptr("mysql-slow-mysqltestsvc1-2018022823.log"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/logFiles/mysql-slow-mysqltestsvc1-2018022823.log"), - // Properties: &armmysql.LogFileProperties{ - // Type: to.Ptr("slowlog"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T00:00:00+00:00"); return t}()), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20+00:00"); return t}()), - // SizeInKB: to.Ptr[int64](1), - // URL: to.Ptr("https://wasd2prodwus1afse42.file.core.windows.net/833c99b2f36c47349e5554b903fe0440/serverlogs/mysql-slow-mysqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&sig=D9Ga4N5Pa%2BPe5Bmjpvs7A0TPD%2FF7IZpk9e4KWR0jgpM%3D&se=2018-03-01T07%3A12%3A13Z&sp=r"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/management_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/management_client_example_test.go deleted file mode 100644 index 09fa2c97507f..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/management_client_example_test.go +++ /dev/null @@ -1,63 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/QueryPerformanceInsightResetData.json -func ExampleManagementClient_ResetQueryPerformanceInsightData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ResetQueryPerformanceInsightData(ctx, "testResourceGroupName", "testServerName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QueryPerformanceInsightResetDataResult = armmysql.QueryPerformanceInsightResetDataResult{ - // Message: to.Ptr("QPI reset data successful"), - // Status: to.Ptr(armmysql.QueryPerformanceInsightResetDataResultStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionSessionCreate.json -func ExampleManagementClient_BeginCreateRecommendedActionSession() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginCreateRecommendedActionSession(ctx, "testResourceGroupName", "testServerName", "Index", "someDatabaseName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/operations_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/operations_client_example_test.go deleted file mode 100644 index cbd230ce15dd..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/operations_client_example_test.go +++ /dev/null @@ -1,245 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/OperationList.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationListResult = armmysql.OperationListResult{ - // Value: []*armmysql.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforMySQL/locations/performanceTiers/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), - // Operation: to.Ptr("List/Get Firewall Rules"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules/write"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), - // Operation: to.Ptr("Create/Update Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules/delete"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get MySQL Servers"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("MySQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/write"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), - // Operation: to.Ptr("Create/Update MySQL Server"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("MySQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/delete"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete MySQL Server"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("MySQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/performanceTiers/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/recoverableServers/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Return the recoverable MySQL Server info"), - // Operation: to.Ptr("Get Recoverable MySQL Server info"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Recoverable MySQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Return types of metrics that are available for databases"), - // Operation: to.Ptr("Get database metric definitions"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // Properties: map[string]any{ - // "serviceSpecification": map[string]any{ - // "metricSpecifications":[]any{ - // map[string]any{ - // "name": "cpu_percent", - // "aggregationType": "Average", - // "displayDescription": "CPU percent", - // "displayName": "CPU percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "memory_percent", - // "aggregationType": "Average", - // "displayDescription": "Memory percent", - // "displayName": "Memory percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "io_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "IO percent", - // "displayName": "IO percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Storage percentage", - // "displayName": "Storage percentage", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_used", - // "aggregationType": "Average", - // "displayDescription": "Storage used", - // "displayName": "Storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Storage limit", - // "displayName": "Storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "serverlog_storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Server Log storage percent", - // "displayName": "Server Log storage percent", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "serverlog_storage_usage", - // "aggregationType": "Average", - // "displayDescription": "Server Log storage used", - // "displayName": "Server Log storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "serverlog_storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Server Log storage limit", - // "displayName": "Server Log storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "active_connections", - // "aggregationType": "Average", - // "displayDescription": "Total active connections", - // "displayName": "Total active connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "connections_failed", - // "aggregationType": "Average", - // "displayDescription": "Total failed connections", - // "displayName": "Total failed connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "seconds_behind_master", - // "aggregationType": "Average", - // "displayDescription": "Replication lag in seconds", - // "displayName": "Replication lag in seconds", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armmysql.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysql/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/privateendpointconnections_client_example_test.go deleted file mode 100644 index 4284c6238efe..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,228 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armmysql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armmysql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armmysql.PrivateEndpointConnection{ - Properties: &armmysql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armmysql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armmysql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdateTags(ctx, "Default", "test-svr", "private-endpoint-connection-name", armmysql.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armmysql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armmysql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armmysql.PrivateEndpointConnectionListResult{ - // Value: []*armmysql.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armmysql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armmysql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/privatelinkresources_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/privatelinkresources_client_example_test.go deleted file mode 100644 index 7a8467abe516..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByServerPager("Default", "test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armmysql.PrivateLinkResourceListResult{ - // Value: []*armmysql.PrivateLinkResource{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armmysql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("mysqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("mysqlServer")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armmysql.PrivateLinkResource{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armmysql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("mysqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("mysqlServer")}, - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysql/querytexts_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/querytexts_client_example_test.go deleted file mode 100644 index 4a1e0529d307..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/querytexts_client_example_test.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/QueryTextsGet.json -func ExampleQueryTextsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueryTextsClient().Get(ctx, "testResourceGroupName", "testServerName", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QueryText = armmysql.QueryText{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/queryTexts"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryTexts/1"), - // Properties: &armmysql.QueryTextProperties{ - // QueryID: to.Ptr("1"), - // QueryText: to.Ptr("UPDATE `performance_schema`.`setup_instruments` SET `ENABLED` = ? , `TIMED` = ? WHERE NAME = ?"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/QueryTextsListByServer.json -func ExampleQueryTextsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueryTextsClient().NewListByServerPager("testResourceGroupName", "testServerName", []string{ - "1", - "2"}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.QueryTextsResultList = armmysql.QueryTextsResultList{ - // Value: []*armmysql.QueryText{ - // { - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/queryTexts"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryTexts/1"), - // Properties: &armmysql.QueryTextProperties{ - // QueryID: to.Ptr("1"), - // QueryText: to.Ptr("UPDATE `performance_schema`.`setup_instruments` SET `ENABLED` = ? , `TIMED` = ? WHERE NAME = ?"), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/queryTexts"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryTexts/2"), - // Properties: &armmysql.QueryTextProperties{ - // QueryID: to.Ptr("2"), - // QueryText: to.Ptr("UPDATE `performance_schema`.`setup_instruments` SET `ENABLED` = ? , `TIMED` = ? WHERE NAME LIKE ?"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/recommendedactions_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/recommendedactions_client_example_test.go deleted file mode 100644 index 84f646b7ab5a..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/recommendedactions_client_example_test.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionsGet.json -func ExampleRecommendedActionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecommendedActionsClient().Get(ctx, "testResourceGroupName", "testServerName", "Index", "Index-1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecommendationAction = armmysql.RecommendationAction{ - // Name: to.Ptr("Index-1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1"), - // Properties: &armmysql.RecommendationActionProperties{ - // ActionID: to.Ptr[int32](1), - // AdvisorName: to.Ptr("Index"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24Z"); return t}()), - // Reason: to.Ptr("Column `movies_genres`.`movie_id` appear in Join On clause(s)."), - // RecommendationType: to.Ptr("Add"), - // SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"), - // Details: map[string]*string{ - // "engine": to.Ptr("InnoDB"), - // "indexColumns": to.Ptr("`movies_genres`.`movie_id`"), - // "indexName": to.Ptr("idx_movie_id"), - // "indexType": to.Ptr("BTREE"), - // "parentTableName": to.Ptr("movies_genres"), - // "queryIds": to.Ptr("779"), - // "schemaName": to.Ptr("movies"), - // "script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)"), - // "tableName": to.Ptr("movies_genres"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionsListByServer.json -func ExampleRecommendedActionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecommendedActionsClient().NewListByServerPager("testResourceGroupName", "testServerName", "Index", &armmysql.RecommendedActionsClientListByServerOptions{SessionID: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecommendationActionsResultList = armmysql.RecommendationActionsResultList{ - // Value: []*armmysql.RecommendationAction{ - // { - // Name: to.Ptr("Index-1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1"), - // Properties: &armmysql.RecommendationActionProperties{ - // ActionID: to.Ptr[int32](1), - // AdvisorName: to.Ptr("Index"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24Z"); return t}()), - // Reason: to.Ptr("Column `movies_genres`.`movie_id` appear in Join On clause(s)."), - // RecommendationType: to.Ptr("Add"), - // SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"), - // Details: map[string]*string{ - // "engine": to.Ptr("InnoDB"), - // "indexColumns": to.Ptr("`movies_genres`.`movie_id`"), - // "indexName": to.Ptr("idx_movie_id"), - // "indexType": to.Ptr("BTREE"), - // "parentTableName": to.Ptr("movies_genres"), - // "queryIds": to.Ptr("779"), - // "schemaName": to.Ptr("movies"), - // "script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)"), - // "tableName": to.Ptr("movies_genres"), - // }, - // }, - // }, - // { - // Name: to.Ptr("Index-2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2"), - // Properties: &armmysql.RecommendationActionProperties{ - // ActionID: to.Ptr[int32](2), - // AdvisorName: to.Ptr("Index"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24Z"); return t}()), - // Reason: to.Ptr("Column `movies_genres`.`genre` appear in Group By clause(s)."), - // RecommendationType: to.Ptr("Add"), - // SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"), - // Details: map[string]*string{ - // "engine": to.Ptr("InnoDB"), - // "indexColumns": to.Ptr("`movies_genres`.`genre`"), - // "indexName": to.Ptr("idx_genre"), - // "indexType": to.Ptr("BTREE"), - // "parentTableName": to.Ptr("movies_genres"), - // "queryIds": to.Ptr("779"), - // "schemaName": to.Ptr("movies"), - // "script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)"), - // "tableName": to.Ptr("movies_genres"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/recoverableservers_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/recoverableservers_client_example_test.go deleted file mode 100644 index b0e80c8428ad..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/recoverableservers_client_example_test.go +++ /dev/null @@ -1,51 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/RecoverableServersGet.json -func ExampleRecoverableServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableServersClient().Get(ctx, "testrg", "testsvc4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoverableServerResource = armmysql.RecoverableServerResource{ - // Name: to.Ptr("recoverableServers"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/recoverableServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testsvc4/recoverableServers"), - // Properties: &armmysql.RecoverableServerProperties{ - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // LastAvailableBackupDateTime: to.Ptr("2020-11-20T01:06:29.78Z"), - // ServiceLevelObjective: to.Ptr("GP_Gen5_2"), - // VCore: to.Ptr[int32](2), - // Version: to.Ptr("5.7"), - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysql/replicas_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/replicas_client_example_test.go deleted file mode 100644 index 98dea15dafe4..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/replicas_client_example_test.go +++ /dev/null @@ -1,139 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ReplicasListByServer.json -func ExampleReplicasClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup", "testmaster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armmysql.ServerListResult{ - // Value: []*armmysql.Server{ - // { - // Name: to.Ptr("testserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "elasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T23:56:54.3+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver.mysql.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](256000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive6), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver1"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "elasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T23:56:54.3+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver1.mysql.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](256000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive6), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver2"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "elasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T23:56:54.3+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver2.mysql.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](256000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive6), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/serveradministrators_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/serveradministrators_client_example_test.go deleted file mode 100644 index ae8ffaa4078c..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/serveradministrators_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminGet.json -func ExampleServerAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdministratorsClient().Get(ctx, "testrg", "mysqltestsvc4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAdministratorResource = armmysql.ServerAdministratorResource{ - // Name: to.Ptr("activeDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/administrators/activeDirectory"), - // Properties: &armmysql.ServerAdministratorProperties{ - // AdministratorType: to.Ptr("ActiveDirectory"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminCreateUpdate.json -func ExampleServerAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "mysqltestsvc4", armmysql.ServerAdministratorResource{ - Properties: &armmysql.ServerAdministratorProperties{ - AdministratorType: to.Ptr("ActiveDirectory"), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAdministratorResource = armmysql.ServerAdministratorResource{ - // Name: to.Ptr("activeDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/administrators/activeDirectory"), - // Properties: &armmysql.ServerAdministratorProperties{ - // AdministratorType: to.Ptr("ActiveDirectory"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminDelete.json -func ExampleServerAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdministratorsClient().BeginDelete(ctx, "testrg", "mysqltestsvc4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminList.json -func ExampleServerAdministratorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerAdministratorsClient().NewListPager("testrg", "mysqltestsvc4", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerAdministratorResourceListResult = armmysql.ServerAdministratorResourceListResult{ - // Value: []*armmysql.ServerAdministratorResource{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/administrators/activeDirectory"), - // Properties: &armmysql.ServerAdministratorProperties{ - // AdministratorType: to.Ptr("ActiveDirectory"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/serverbasedperformancetier_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/serverbasedperformancetier_client_example_test.go deleted file mode 100644 index 55bcb2464559..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/serverbasedperformancetier_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json -func ExampleServerBasedPerformanceTierClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerBasedPerformanceTierClient().NewListPager("testrg", "mysqltestsvc1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PerformanceTierListResult = armmysql.PerformanceTierListResult{ - // Value: []*armmysql.PerformanceTierProperties{ - // { - // ID: to.Ptr("Basic"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](0), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_1"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](1), - // }, - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }}, - // }, - // { - // ID: to.Ptr("GeneralPurpose"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_64"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }, - // { - // ID: to.Ptr("MemoryOptimized"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/serverkeys_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/serverkeys_client_example_test.go deleted file mode 100644 index 08bd1b9314a2..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/serverkeys_client_example_test.go +++ /dev/null @@ -1,150 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyList.json -func ExampleServerKeysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerKeysClient().NewListPager("testrg", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerKeyListResult = armmysql.ServerKeyListResult{ - // Value: []*armmysql.ServerKey{ - // { - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armmysql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.0Z"); return t}()), - // ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyGet.json -func ExampleServerKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerKeysClient().Get(ctx, "testrg", "testserver", "someVault_someKey_01234567890123456789012345678901", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerKey = armmysql.ServerKey{ - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armmysql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.0Z"); return t}()), - // ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.json -func ExampleServerKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerKeysClient().BeginCreateOrUpdate(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", armmysql.ServerKey{ - Properties: &armmysql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerKey = armmysql.ServerKey{ - // Name: to.Ptr("omeVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armmysql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T00:00:00.0Z"); return t}()), - // ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyDelete.json -func ExampleServerKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerKeysClient().BeginDelete(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/serverparameters_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/serverparameters_client_example_test.go deleted file mode 100644 index aab222538142..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/serverparameters_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json -func ExampleServerParametersClient_BeginListUpdateConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerParametersClient().BeginListUpdateConfigurations(ctx, "testrg", "mysqltestsvc1", armmysql.ConfigurationListResult{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationListResult = armmysql.ConfigurationListResult{ - // Value: []*armmysql.Configuration{ - // { - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/event_scheduler"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("div_precision_increment"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/div_precision_increment"), - // Properties: &armmysql.ConfigurationProperties{ - // Description: to.Ptr("Number of digits by which to increase the scale of the result of division operations."), - // AllowedValues: to.Ptr("0-30"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysql/servers_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/servers_client_example_test.go deleted file mode 100644 index 9dd68af9b8a6..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/servers_client_example_test.go +++ /dev/null @@ -1,759 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysql.ServerForCreate{ - Location: to.Ptr("brazilsouth"), - Properties: &armmysql.ServerPropertiesForRestore{ - CreateMode: to.Ptr(armmysql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver"), - }, - SKU: &armmysql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armmysql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/targetserver"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "elasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.mysql.database.azure.com"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreate.json -func ExampleServersClient_BeginCreate_createANewServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestsvc4", armmysql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armmysql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armmysql.CreateModeDefault), - SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - StorageProfile: &armmysql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - StorageMB: to.Ptr[int32](128000), - }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(""), - }, - SKU: &armmysql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armmysql.Server{ - // Name: to.Ptr("mysqltestsvc4"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "elasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltestsvc4.mysql.database.azure.com"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json -func ExampleServersClient_BeginCreate_createAReplicaServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armmysql.ServerPropertiesForReplica{ - CreateMode: to.Ptr(armmysql.CreateModeReplica), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armmysql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/servers/targetserver"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.mysql.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](14), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.json -func ExampleServersClient_BeginCreate_createAServerAsAGeoRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armmysql.ServerPropertiesForGeoRestore{ - CreateMode: to.Ptr(armmysql.CreateModeGeoRestore), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver"), - }, - SKU: &armmysql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armmysql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/targetserver"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "elasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.mysql.database.azure.com"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](14), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestsvc4", armmysql.ServerUpdateParameters{ - Properties: &armmysql.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.Ptr(""), - SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armmysql.Server{ - // Name: to.Ptr("mysqltestsvc4"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltestsvc4.mysql.database.azure.com"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumDisabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerGet.json -func ExampleServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "mysqltestsvc4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armmysql.Server{ - // Name: to.Ptr("mysqltestsvc4"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltestsvc4.mysql.database.azure.com"), - // MasterServerID: to.Ptr(""), - // PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armmysql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled), - // ReplicaCapacity: to.Ptr[int32](5), - // ReplicationRole: to.Ptr("None"), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("testrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armmysql.ServerListResult{ - // Value: []*armmysql.Server{ - // { - // Name: to.Ptr("mysqltestsvc1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T18:17:35.729321+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltestsvc1.mysql.database.azure.com"), - // PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("mysqltstsvc2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T18:17:35.729321+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltstsvc2.mysql.database.azure.com"), - // PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armmysql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerList.json -func ExampleServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armmysql.ServerListResult{ - // Value: []*armmysql.Server{ - // { - // Name: to.Ptr("mysqltestsvc1"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T23:56:02.627+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltestsvc1.mysql.database.azure.com"), - // PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("mysqltstsvc2"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T23:56:54.3+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltstsvc2.mysql.database.azure.com"), - // PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armmysql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("mysqltestsvc3"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg1/providers/Microsoft.DBforMySQL/servers/mysqltestsvc3"), - // Location: to.Ptr("westus"), - // Properties: &armmysql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T23:59:44.847+00:00"); return t}()), - // FullyQualifiedDomainName: to.Ptr("mysqltestsvc3.mysql.database.azure.com"), - // PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc3/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armmysql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmysql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled), - // StorageProfile: &armmysql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](102400), - // }, - // UserVisibleState: to.Ptr(armmysql.ServerStateReady), - // Version: to.Ptr(armmysql.ServerVersionFive7), - // }, - // SKU: &armmysql.SKU{ - // Name: to.Ptr("GP_Gen4_4"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armmysql.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerRestart.json -func ExampleServersClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerStart.json -func ExampleServersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginStart(ctx, "TestGroup", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerStop.json -func ExampleServersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginStop(ctx, "TestGroup", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerUpgrade.json -func ExampleServersClient_BeginUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpgrade(ctx, "TestGroup", "testserver", armmysql.ServerUpgradeParameters{ - Properties: &armmysql.ServerUpgradeParametersProperties{ - TargetServerVersion: to.Ptr("5.7"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/serversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/serversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 099dd353220c..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/serversecurityalertpolicies_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armmysql.SecurityAlertPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerSecurityAlertPolicy = armmysql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armmysql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@microsoft.com;user@microsoft.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateDisabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armmysql.SecurityAlertPolicyNameDefault, armmysql.ServerSecurityAlertPolicy{ - Properties: &armmysql.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerSecurityAlertPolicy = armmysql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armmysql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly"), - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("testSecurityAlert@microsoft.com")}, - // RetentionDays: to.Ptr[int32](5), - // State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateEnabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMin.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armmysql.SecurityAlertPolicyNameDefault, armmysql.ServerSecurityAlertPolicy{ - Properties: &armmysql.SecurityAlertPolicyProperties{ - EmailAccountAdmins: to.Ptr(true), - State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerSecurityAlertPolicy = armmysql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armmysql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // }, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // }, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateEnabled), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerSecurityAlertPoliciesClient().NewListByServerPager("securityalert-4799", "securityalert-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerSecurityAlertPolicyListResult = armmysql.ServerSecurityAlertPolicyListResult{ - // Value: []*armmysql.ServerSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies"), - // Properties: &armmysql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@microsoft.com;user@microsoft.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateDisabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/topquerystatistics_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/topquerystatistics_client_example_test.go deleted file mode 100644 index 307f9cbd06c9..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/topquerystatistics_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/TopQueryStatisticsGet.json -func ExampleTopQueryStatisticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopQueryStatisticsClient().Get(ctx, "testResourceGroupName", "testServerName", "66-636923268000000000-636923277000000000-avg-duration", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QueryStatistic = armmysql.QueryStatistic{ - // Name: to.Ptr("66-636923268000000000-636923277000000000-avg-duration"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/queryStatistics"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryStatistic/66-636923268000000000-636923277000000000-avg-duration"), - // Properties: &armmysql.QueryStatisticProperties{ - // AggregationFunction: to.Ptr("avg"), - // DatabaseNames: []*string{ - // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql")}, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:15:00Z"); return t}()), - // MetricDisplayName: to.Ptr("Query duration"), - // MetricName: to.Ptr("duration"), - // MetricValue: to.Ptr[float64](123.301446136), - // MetricValueUnit: to.Ptr("milliseconds"), - // QueryExecutionCount: to.Ptr[int64](1), - // QueryID: to.Ptr("66"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:00:00Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/TopQueryStatisticsListByServer.json -func ExampleTopQueryStatisticsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopQueryStatisticsClient().NewListByServerPager("testResourceGroupName", "testServerName", armmysql.TopQueryStatisticsInput{ - Properties: &armmysql.TopQueryStatisticsInputProperties{ - AggregationFunction: to.Ptr("avg"), - AggregationWindow: to.Ptr("PT15M"), - NumberOfTopQueries: to.Ptr[int32](5), - ObservationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T20:00:00.000Z"); return t }()), - ObservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T20:00:00.000Z"); return t }()), - ObservedMetric: to.Ptr("duration"), - }, - }, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopQueryStatisticsResultList = armmysql.TopQueryStatisticsResultList{ - // Value: []*armmysql.QueryStatistic{ - // { - // Name: to.Ptr("66-636923268000000000-636923277000000000-avg-duration"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/queryStatistics"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryStatistic/66-636923268000000000-636923277000000000-avg-duration"), - // Properties: &armmysql.QueryStatisticProperties{ - // AggregationFunction: to.Ptr("avg"), - // DatabaseNames: []*string{ - // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql")}, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:15:00Z"); return t}()), - // MetricDisplayName: to.Ptr("Query duration"), - // MetricName: to.Ptr("duration"), - // MetricValue: to.Ptr[float64](123.301446136), - // MetricValueUnit: to.Ptr("milliseconds"), - // QueryExecutionCount: to.Ptr[int64](1), - // QueryID: to.Ptr("66"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:00:00Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("66-636924483000000000-636924492000000000-avg-duration"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/queryStatistics"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryStatistic/66-636924483000000000-636924492000000000-avg-duration"), - // Properties: &armmysql.QueryStatisticProperties{ - // AggregationFunction: to.Ptr("avg"), - // DatabaseNames: []*string{ - // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql")}, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-03T03:00:00Z"); return t}()), - // MetricDisplayName: to.Ptr("Query duration"), - // MetricName: to.Ptr("duration"), - // MetricValue: to.Ptr[float64](1712.301446136), - // MetricValueUnit: to.Ptr("milliseconds"), - // QueryExecutionCount: to.Ptr[int64](1), - // QueryID: to.Ptr("66"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-03T02:45:00Z"); return t}()), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/virtualnetworkrules_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/virtualnetworkrules_client_example_test.go deleted file mode 100644 index 7400195e62f7..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/virtualnetworkrules_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkRulesClient().Get(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkRule = armmysql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armmysql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armmysql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", armmysql.VirtualNetworkRule{ - Properties: &armmysql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkRule = armmysql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armmysql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginDelete(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkRulesClient().NewListByServerPager("TestGroup", "vnet-test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkRuleListResult = armmysql.VirtualNetworkRuleListResult{ - // Value: []*armmysql.VirtualNetworkRule{ - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armmysql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armmysql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }, - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armmysql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armmysql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysql/waitstatistics_client_example_test.go b/sdk/resourcemanager/mysql/armmysql/waitstatistics_client_example_test.go deleted file mode 100644 index 532219aa37c5..000000000000 --- a/sdk/resourcemanager/mysql/armmysql/waitstatistics_client_example_test.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmysql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/WaitStatisticsGet.json -func ExampleWaitStatisticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWaitStatisticsClient().Get(ctx, "testResourceGroupName", "testServerName", "636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WaitStatistic = armmysql.WaitStatistic{ - // Name: to.Ptr("636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/waitStatistics"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/waitStatistics/636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"), - // Properties: &armmysql.WaitStatisticProperties{ - // Count: to.Ptr[int64](3), - // DatabaseName: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:45:00Z"); return t}()), - // EventName: to.Ptr("wait/io/socket/sql/client_connection"), - // EventTypeName: to.Ptr("send"), - // QueryID: to.Ptr[int64](2), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:30:00Z"); return t}()), - // TotalTimeInMs: to.Ptr[float64](12.345), - // UserID: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/WaitStatisticsListByServer.json -func ExampleWaitStatisticsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWaitStatisticsClient().NewListByServerPager("testResourceGroupName", "testServerName", armmysql.WaitStatisticsInput{ - Properties: &armmysql.WaitStatisticsInputProperties{ - AggregationWindow: to.Ptr("PT15M"), - ObservationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T20:00:00.000Z"); return t }()), - ObservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T20:00:00.000Z"); return t }()), - }, - }, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WaitStatisticsResultList = armmysql.WaitStatisticsResultList{ - // Value: []*armmysql.WaitStatistic{ - // { - // Name: to.Ptr("636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/waitStatistics"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/waitStatistics/636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"), - // Properties: &armmysql.WaitStatisticProperties{ - // Count: to.Ptr[int64](2), - // DatabaseName: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:45:00Z"); return t}()), - // EventName: to.Ptr("wait/io/socket/sql/client_connection"), - // EventTypeName: to.Ptr("send"), - // QueryID: to.Ptr[int64](2), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:30:00Z"); return t}()), - // TotalTimeInMs: to.Ptr[float64](12.345), - // UserID: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("636927606000000000-636927615000000000-lock-wait/synch/mutex/mysys/THR_LOCK::mutex-2--0"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/waitStatistics"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/hyshim-test/providers/Microsoft.DBforMySQL/servers/hyshim-wait-stats-fix/waitStatistics/636927606000000000-636927615000000000-lock-wait/synch/mutex/mysys/THR_LOCK::mutex-2--0"), - // Properties: &armmysql.WaitStatisticProperties{ - // Count: to.Ptr[int64](4), - // DatabaseName: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/hyshim-test/providers/Microsoft.DBforMySQL/servers/hyshim-wait-stats-fix/databases/"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:45:00Z"); return t}()), - // EventName: to.Ptr("wait/synch/mutex/mysys/THR_LOCK::mutex"), - // EventTypeName: to.Ptr("lock"), - // QueryID: to.Ptr[int64](2), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:30:00Z"); return t}()), - // TotalTimeInMs: to.Ptr[float64](56.789), - // UserID: to.Ptr[int64](0), - // }, - // }}, - // } - } -}