diff --git a/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md b/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md index 594e8fd2b39c..58b8e8ea836e 100644 --- a/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md +++ b/sdk/resourcemanager/mysql/armmysql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.2.1 (2024-11-29) +### Other Changes + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/mysql/armmysql/README.md b/sdk/resourcemanager/mysql/armmysql/README.md index 936c7b9a41c7..13064c5a3e16 100644 --- a/sdk/resourcemanager/mysql/armmysql/README.md +++ b/sdk/resourcemanager/mysql/armmysql/README.md @@ -55,7 +55,7 @@ clientFactory, err := armmysql.NewClientFactory(, cred, &option A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewDatabasesClient() +client := clientFactory.NewAdvisorsClient() ``` ## Fakes 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 2509dae52a59..a0fb51047e97 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.2.0 +module-version: 1.2.1 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/client_factory.go b/sdk/resourcemanager/mysql/armmysql/client_factory.go index 0f58cbaaf8cb..82efe4b38306 100644 --- a/sdk/resourcemanager/mysql/armmysql/client_factory.go +++ b/sdk/resourcemanager/mysql/armmysql/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,168 +26,219 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewAdvisorsClient creates a new instance of AdvisorsClient. func (c *ClientFactory) NewAdvisorsClient() *AdvisorsClient { - subClient, _ := NewAdvisorsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AdvisorsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient. func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient { - subClient, _ := NewCheckNameAvailabilityClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CheckNameAvailabilityClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewConfigurationsClient creates a new instance of ConfigurationsClient. func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient { - subClient, _ := NewConfigurationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDatabasesClient creates a new instance of DatabasesClient. func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { - subClient, _ := NewDatabasesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DatabasesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewFirewallRulesClient creates a new instance of FirewallRulesClient. func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { - subClient, _ := NewFirewallRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FirewallRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient. func (c *ClientFactory) NewLocationBasedPerformanceTierClient() *LocationBasedPerformanceTierClient { - subClient, _ := NewLocationBasedPerformanceTierClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LocationBasedPerformanceTierClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLocationBasedRecommendedActionSessionsOperationStatusClient creates a new instance of LocationBasedRecommendedActionSessionsOperationStatusClient. func (c *ClientFactory) NewLocationBasedRecommendedActionSessionsOperationStatusClient() *LocationBasedRecommendedActionSessionsOperationStatusClient { - subClient, _ := NewLocationBasedRecommendedActionSessionsOperationStatusClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LocationBasedRecommendedActionSessionsOperationStatusClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLocationBasedRecommendedActionSessionsResultClient creates a new instance of LocationBasedRecommendedActionSessionsResultClient. func (c *ClientFactory) NewLocationBasedRecommendedActionSessionsResultClient() *LocationBasedRecommendedActionSessionsResultClient { - subClient, _ := NewLocationBasedRecommendedActionSessionsResultClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LocationBasedRecommendedActionSessionsResultClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLogFilesClient creates a new instance of LogFilesClient. func (c *ClientFactory) NewLogFilesClient() *LogFilesClient { - subClient, _ := NewLogFilesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LogFilesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewManagementClient creates a new instance of ManagementClient. func (c *ClientFactory) NewManagementClient() *ManagementClient { - subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ManagementClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewQueryTextsClient creates a new instance of QueryTextsClient. func (c *ClientFactory) NewQueryTextsClient() *QueryTextsClient { - subClient, _ := NewQueryTextsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &QueryTextsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewRecommendedActionsClient creates a new instance of RecommendedActionsClient. func (c *ClientFactory) NewRecommendedActionsClient() *RecommendedActionsClient { - subClient, _ := NewRecommendedActionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &RecommendedActionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewRecoverableServersClient creates a new instance of RecoverableServersClient. func (c *ClientFactory) NewRecoverableServersClient() *RecoverableServersClient { - subClient, _ := NewRecoverableServersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &RecoverableServersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { - subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ReplicasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient. func (c *ClientFactory) NewServerAdministratorsClient() *ServerAdministratorsClient { - subClient, _ := NewServerAdministratorsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerAdministratorsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient. func (c *ClientFactory) NewServerBasedPerformanceTierClient() *ServerBasedPerformanceTierClient { - subClient, _ := NewServerBasedPerformanceTierClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerBasedPerformanceTierClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerKeysClient creates a new instance of ServerKeysClient. func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient { - subClient, _ := NewServerKeysClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerKeysClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerParametersClient creates a new instance of ServerParametersClient. func (c *ClientFactory) NewServerParametersClient() *ServerParametersClient { - subClient, _ := NewServerParametersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerParametersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient. func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient { - subClient, _ := NewServerSecurityAlertPoliciesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerSecurityAlertPoliciesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServersClient creates a new instance of ServersClient. func (c *ClientFactory) NewServersClient() *ServersClient { - subClient, _ := NewServersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewTopQueryStatisticsClient creates a new instance of TopQueryStatisticsClient. func (c *ClientFactory) NewTopQueryStatisticsClient() *TopQueryStatisticsClient { - subClient, _ := NewTopQueryStatisticsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &TopQueryStatisticsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient. func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient { - subClient, _ := NewVirtualNetworkRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &VirtualNetworkRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWaitStatisticsClient creates a new instance of WaitStatisticsClient. func (c *ClientFactory) NewWaitStatisticsClient() *WaitStatisticsClient { - subClient, _ := NewWaitStatisticsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WaitStatisticsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } 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 73920a298105..55f23e51ca39 100644 --- a/sdk/resourcemanager/mysql/armmysql/constants.go +++ b/sdk/resourcemanager/mysql/armmysql/constants.go @@ -10,7 +10,7 @@ package armmysql const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" - moduleVersion = "v1.2.0" + moduleVersion = "v1.2.1" ) // 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/fake/time_rfc3339.go b/sdk/resourcemanager/mysql/armmysql/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/mysql/armmysql/fake/time_rfc3339.go +++ b/sdk/resourcemanager/mysql/armmysql/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 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 e67af4ac5a00..d8b0237d3dc9 100644 --- a/sdk/resourcemanager/mysql/armmysql/go.mod +++ b/sdk/resourcemanager/mysql/armmysql/go.mod @@ -2,20 +2,10 @@ 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.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/mysql/armmysql/go.sum b/sdk/resourcemanager/mysql/armmysql/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/mysql/armmysql/go.sum +++ b/sdk/resourcemanager/mysql/armmysql/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 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 d0687d318566..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:00.000Z"); 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 4b9210e19468..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:24.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); 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:24.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); 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 be8cccc6157c..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, "1-01-01T00:00:00.000Z"); return t}()), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20.000Z"); 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/models_serde.go b/sdk/resourcemanager/mysql/armmysql/models_serde.go index 988f40f96c17..79dd00eea41f 100644 --- a/sdk/resourcemanager/mysql/armmysql/models_serde.go +++ b/sdk/resourcemanager/mysql/armmysql/models_serde.go @@ -3377,7 +3377,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { 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/polymorphic_helpers.go b/sdk/resourcemanager/mysql/armmysql/polymorphic_helpers.go index 552b8139acb3..43d295d66e26 100644 --- a/sdk/resourcemanager/mysql/armmysql/polymorphic_helpers.go +++ b/sdk/resourcemanager/mysql/armmysql/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armmysql import "encoding/json" func unmarshalServerPropertiesForCreateClassification(rawMsg json.RawMessage) (ServerPropertiesForCreateClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any 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 3045d1370c31..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:24.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); 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:24.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); 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:24.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); 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 e0f455d3c944..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.300Z"); 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.300Z"); 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.300Z"); 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/response_types.go b/sdk/resourcemanager/mysql/armmysql/responses.go similarity index 100% rename from sdk/resourcemanager/mysql/armmysql/response_types.go rename to sdk/resourcemanager/mysql/armmysql/responses.go 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 82cf047948ac..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.000Z"); 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.000Z"); 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.000Z"); 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 52e74fa5ca78..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.577Z"); 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.577Z"); 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.577Z"); 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.577Z"); 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.577Z"); 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.577Z"); 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.729Z"); 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.729Z"); 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.627Z"); 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.300Z"); 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.847Z"); 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/time_rfc3339.go b/sdk/resourcemanager/mysql/armmysql/time_rfc3339.go index f58593622717..6b334c056e17 100644 --- a/sdk/resourcemanager/mysql/armmysql/time_rfc3339.go +++ b/sdk/resourcemanager/mysql/armmysql/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 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 e43187b6e5b1..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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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 b85bb9100b58..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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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:00.000Z"); 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:00.000Z"); return t}()), - // TotalTimeInMs: to.Ptr[float64](56.789), - // UserID: to.Ptr[int64](0), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md index a9e8d713b049..cb25c54fd8a0 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 2.0.0-beta.4 (2024-11-29) +### Features Added + +- New enum type `PatchStrategy` with values `PatchStrategyRegular`, `PatchStrategyVirtualCanary` +- New enum type `StorageRedundancyEnum` with values `StorageRedundancyEnumLocalRedundancy`, `StorageRedundancyEnumZoneRedundancy` +- New function `*ServersClient.BeginDetachVNet(context.Context, string, string, ServerDetachVNetParameter, *ServersClientBeginDetachVNetOptions) (*runtime.Poller[ServersClientDetachVNetResponse], error)` +- New struct `FeatureProperty` +- New struct `MaintenancePolicy` +- New struct `ServerDetachVNetParameter` +- New field `SupportedFeatures` in struct `CapabilityPropertiesV2` +- New field `DatabasePort`, `FullVersion`, `MaintenancePolicy` in struct `ServerProperties` +- New field `MaintenancePolicy` in struct `ServerPropertiesForUpdate` +- New field `StorageRedundancy` in struct `Storage` + + ## 2.0.0-beta.3 (2024-04-30) ### Breaking Changes diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go index 9d99c9d8f38e..32737a373d74 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go @@ -46,7 +46,7 @@ func NewAdvancedThreatProtectionSettingsClient(subscriptionID string, credential // Get - Get a server's Advanced Threat Protection state // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - advancedThreatProtectionName - The name of the Advanced Threat Protection state. @@ -98,7 +98,7 @@ func (client *AdvancedThreatProtectionSettingsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *AdvancedThreatProtectionSettingsClient) getHandleResponse(resp *ht // NewListPager - Gets a list of server's Advanced Threat Protection states. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - AdvancedThreatProtectionSettingsClientListOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.NewListPager @@ -163,7 +163,7 @@ func (client *AdvancedThreatProtectionSettingsClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *AdvancedThreatProtectionSettingsClient) listHandleResponse(resp *h // BeginUpdate - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - advancedThreatProtectionName - The name of the Advanced Threat Protection state. @@ -209,7 +209,7 @@ func (client *AdvancedThreatProtectionSettingsClient) BeginUpdate(ctx context.Co // Update - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *AdvancedThreatProtectionSettingsClient) update(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtectionForUpdate, options *AdvancedThreatProtectionSettingsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AdvancedThreatProtectionSettingsClient.BeginUpdate" @@ -255,7 +255,7 @@ func (client *AdvancedThreatProtectionSettingsClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -267,7 +267,7 @@ func (client *AdvancedThreatProtectionSettingsClient) updateCreateRequest(ctx co // BeginUpdatePut - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - advancedThreatProtectionName - The name of the Advanced Threat Protection state. @@ -295,7 +295,7 @@ func (client *AdvancedThreatProtectionSettingsClient) BeginUpdatePut(ctx context // UpdatePut - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *AdvancedThreatProtectionSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtection, options *AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions) (*http.Response, error) { var err error const operationName = "AdvancedThreatProtectionSettingsClient.BeginUpdatePut" @@ -341,7 +341,7 @@ func (client *AdvancedThreatProtectionSettingsClient) updatePutCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index 21d9c415505d..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,287 +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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/AdvancedThreatProtectionSettingsGet.json -func ExampleAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", armmysqlflexibleservers.AdvancedThreatProtectionNameDefault, 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/AdvancedThreatProtectionSettingsPatchDisabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_disableAServersAdvancedThreatProtectionSettingsWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().BeginUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armmysqlflexibleservers.AdvancedThreatProtectionNameDefault, armmysqlflexibleservers.AdvancedThreatProtectionForUpdate{ - Properties: &armmysqlflexibleservers.AdvancedThreatProtectionUpdateProperties{ - State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), - }, - }, 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/AdvancedThreatProtectionSettingsPatchEnabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_enableAServersAdvancedThreatProtectionSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().BeginUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armmysqlflexibleservers.AdvancedThreatProtectionNameDefault, armmysqlflexibleservers.AdvancedThreatProtectionForUpdate{ - Properties: &armmysqlflexibleservers.AdvancedThreatProtectionUpdateProperties{ - State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - }, - }, 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/AdvancedThreatProtectionSettingsPutDisabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_disableAServersAdvancedThreatProtectionSettingsWithAllParametersUsingPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().BeginUpdatePut(ctx, "threatprotection-4799", "threatprotection-6440", armmysqlflexibleservers.AdvancedThreatProtectionNameDefault, armmysqlflexibleservers.AdvancedThreatProtection{ - Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), - }, - }, 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/AdvancedThreatProtectionSettingsPutEnabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_enableAServersAdvancedThreatProtectionSettingsUsingPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdvancedThreatProtectionSettingsClient().BeginUpdatePut(ctx, "threatprotection-4799", "threatprotection-6440", armmysqlflexibleservers.AdvancedThreatProtectionNameDefault, armmysqlflexibleservers.AdvancedThreatProtection{ - Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - }, - }, 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/AdvancedThreatProtectionSettingsList.json -func ExampleAdvancedThreatProtectionSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdvancedThreatProtectionSettingsClient().NewListPager("threatprotection-6852", "threatprotection-2080", 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.AdvancedThreatProtectionListResult = armmysqlflexibleservers.AdvancedThreatProtectionListResult{ - // Value: []*armmysqlflexibleservers.AdvancedThreatProtection{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-2080/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md b/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md index 0b895a6c8f77..cde1060ce5d8 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md @@ -5,10 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/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: 2.0.0-beta.3 +module-version: 2.0.0-beta.4 package-flexibleservers: true -tag: package-flexibleserver-2023-12-30 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go index c183fcef37d8..954ee46d3b57 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go @@ -46,7 +46,7 @@ func NewAzureADAdministratorsClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - administratorName - The name of the Azure AD Administrator. @@ -73,7 +73,7 @@ func (client *AzureADAdministratorsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *AzureADAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters AzureADAdministrator, options *AzureADAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureADAdministratorsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *AzureADAdministratorsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ func (client *AzureADAdministratorsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes an Azure AD Administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - administratorName - The name of the Azure AD Administrator. @@ -158,7 +158,7 @@ func (client *AzureADAdministratorsClient) BeginDelete(ctx context.Context, reso // Delete - Deletes an Azure AD Administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *AzureADAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *AzureADAdministratorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AzureADAdministratorsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *AzureADAdministratorsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *AzureADAdministratorsClient) deleteCreateRequest(ctx context.Conte // Get - Gets information about an azure ad administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - administratorName - The name of the Azure AD Administrator. @@ -265,7 +265,7 @@ func (client *AzureADAdministratorsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *AzureADAdministratorsClient) getHandleResponse(resp *http.Response // NewListByServerPager - List all the AAD administrators in a given server. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - AzureADAdministratorsClientListByServerOptions contains the optional parameters for the AzureADAdministratorsClient.NewListByServerPager @@ -330,7 +330,7 @@ func (client *AzureADAdministratorsClient) listByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client_example_test.go deleted file mode 100644 index 7997522f5579..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorCreate.json -func ExampleAzureADAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureADAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "mysqltestsvc4", armmysqlflexibleservers.AdministratorNameActiveDirectory, armmysqlflexibleservers.AzureADAdministrator{ - Properties: &armmysqlflexibleservers.AdministratorProperties{ - AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), - }, - }, 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.AzureADAdministrator = armmysqlflexibleservers.AzureADAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), - // Properties: &armmysqlflexibleservers.AdministratorProperties{ - // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorDelete.json -func ExampleAzureADAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureADAdministratorsClient().BeginDelete(ctx, "testrg", "mysqltestsvc4", armmysqlflexibleservers.AdministratorNameActiveDirectory, 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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorGet.json -func ExampleAzureADAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureADAdministratorsClient().Get(ctx, "testrg", "mysqltestsvc4", armmysqlflexibleservers.AdministratorNameActiveDirectory, 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.AzureADAdministrator = armmysqlflexibleservers.AzureADAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), - // Properties: &armmysqlflexibleservers.AdministratorProperties{ - // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorsListByServer.json -func ExampleAzureADAdministratorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureADAdministratorsClient().NewListByServerPager("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.AdministratorListResult = armmysqlflexibleservers.AdministratorListResult{ - // Value: []*armmysqlflexibleservers.AzureADAdministrator{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), - // Properties: &armmysqlflexibleservers.AdministratorProperties{ - // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go index f7cd88c55f59..ef236f4245b8 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go @@ -46,7 +46,7 @@ func NewBackupAndExportClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Exports the backup of the given server by creating a backup if not existing. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for creating and exporting backup of the given server. @@ -73,7 +73,7 @@ func (client *BackupAndExportClient) BeginCreate(ctx context.Context, resourceGr // Create - Exports the backup of the given server by creating a backup if not existing. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 func (client *BackupAndExportClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters BackupAndExportRequest, options *BackupAndExportClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "BackupAndExportClient.BeginCreate" @@ -115,7 +115,7 @@ func (client *BackupAndExportClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -127,7 +127,7 @@ func (client *BackupAndExportClient) createCreateRequest(ctx context.Context, re // ValidateBackup - Validates if backup can be performed for given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - BackupAndExportClientValidateBackupOptions contains the optional parameters for the BackupAndExportClient.ValidateBackup @@ -174,7 +174,7 @@ func (client *BackupAndExportClient) validateBackupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client_example_test.go deleted file mode 100644 index 1e8c53fcb2c6..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupAndExport.json -func ExampleBackupAndExportClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupAndExportClient().BeginCreate(ctx, "TestGroup", "mysqltestserver", armmysqlflexibleservers.BackupAndExportRequest{ - BackupSettings: &armmysqlflexibleservers.BackupSettings{ - BackupName: to.Ptr("customer-backup-name"), - }, - TargetDetails: &armmysqlflexibleservers.FullBackupStoreDetails{ - ObjectType: to.Ptr("FullBackupStoreDetails"), - SasURIList: []*string{ - to.Ptr("sasuri1"), - to.Ptr("sasuri2")}, - }, - }, 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.BackupAndExportResponse = armmysqlflexibleservers.BackupAndExportResponse{ - // Error: &armmysqlflexibleservers.ErrorDetail{ - // Code: to.Ptr("AggregateException"), - // Message: to.Ptr("System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"), - // }, - // Name: to.Ptr("custom-backup101"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupAndExport"), - // ID: to.Ptr("/subscriptions/cb9d743d-2140-4e73-b871-cd31abab1d2f/resourceGroups/mrgsumitkumatest1/providers/Microsoft.DBforMySQL/flexibleServers/servermysql-01/backupAndExport/custom-backup101"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-29T07:37:05.640Z"); return t}()), - // PercentComplete: to.Ptr[float64](100), - // Properties: &armmysqlflexibleservers.BackupAndExportResponseProperties{ - // BackupMetadata: to.Ptr("{\"key1\":\"value1\",\"key2\":\"value2\"}"), - // DataTransferredInBytes: to.Ptr[int64](1024), - // DatasourceSizeInBytes: to.Ptr[int64](1024), - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr(armmysqlflexibleservers.OperationStatusFailed), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ValidateBackup.json -func ExampleBackupAndExportClient_ValidateBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupAndExportClient().ValidateBackup(ctx, "TestGroup", "mysqltestserver", 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.ValidateBackupResponse = armmysqlflexibleservers.ValidateBackupResponse{ - // Properties: &armmysqlflexibleservers.ValidateBackupResponseProperties{ - // NumberOfContainers: to.Ptr[int32](1), - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go index 65ce0b3cd432..505a17a57f29 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go @@ -46,7 +46,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // Get - List all the backups for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -97,7 +97,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClie // NewListByServerPager - List all the backups for a given server. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - BackupsClientListByServerOptions contains the optional parameters for the BackupsClient.NewListByServerPager @@ -162,7 +162,7 @@ func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *BackupsClient) listByServerHandleResponse(resp *http.Response) (Ba // Put - Create backup for a given server with specified backup name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -231,7 +231,7 @@ func (client *BackupsClient) putCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go deleted file mode 100644 index a3e36e771465..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go +++ /dev/null @@ -1,216 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupPut.json -func ExampleBackupsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().Put(ctx, "TestGroup", "mysqltestserver", "mybackup", 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.ServerBackup = armmysqlflexibleservers.ServerBackup{ - // Name: to.Ptr("customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-07T07:38:01.149Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupGet.json -func ExampleBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().Get(ctx, "TestGroup", "mysqltestserver", "daily_20210615T160516", 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.ServerBackup = armmysqlflexibleservers.ServerBackup{ - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupsListByServer.json -func ExampleBackupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupsClient().NewListByServerPager("TestGroup", "mysqltestserver", 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.ServerBackupListResult = armmysqlflexibleservers.ServerBackupListResult{ - // Value: []*armmysqlflexibleservers.ServerBackup{ - // { - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210616T160520"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210616T160520"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T16:05:23.924Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210617T160525"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210617T160525"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T16:05:28.124Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210618T160529"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210618T160529"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-18T16:05:32.273Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210619T160533"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210619T160533"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T16:05:36.860Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210620T160538"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210620T160538"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T16:05:41.920Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210621T160543"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210621T160543"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T16:05:48.852Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210622T160803"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210622T160803"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T16:08:06.312Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210622T210807"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210622T210807"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T21:08:10.505Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210623T212413"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210623T212413"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T21:24:16.940Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210624T061328"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210624T061328"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:13:31.496Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go index 7df20dd86881..dd2506d11ff0 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go @@ -46,7 +46,7 @@ func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.Tok // Execute - Check the availability of name for server // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - nameAvailabilityRequest - The required parameters for checking if server name is available. // - options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute @@ -89,7 +89,7 @@ func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client_example_test.go deleted file mode 100644 index 26dadc389e14..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, "SouthEastAsia", armmysqlflexibleservers.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - }, 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 = armmysqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go index 8eb8282b7f0d..ace1806bbb70 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go @@ -46,7 +46,7 @@ func NewCheckNameAvailabilityWithoutLocationClient(subscriptionID string, creden // Execute - Check the availability of name for server // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - nameAvailabilityRequest - The required parameters for checking if server name is available. // - options - CheckNameAvailabilityWithoutLocationClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityWithoutLocationClient.Execute // method. @@ -84,7 +84,7 @@ func (client *CheckNameAvailabilityWithoutLocationClient) executeCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client_example_test.go deleted file mode 100644 index a7aba0169d4a..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityWithoutLocationClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityWithoutLocationClient().Execute(ctx, armmysqlflexibleservers.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - }, 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 = armmysqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go index bc7d74cfaa34..615f14de3062 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go @@ -46,7 +46,7 @@ func NewCheckVirtualNetworkSubnetUsageClient(subscriptionID string, credential a // Execute - Get virtual network subnet usage for a given vNet resource id. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - parameters - The required parameters for creating or updating a server. // - options - CheckVirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the CheckVirtualNetworkSubnetUsageClient.Execute @@ -89,7 +89,7 @@ func (client *CheckVirtualNetworkSubnetUsageClient) executeCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go deleted file mode 100644 index 33abe4a90706..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go +++ /dev/null @@ -1,54 +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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/CheckVirtualNetworkSubnetUsage.json -func ExampleCheckVirtualNetworkSubnetUsageClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckVirtualNetworkSubnetUsageClient().Execute(ctx, "WestUS", armmysqlflexibleservers.VirtualNetworkSubnetUsageParameter{ - VirtualNetworkResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), - }, 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.VirtualNetworkSubnetUsageResult = armmysqlflexibleservers.VirtualNetworkSubnetUsageResult{ - // DelegatedSubnetsUsage: []*armmysqlflexibleservers.DelegatedSubnetUsage{ - // { - // SubnetName: to.Ptr("test-subnet-1"), - // Usage: to.Ptr[int64](2), - // }, - // { - // SubnetName: to.Ptr("test-subnet-2"), - // Usage: to.Ptr[int64](3), - // }}, - // Location: to.Ptr("WestUS"), - // SubscriptionID: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go index 9d43e21825c9..346da80ee932 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go @@ -47,7 +47,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // BeginBatchUpdate - Update a list of configurations in a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The parameters for updating a list of server configuration. @@ -74,7 +74,7 @@ func (client *ConfigurationsClient) BeginBatchUpdate(ctx context.Context, resour // BatchUpdate - Update a list of configurations in a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *ConfigurationsClient) batchUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ConfigurationListForBatchUpdate, options *ConfigurationsClientBeginBatchUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginBatchUpdate" @@ -116,7 +116,7 @@ func (client *ConfigurationsClient) batchUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,7 @@ func (client *ConfigurationsClient) batchUpdateCreateRequest(ctx context.Context // BeginCreateOrUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - configurationName - The name of the server configuration. @@ -155,7 +155,7 @@ func (client *ConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *ConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginCreateOrUpdate" @@ -201,7 +201,7 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -213,7 +213,7 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont // Get - Gets information about a configuration of server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - configurationName - The name of the server configuration. @@ -264,7 +264,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // NewListByServerPager - List all the configurations in a given server. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager @@ -329,7 +329,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") if options != nil && options.Keyword != nil { reqQP.Set("keyword", *options.Keyword) } @@ -359,7 +359,7 @@ func (client *ConfigurationsClient) listByServerHandleResponse(resp *http.Respon // BeginUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - configurationName - The name of the server configuration. @@ -386,7 +386,7 @@ func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginUpdate" @@ -432,7 +432,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go deleted file mode 100644 index e969b1227983..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go +++ /dev/null @@ -1,376 +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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "event_scheduler", armmysqlflexibleservers.Configuration{ - Properties: &armmysqlflexibleservers.ConfigurationProperties{ - Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - 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 = armmysqlflexibleservers.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: &armmysqlflexibleservers.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(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("ON"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationUpdate.json -func ExampleConfigurationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "testrg", "testserver", "event_scheduler", armmysqlflexibleservers.Configuration{ - Properties: &armmysqlflexibleservers.ConfigurationProperties{ - Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - Value: to.Ptr("on"), - }, - }, 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 = armmysqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("ON"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/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 := armmysqlflexibleservers.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 = armmysqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsBatchUpdate.json -func ExampleConfigurationsClient_BeginBatchUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginBatchUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ConfigurationListForBatchUpdate{ - ResetAllToDefault: to.Ptr(armmysqlflexibleservers.ResetAllToDefaultFalse), - Value: []*armmysqlflexibleservers.ConfigurationForBatchUpdate{ - { - Name: to.Ptr("event_scheduler"), - Properties: &armmysqlflexibleservers.ConfigurationForBatchUpdateProperties{ - Value: to.Ptr("OFF"), - }, - }, - { - Name: to.Ptr("div_precision_increment"), - Properties: &armmysqlflexibleservers.ConfigurationForBatchUpdateProperties{ - Value: to.Ptr("8"), - }, - }}, - }, 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 = armmysqlflexibleservers.ConfigurationListResult{ - // Value: []*armmysqlflexibleservers.Configuration{ - // { - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("ON"), - // }, - // }, - // { - // Name: to.Ptr("div_precision_increment"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/div_precision_increment"), - // Properties: &armmysqlflexibleservers.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"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("8"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsListByServer.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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "mysqltestserver", &armmysqlflexibleservers.ConfigurationsClientListByServerOptions{Tags: nil, - Keyword: nil, - Page: to.Ptr[int32](1), - PageSize: to.Ptr[int32](8), - }) - 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 = armmysqlflexibleservers.ConfigurationListResult{ - // Value: []*armmysqlflexibleservers.Configuration{ - // { - // Name: to.Ptr("archive"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/archive"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Tell the server to enable or disable archive engine."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigFalse), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("audit_log_enabled"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_enabled"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Allow to audit the log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("audit_log_events"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_events"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Select the events to audit logs."), - // AllowedValues: to.Ptr("DDL,DML_SELECT,DML_NONSELECT,DCL,ADMIN,DML,GENERAL,CONNECTION,TABLE_ACCESS"), - // DataType: to.Ptr("Set"), - // DefaultValue: to.Ptr("CONNECTION"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("CONNECTION"), - // }, - // }, - // { - // Name: to.Ptr("audit_log_exclude_users"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_exclude_users"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("The comma-separated user list whose commands will not be in the audit logs."), - // AllowedValues: to.Ptr(""), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("azure_superuser"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("azure_superuser"), - // }, - // }, - // { - // Name: to.Ptr("audit_log_include_users"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_include_users"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("The comma-separated user list whose commands will be in the audit logs. It takes higher priority if the same user name is found in audit_log_exclude_users."), - // AllowedValues: to.Ptr(""), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr(""), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("audit_slow_log_enabled"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_slow_log_enabled"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Allow to audit the slow log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("ON"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("ON"), - // }, - // }, - // { - // Name: to.Ptr("auto_generate_certs"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_generate_certs"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigFalse), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), - // }, - // }, - // { - // Name: to.Ptr("auto_increment_increment"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_increment_increment"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("The auto_increment_increment is intended for use with source-to-source replication, and can be used to control the operation of AUTO_INCREMENT columns."), - // AllowedValues: to.Ptr("1-65535"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go index 3cc4cdb33886..4ec8762b1ff8 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go @@ -10,7 +10,7 @@ package armmysqlflexibleservers const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers" - moduleVersion = "v2.0.0-beta.3" + moduleVersion = "v2.0.0-beta.4" ) type AdministratorName string @@ -433,6 +433,22 @@ func PossibleOperationStatusValues() []OperationStatus { } } +// PatchStrategy - Enum to indicate the patch strategy of a server +type PatchStrategy string + +const ( + PatchStrategyRegular PatchStrategy = "Regular" + PatchStrategyVirtualCanary PatchStrategy = "VirtualCanary" +) + +// PossiblePatchStrategyValues returns the possible values for the PatchStrategy const type. +func PossiblePatchStrategyValues() []PatchStrategy { + return []PatchStrategy{ + PatchStrategyRegular, + PatchStrategyVirtualCanary, + } +} + // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -571,7 +587,7 @@ func PossibleServerStateValues() []ServerState { } } -// ServerVersion - The version of a server. +// ServerVersion - The major version of a server. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7 type ServerVersion string const ( @@ -586,3 +602,19 @@ func PossibleServerVersionValues() []ServerVersion { ServerVersionFive7, } } + +// StorageRedundancyEnum - Enum to indicate whether storage sku value is 'ZoneRedundancy' or 'LocalRedundancy' +type StorageRedundancyEnum string + +const ( + StorageRedundancyEnumLocalRedundancy StorageRedundancyEnum = "LocalRedundancy" + StorageRedundancyEnumZoneRedundancy StorageRedundancyEnum = "ZoneRedundancy" +) + +// PossibleStorageRedundancyEnumValues returns the possible values for the StorageRedundancyEnum const type. +func PossibleStorageRedundancyEnumValues() []StorageRedundancyEnum { + return []StorageRedundancyEnum{ + StorageRedundancyEnumLocalRedundancy, + StorageRedundancyEnumZoneRedundancy, + } +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go index 64eefa376bb5..798bc71baf24 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go @@ -46,7 +46,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -73,7 +73,7 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -156,7 +156,7 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginDelete" @@ -202,7 +202,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets information about a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -262,7 +262,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // NewListByServerPager - List all the databases in a given server. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager @@ -327,7 +327,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client_example_test.go deleted file mode 100644 index 8ed61cff4492..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armmysqlflexibleservers.Database{ - Properties: &armmysqlflexibleservers.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 = armmysqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/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 := armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/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 := armmysqlflexibleservers.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 = armmysqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabasesListByServer.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 := armmysqlflexibleservers.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 = armmysqlflexibleservers.DatabaseListResult{ - // Value: []*armmysqlflexibleservers.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db2"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go index 49dbed79ad3e..4c939bcc6e2a 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go @@ -32,6 +32,10 @@ type ServersServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, options *armmysqlflexibleservers.ServersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientDeleteResponse], errResp azfake.ErrorResponder) + // BeginDetachVNet is the fake for method ServersClient.BeginDetachVNet + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginDetachVNet func(ctx context.Context, resourceGroupName string, serverName string, parameters armmysqlflexibleservers.ServerDetachVNetParameter, options *armmysqlflexibleservers.ServersClientBeginDetachVNetOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientDetachVNetResponse], errResp azfake.ErrorResponder) + // BeginFailover is the fake for method ServersClient.BeginFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginFailover func(ctx context.Context, resourceGroupName string, serverName string, options *armmysqlflexibleservers.ServersClientBeginFailoverOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientFailoverResponse], errResp azfake.ErrorResponder) @@ -81,6 +85,7 @@ func NewServersServerTransport(srv *ServersServer) *ServersServerTransport { srv: srv, beginCreate: newTracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientCreateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientDeleteResponse]](), + beginDetachVNet: newTracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientDetachVNetResponse]](), beginFailover: newTracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientFailoverResponse]](), newListPager: newTracker[azfake.PagerResponder[armmysqlflexibleservers.ServersClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmysqlflexibleservers.ServersClientListByResourceGroupResponse]](), @@ -98,6 +103,7 @@ type ServersServerTransport struct { srv *ServersServer beginCreate *tracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientCreateResponse]] beginDelete *tracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientDeleteResponse]] + beginDetachVNet *tracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientDetachVNetResponse]] beginFailover *tracker[azfake.PollerResponder[armmysqlflexibleservers.ServersClientFailoverResponse]] newListPager *tracker[azfake.PagerResponder[armmysqlflexibleservers.ServersClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armmysqlflexibleservers.ServersClientListByResourceGroupResponse]] @@ -124,6 +130,8 @@ func (s *ServersServerTransport) Do(req *http.Request) (*http.Response, error) { resp, err = s.dispatchBeginCreate(req) case "ServersClient.BeginDelete": resp, err = s.dispatchBeginDelete(req) + case "ServersClient.BeginDetachVNet": + resp, err = s.dispatchBeginDetachVNet(req) case "ServersClient.BeginFailover": resp, err = s.dispatchBeginFailover(req) case "ServersClient.Get": @@ -247,6 +255,54 @@ func (s *ServersServerTransport) dispatchBeginDelete(req *http.Request) (*http.R return resp, nil } +func (s *ServersServerTransport) dispatchBeginDetachVNet(req *http.Request) (*http.Response, error) { + if s.srv.BeginDetachVNet == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDetachVNet not implemented")} + } + beginDetachVNet := s.beginDetachVNet.get(req) + if beginDetachVNet == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/detachVNet` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ServerDetachVNetParameter](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDetachVNet(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDetachVNet = &respr + s.beginDetachVNet.add(req, beginDetachVNet) + } + + resp, err := server.PollerResponderNext(beginDetachVNet, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginDetachVNet.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDetachVNet) { + s.beginDetachVNet.remove(req) + } + + return resp, nil +} + func (s *ServersServerTransport) dispatchBeginFailover(req *http.Request) (*http.Response, error) { if s.srv.BeginFailover == nil { return nil, &nonRetriableError{errors.New("fake for method BeginFailover not implemented")} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go index d5f31c32a071..196480a7c049 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go @@ -46,7 +46,7 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - firewallRuleName - The name of the server firewall rule. @@ -73,7 +73,7 @@ func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallRulesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - firewallRuleName - The name of the server firewall rule. @@ -157,7 +157,7 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallRulesClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets information about a server firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - firewallRuleName - The name of the server firewall rule. @@ -263,7 +263,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListByServerPager - List all the firewall rules in a given server. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager @@ -328,7 +328,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client_example_test.go deleted file mode 100644 index 935149ce1aa1..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armmysqlflexibleservers.FirewallRule{ - Properties: &armmysqlflexibleservers.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 = armmysqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/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 := armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/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 := armmysqlflexibleservers.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 = armmysqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRulesListByServer.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 := armmysqlflexibleservers.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 = armmysqlflexibleservers.FirewallRuleListResult{ - // Value: []*armmysqlflexibleservers.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule2"), - // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go index c53c3ade0450..1f41bb375095 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go @@ -40,7 +40,7 @@ func NewGetPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options // Execute - Get private DNS zone suffix in the cloud. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - options - GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute // method. func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (GetPrivateDNSZoneSuffixClientExecuteResponse, error) { @@ -73,7 +73,7 @@ func (client *GetPrivateDNSZoneSuffixClient) executeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go deleted file mode 100644 index 0fb93acff1ad..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go +++ /dev/null @@ -1,41 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/GetPrivateDnsZoneSuffix.json -func ExampleGetPrivateDNSZoneSuffixClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGetPrivateDNSZoneSuffixClient().Execute(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.GetPrivateDNSZoneSuffixResponse = armmysqlflexibleservers.GetPrivateDNSZoneSuffixResponse{ - // PrivateDNSZoneSuffix: to.Ptr("suffix-example"), - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod index b6563a23fd91..a0b68cf71707 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexi go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go index d6f34d15aba1..47fb360ccd77 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go @@ -45,7 +45,7 @@ func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore // NewListPager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - options - LocationBasedCapabilitiesClientListOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewListPager // method. @@ -88,7 +88,7 @@ func (client *LocationBasedCapabilitiesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go deleted file mode 100644 index e68b53ba4904..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go +++ /dev/null @@ -1,1138 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/CapabilitiesByLocationList.json -func ExampleLocationBasedCapabilitiesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedCapabilitiesClient().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.CapabilitiesListResult = armmysqlflexibleservers.CapabilitiesListResult{ - // Value: []*armmysqlflexibleservers.CapabilityProperties{ - // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("none"), - // }, - // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("1"), - // }, - // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("2"), - // }, - // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("3"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go index 7dac4c918799..08126cb73e46 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go @@ -46,7 +46,7 @@ func NewLocationBasedCapabilitySetClient(subscriptionID string, credential azcor // Get - Get capabilities at specified location in a given subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - capabilitySetName - Name of capability set // - options - LocationBasedCapabilitySetClientGetOptions contains the optional parameters for the LocationBasedCapabilitySetClient.Get @@ -93,7 +93,7 @@ func (client *LocationBasedCapabilitySetClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *LocationBasedCapabilitySetClient) getHandleResponse(resp *http.Res // NewListPager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - options - LocationBasedCapabilitySetClientListOptions contains the optional parameters for the LocationBasedCapabilitySetClient.NewListPager // method. @@ -153,7 +153,7 @@ func (client *LocationBasedCapabilitySetClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go deleted file mode 100644 index 3ab2a63aeebd..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go +++ /dev/null @@ -1,1998 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/CapabilitySetListByLocation.json -func ExampleLocationBasedCapabilitySetClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedCapabilitySetClient().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.CapabilitySetsList = armmysqlflexibleservers.CapabilitySetsList{ - // Value: []*armmysqlflexibleservers.Capability{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DBforMySQL/capacitysets"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/WestUS/capabilitySets/default"), - // Properties: &armmysqlflexibleservers.CapabilityPropertiesV2{ - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapabilityV2{ - // { - // Name: to.Ptr("Burstable"), - // DefaultSKU: to.Ptr("Standard_B1s"), - // DefaultStorageSize: to.Ptr[int32](20480), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1700), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](2400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3100), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_B12ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](12), - // }, - // { - // Name: to.Ptr("Standard_B16ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](4300), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_B20ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](20), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKU: to.Ptr("Standard_D2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](65536), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_D2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKU: to.Ptr("Standard_E2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](131072), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E80ids_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](72000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](6451), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](80), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // to.Ptr("southcentralus")}, - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapabilityV2{ - // { - // Name: to.Ptr("5.7"), - // }, - // { - // Name: to.Ptr("8.0.21"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/CapabilitySetByLocation.json -func ExampleLocationBasedCapabilitySetClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationBasedCapabilitySetClient().Get(ctx, "WestUS", "default", 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.Capability = armmysqlflexibleservers.Capability{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DBforMySQL/capabilities"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/WestUS/capabilitySets/default"), - // Properties: &armmysqlflexibleservers.CapabilityPropertiesV2{ - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapabilityV2{ - // { - // Name: to.Ptr("Burstable"), - // DefaultSKU: to.Ptr("Standard_B1s"), - // DefaultStorageSize: to.Ptr[int32](20480), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1700), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](2400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3100), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_B12ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](12), - // }, - // { - // Name: to.Ptr("Standard_B16ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](4300), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_B20ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](20), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKU: to.Ptr("Standard_D2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](65536), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_D2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKU: to.Ptr("Standard_E2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](131072), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E80ids_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](72000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](6451), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](80), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // to.Ptr("southcentralus")}, - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapabilityV2{ - // { - // Name: to.Ptr("5.7"), - // }, - // { - // Name: to.Ptr("8.0.21"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go index ef1b23618290..74caec33a62a 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go @@ -45,7 +45,7 @@ func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the server log files in a given server. // -// Generated from API version 2023-06-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager @@ -93,7 +93,7 @@ func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-06-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client_example_test.go deleted file mode 100644 index 15fede58572e..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2023-06-01-preview/examples/LogFilesListByServer.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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLogFilesClient().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.LogFileListResult = armmysqlflexibleservers.LogFileListResult{ - // Value: []*armmysqlflexibleservers.LogFile{ - // { - // Name: to.Ptr("mysql-slow-mysqltestsvc1-2018022823.log"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc1/logFiles/mysql-slow-mysqltestsvc1-2018022823.log"), - // Properties: &armmysqlflexibleservers.LogFileProperties{ - // Type: to.Ptr("slowlog"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20.000Z"); 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=XXXXXXX&se=X&sp=r"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go index 158d82336127..c042f33308be 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go @@ -46,7 +46,7 @@ func NewLongRunningBackupClient(subscriptionID string, credential azcore.TokenCr // BeginCreate - Create backup for a given server with specified backup name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -73,7 +73,7 @@ func (client *LongRunningBackupClient) BeginCreate(ctx context.Context, resource // Create - Create backup for a given server with specified backup name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 func (client *LongRunningBackupClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LongRunningBackupClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "LongRunningBackupClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *LongRunningBackupClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go deleted file mode 100644 index 7759a45dcd47..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go +++ /dev/null @@ -1,53 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/LongRunningBackup.json -func ExampleLongRunningBackupClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongRunningBackupClient().BeginCreate(ctx, "TestGroup", "mysqltestserver", "testback", &armmysqlflexibleservers.LongRunningBackupClientBeginCreateOptions{Parameters: 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.ServerBackupV2 = armmysqlflexibleservers.ServerBackupV2{ - // Name: to.Ptr("customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ - // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-07T07:38:01.149Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningStateSucceeded), - // Source: to.Ptr("Automatic"), - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go index 05644b8472e0..0220b2272ba3 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go @@ -46,7 +46,7 @@ func NewLongRunningBackupsClient(subscriptionID string, credential azcore.TokenC // Get - Get backup for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -97,7 +97,7 @@ func (client *LongRunningBackupsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *LongRunningBackupsClient) getHandleResponse(resp *http.Response) ( // NewListPager - List all the backups for a given server. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - LongRunningBackupsClientListOptions contains the optional parameters for the LongRunningBackupsClient.NewListPager @@ -162,7 +162,7 @@ func (client *LongRunningBackupsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go deleted file mode 100644 index f878f3f323e9..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go +++ /dev/null @@ -1,88 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/LongRunningBackupGet.json -func ExampleLongRunningBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLongRunningBackupsClient().Get(ctx, "TestGroup", "mysqltestserver", "daily_20210615T160516", 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.ServerBackupV2 = armmysqlflexibleservers.ServerBackupV2{ - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupsV2"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ - // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningStateSucceeded), - // Source: to.Ptr("Automatic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/LongRunningBackupsListByServer.json -func ExampleLongRunningBackupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongRunningBackupsClient().NewListPager("TestGroup", "mysqltestserver", 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.ServerBackupV2ListResult = armmysqlflexibleservers.ServerBackupV2ListResult{ - // Value: []*armmysqlflexibleservers.ServerBackupV2{ - // { - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupsV2"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ - // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningStateSucceeded), - // Source: to.Ptr("Automatic"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go index c4c64ea2ba3e..a8f4c55228ef 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go @@ -45,7 +45,7 @@ func NewMaintenancesClient(subscriptionID string, credential azcore.TokenCredent // NewListPager - List maintenances. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - MaintenancesClientListOptions contains the optional parameters for the MaintenancesClient.NewListPager method. @@ -92,7 +92,7 @@ func (client *MaintenancesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *MaintenancesClient) listHandleResponse(resp *http.Response) (Maint // Read - Read maintenance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - maintenanceName - The name of the maintenance. @@ -161,7 +161,7 @@ func (client *MaintenancesClient) readCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +179,7 @@ func (client *MaintenancesClient) readHandleResponse(resp *http.Response) (Maint // BeginUpdate - Update maintenances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - maintenanceName - The name of the maintenance. @@ -205,7 +205,7 @@ func (client *MaintenancesClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Update maintenances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2023-12-30 func (client *MaintenancesClient) update(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, options *MaintenancesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "MaintenancesClient.BeginUpdate" @@ -251,7 +251,7 @@ func (client *MaintenancesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2023-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go deleted file mode 100644 index fbbbf03ea8e1..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go +++ /dev/null @@ -1,158 +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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/MaintenanceRead.json -func ExampleMaintenancesClient_Read() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMaintenancesClient().Read(ctx, "TestGroup", "testserver", "_T9Q-TS8", 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.Maintenance = armmysqlflexibleservers.Maintenance{ - // Name: to.Ptr("_T9Q-TS8"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T16:00:00.000Z"); return t}()), - // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-04T17:23:45.000Z"); return t}()), - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Mon, 15 Jan 2024 05:00:00 GMT and Mon, 15 Jan 2024 06:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-14T22:00:00.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-14T21:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateScheduled), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Scheduled on Mon, 15 Jan 2024 05:00:00 GMT - Mon, 15 Jan 2024 06:00:00 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/MaintenanceUpdate.json -func ExampleMaintenancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMaintenancesClient().BeginUpdate(ctx, "TestGroup", "testserver", "_T9Q-TS8", &armmysqlflexibleservers.MaintenancesClientBeginUpdateOptions{Parameters: &armmysqlflexibleservers.MaintenanceUpdate{ - Properties: &armmysqlflexibleservers.MaintenancePropertiesForUpdate{ - MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-19T16:00:00.000Z"); return t }()), - }, - }, - }) - 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.Maintenance = armmysqlflexibleservers.Maintenance{ - // Name: to.Ptr("_T9Q-TS8"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T16:00:00.000Z"); return t}()), - // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-04T17:23:45.000Z"); return t}()), - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Sat, 20 Jan 2024 00:00:00 GMT and Sat, 20 Jan 2024 01:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-19T17:00:00.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-19T16:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateReScheduled), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Rescheduled to Sat, 20 Jan 2024 00:00:00 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/MaintenancesListByServer.json -func ExampleMaintenancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMaintenancesClient().NewListPager("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.MaintenanceListResult = armmysqlflexibleservers.MaintenanceListResult{ - // Value: []*armmysqlflexibleservers.Maintenance{ - // { - // Name: to.Ptr("YL4X-3CG"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/YL4X-3CG"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance has been successfully completed and your instance is running on the upgraded version. If you have any additional questions or concerns, please contact support."), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-10T21:00:00.000Z"); return t}()), - // MaintenanceExecutionEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-10T20:22:38.000Z"); return t}()), - // MaintenanceExecutionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-10T20:03:21.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-10T20:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateCompleted), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Completed on Mon, 11 Dec 2023 04:22:38 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), - // }, - // }, - // { - // Name: to.Ptr("_T9Q-TS8"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T16:00:00.000Z"); return t}()), - // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-04T17:23:45.000Z"); return t}()), - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Mon, 15 Jan 2024 05:00:00 GMT and Mon, 15 Jan 2024 06:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-14T22:00:00.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-14T21:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateScheduled), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Scheduled on Mon, 15 Jan 2024 05:00:00 GMT - Mon, 15 Jan 2024 06:00:00 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go index b2706d828404..debc8c7d205c 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go @@ -267,6 +267,9 @@ type CapabilityProperties struct { // CapabilityPropertiesV2 - Location capability. type CapabilityPropertiesV2 struct { + // READ-ONLY; A list of supported features. + SupportedFeatures []*FeatureProperty + // READ-ONLY; A list of supported flexible server editions. SupportedFlexibleServerEditions []*ServerEditionCapabilityV2 @@ -473,6 +476,15 @@ type ErrorResponse struct { Error *ErrorDetail } +// FeatureProperty - Server version capabilities. +type FeatureProperty struct { + // READ-ONLY; feature name + FeatureName *string + + // READ-ONLY; feature value + FeatureValue *string +} + // FirewallRule - Represents a server firewall rule. type FirewallRule struct { // REQUIRED; The properties of a firewall rule. @@ -658,6 +670,12 @@ type MaintenanceListResult struct { Value []*Maintenance } +// MaintenancePolicy - Maintenance policy of a server. +type MaintenancePolicy struct { + // The patch strategy of this server + PatchStrategy *PatchStrategy +} + // MaintenanceProperties - The properties of a maintenance resource. type MaintenanceProperties struct { // The start time for a maintenance. @@ -1179,6 +1197,12 @@ type ServerBackupV2ListResult struct { Value []*ServerBackupV2 } +// ServerDetachVNetParameter - Parameters to detach Vnet. +type ServerDetachVNetParameter struct { + // Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet integration. + PublicNetworkAccess *EnableStatusEnum +} + // ServerEditionCapability - Server edition capabilities. type ServerEditionCapability struct { // READ-ONLY; Server edition name @@ -1224,7 +1248,7 @@ type ServerForUpdate struct { Tags map[string]*string } -// ServerGtidSetParameter - Server Gtid set parameters. +// ServerGtidSetParameter - Server Gtid set parameters: Replication with Global Transaction Identifiers. type ServerGtidSetParameter struct { // The Gtid set of server. GtidSet *string @@ -1260,13 +1284,23 @@ type ServerProperties struct { // The Data Encryption for CMK. DataEncryption *DataEncryption + // The server database port. Can only be specified when the server is being created. + DatabasePort *int32 + + // Major version and actual engine version + FullVersion *string + // High availability related properties of a server. HighAvailability *HighAvailability // Source properties for import from storage. ImportSourceProperties *ImportSourceProperties - // Maintenance window of a server. + // Maintenance policy of a server. + MaintenancePolicy *MaintenancePolicy + + // Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during + // server update; must be updated separately. MaintenanceWindow *MaintenanceWindow // Network related properties of a server. @@ -1284,7 +1318,7 @@ type ServerProperties struct { // Storage related properties of a server. Storage *Storage - // Server version. + // Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7 Version *ServerVersion // READ-ONLY; The fully qualified domain name of a server. @@ -1314,6 +1348,9 @@ type ServerPropertiesForUpdate struct { // High availability related properties of a server. HighAvailability *HighAvailability + // Maintenance policy of a server. + MaintenancePolicy *MaintenancePolicy + // Maintenance window of a server. MaintenanceWindow *MaintenanceWindow @@ -1368,6 +1405,9 @@ type Storage struct { // Enable Log On Disk or not. LogOnDisk *EnableStatusEnum + // The redundant type of the server storage. The parameter is used for server creation. + StorageRedundancy *StorageRedundancyEnum + // Max storage size allowed for a server. StorageSizeGB *int32 diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go index f0258281255d..848437df3806 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go @@ -703,6 +703,7 @@ func (c *CapabilityProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CapabilityPropertiesV2. func (c CapabilityPropertiesV2) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "supportedFeatures", c.SupportedFeatures) populate(objectMap, "supportedFlexibleServerEditions", c.SupportedFlexibleServerEditions) populate(objectMap, "supportedGeoBackupRegions", c.SupportedGeoBackupRegions) populate(objectMap, "supportedServerVersions", c.SupportedServerVersions) @@ -718,6 +719,9 @@ func (c *CapabilityPropertiesV2) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &c.SupportedFeatures) + delete(rawMsg, key) case "supportedFlexibleServerEditions": err = unpopulate(val, "SupportedFlexibleServerEditions", &c.SupportedFlexibleServerEditions) delete(rawMsg, key) @@ -1280,6 +1284,37 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FeatureProperty. +func (f FeatureProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "featureName", f.FeatureName) + populate(objectMap, "featureValue", f.FeatureValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureProperty. +func (f *FeatureProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "featureName": + err = unpopulate(val, "FeatureName", &f.FeatureName) + delete(rawMsg, key) + case "featureValue": + err = unpopulate(val, "FeatureValue", &f.FeatureValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FirewallRule. func (f FirewallRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1774,6 +1809,33 @@ func (m *MaintenanceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MaintenancePolicy. +func (m MaintenancePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "patchStrategy", m.PatchStrategy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenancePolicy. +func (m *MaintenancePolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "patchStrategy": + err = unpopulate(val, "PatchStrategy", &m.PatchStrategy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MaintenanceProperties. func (m MaintenanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3089,6 +3151,33 @@ func (s *ServerBackupV2ListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServerDetachVNetParameter. +func (s ServerDetachVNetParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDetachVNetParameter. +func (s *ServerDetachVNetParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ServerEditionCapability. func (s ServerEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3273,9 +3362,12 @@ func (s ServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "backup", s.Backup) populate(objectMap, "createMode", s.CreateMode) populate(objectMap, "dataEncryption", s.DataEncryption) + populate(objectMap, "databasePort", s.DatabasePort) + populate(objectMap, "fullVersion", s.FullVersion) populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) populate(objectMap, "highAvailability", s.HighAvailability) populate(objectMap, "importSourceProperties", s.ImportSourceProperties) + populate(objectMap, "maintenancePolicy", s.MaintenancePolicy) populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) populate(objectMap, "network", s.Network) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) @@ -3316,6 +3408,12 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "dataEncryption": err = unpopulate(val, "DataEncryption", &s.DataEncryption) delete(rawMsg, key) + case "databasePort": + err = unpopulate(val, "DatabasePort", &s.DatabasePort) + delete(rawMsg, key) + case "fullVersion": + err = unpopulate(val, "FullVersion", &s.FullVersion) + delete(rawMsg, key) case "fullyQualifiedDomainName": err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) delete(rawMsg, key) @@ -3325,6 +3423,9 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "importSourceProperties": err = unpopulate(val, "ImportSourceProperties", &s.ImportSourceProperties) delete(rawMsg, key) + case "maintenancePolicy": + err = unpopulate(val, "MaintenancePolicy", &s.MaintenancePolicy) + delete(rawMsg, key) case "maintenanceWindow": err = unpopulate(val, "MaintenanceWindow", &s.MaintenanceWindow) delete(rawMsg, key) @@ -3370,6 +3471,7 @@ func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error) { populate(objectMap, "backup", s.Backup) populate(objectMap, "dataEncryption", s.DataEncryption) populate(objectMap, "highAvailability", s.HighAvailability) + populate(objectMap, "maintenancePolicy", s.MaintenancePolicy) populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) populate(objectMap, "network", s.Network) populate(objectMap, "replicationRole", s.ReplicationRole) @@ -3399,6 +3501,9 @@ func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { case "highAvailability": err = unpopulate(val, "HighAvailability", &s.HighAvailability) delete(rawMsg, key) + case "maintenancePolicy": + err = unpopulate(val, "MaintenancePolicy", &s.MaintenancePolicy) + delete(rawMsg, key) case "maintenanceWindow": err = unpopulate(val, "MaintenanceWindow", &s.MaintenanceWindow) delete(rawMsg, key) @@ -3518,6 +3623,7 @@ func (s Storage) MarshalJSON() ([]byte, error) { populate(objectMap, "autoIoScaling", s.AutoIoScaling) populate(objectMap, "iops", s.Iops) populate(objectMap, "logOnDisk", s.LogOnDisk) + populate(objectMap, "storageRedundancy", s.StorageRedundancy) populate(objectMap, "storageSku", s.StorageSKU) populate(objectMap, "storageSizeGB", s.StorageSizeGB) return json.Marshal(objectMap) @@ -3544,6 +3650,9 @@ func (s *Storage) UnmarshalJSON(data []byte) error { case "logOnDisk": err = unpopulate(val, "LogOnDisk", &s.LogOnDisk) delete(rawMsg, key) + case "storageRedundancy": + err = unpopulate(val, "StorageRedundancy", &s.StorageRedundancy) + delete(rawMsg, key) case "storageSku": err = unpopulate(val, "StorageSKU", &s.StorageSKU) delete(rawMsg, key) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go index 4e02c2d179da..af9f12ebcf3f 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go @@ -46,7 +46,7 @@ func NewOperationProgressClient(subscriptionID string, credential azcore.TokenCr // Get - Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - operationID - The ID of an ongoing async operation. // - options - OperationProgressClientGetOptions contains the optional parameters for the OperationProgressClient.Get method. @@ -92,7 +92,7 @@ func (client *OperationProgressClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go deleted file mode 100644 index 56c897ae4e22..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go +++ /dev/null @@ -1,82 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/OperationProgress_Get_BackupAndExport.json -func ExampleOperationProgressClient_Get_operationProgressGetBackupAndExport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationProgressClient().Get(ctx, "westus", "00000000-0000-0000-0000-000000000000", 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.OperationProgressResult = armmysqlflexibleservers.OperationProgressResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationProgress/00000000-0000-0000-0000-000000000000"), - // PercentComplete: to.Ptr[float32](10), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Properties: &armmysqlflexibleservers.BackupAndExportResponseType{ - // ObjectType: to.Ptr(armmysqlflexibleservers.ObjectTypeBackupAndExportResponse), - // BackupMetadata: to.Ptr("{\"key1\":\"value1\",\"key2\":\"value2\"}"), - // DataTransferredInBytes: to.Ptr[int64](102), - // DatasourceSizeInBytes: to.Ptr[int64](1024), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/OperationProgress_Get_ImportFromStorage.json -func ExampleOperationProgressClient_Get_operationProgressGetImportFromStorage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationProgressClient().Get(ctx, "westus", "00000000-0000-0000-0000-000000000000", 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.OperationProgressResult = armmysqlflexibleservers.OperationProgressResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationProgress/00000000-0000-0000-0000-000000000000"), - // PercentComplete: to.Ptr[float32](10), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Properties: &armmysqlflexibleservers.ImportFromStorageResponseType{ - // ObjectType: to.Ptr(armmysqlflexibleservers.ObjectTypeImportFromStorageResponse), - // EstimatedCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T08:34:02.328Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go index bba7bb947e5e..ff7f789a39c2 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go @@ -46,7 +46,7 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre // Get - Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - locationName - The name of the location. // - operationID - The operation Id. // - options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. @@ -92,7 +92,7 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go deleted file mode 100644 index 769024e638a4..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go +++ /dev/null @@ -1,55 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/OperationResults_Get.json -func ExampleOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationResultsClient().Get(ctx, "westus", "00000000-0000-0000-0000-000000000000", 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.OperationStatusExtendedResult = armmysqlflexibleservers.OperationStatusExtendedResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:37:05.640Z"); return t}()), - // Error: &armmysqlflexibleservers.ErrorDetail{ - // Code: to.Ptr("AggregateException"), - // Message: to.Ptr("System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"), - // }, - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationResults/00000000-0000-0000-0000-000000000000"), - // PercentComplete: to.Ptr[float32](0), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr("Failed"), - // Properties: map[string]any{ - // "backupMetadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}", - // "dataTransferredInBytes": float64(0), - // "datasourceSizeInBytes": float64(1024), - // }, - // } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go index 2887cc73d669..9de7519a03dc 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go deleted file mode 100644 index 0a95e73f55d1..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go +++ /dev/null @@ -1,223 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().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.OperationListResult = armmysqlflexibleservers.OperationListResult{ - // Value: []*armmysqlflexibleservers.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/read"), - // Display: &armmysqlflexibleservers.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/flexibleServers/firewallRules/write"), - // Display: &armmysqlflexibleservers.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/flexibleServers/firewallRules/delete"), - // Display: &armmysqlflexibleservers.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/flexibleServers/read"), - // Display: &armmysqlflexibleservers.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/flexibleServers/write"), - // Display: &armmysqlflexibleservers.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/flexibleServers/delete"), - // Display: &armmysqlflexibleservers.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/flexibleServers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armmysqlflexibleservers.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/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armmysqlflexibleservers.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/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armmysqlflexibleservers.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/armmysqlflexibleservers/options.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go index 03b98168f58b..ee16b28d4c7f 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go @@ -292,6 +292,12 @@ type ServersClientBeginDeleteOptions struct { ResumeToken string } +// ServersClientBeginDetachVNetOptions contains the optional parameters for the ServersClient.BeginDetachVNet method. +type ServersClientBeginDetachVNetOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServersClientBeginFailoverOptions contains the optional parameters for the ServersClient.BeginFailover method. type ServersClientBeginFailoverOptions struct { // Resumes the LRO from the provided token. diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go index a27db9cbd18c..f91c71229f13 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go @@ -45,7 +45,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the replicas for a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager @@ -93,7 +93,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go deleted file mode 100644 index a80aa3ec56be..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go +++ /dev/null @@ -1,128 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup", "mysqltestserver", 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 = armmysqlflexibleservers.ServerListResult{ - // Value: []*armmysqlflexibleservers.Server{ - // { - // Name: to.Ptr("mysqltestserver-repl"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver-repl"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.000Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver-repl.orcabrci-seas1-a.mscds.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver-repl"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver-repl2"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T08:19:18.000Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver-repl2.orcabrci-seas1-a.mscds.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go index e8eb98c72354..44004a72f442 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go @@ -280,6 +280,12 @@ type ServersClientDeleteResponse struct { // placeholder for future response values } +// ServersClientDetachVNetResponse contains the response from method ServersClient.BeginDetachVNet. +type ServersClientDetachVNetResponse struct { + // Represents a server. + Server +} + // ServersClientFailoverResponse contains the response from method ServersClient.BeginFailover. type ServersClientFailoverResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go index 32a59fe753af..924246e0a48e 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go @@ -46,7 +46,7 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new server or updates an existing server. The update action will overwrite the existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for creating or updating a server. @@ -71,7 +71,7 @@ func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new server or updates an existing server. The update action will overwrite the existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginCreate" @@ -113,7 +113,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. @@ -150,7 +150,7 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDelete" @@ -192,16 +192,96 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginDetachVNet - Detach VNet on a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-10-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - parameters - The required parameters for detach vnet on a server. +// - options - ServersClientBeginDetachVNetOptions contains the optional parameters for the ServersClient.BeginDetachVNet method. +func (client *ServersClient) BeginDetachVNet(ctx context.Context, resourceGroupName string, serverName string, parameters ServerDetachVNetParameter, options *ServersClientBeginDetachVNetOptions) (*runtime.Poller[ServersClientDetachVNetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.detachVNet(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientDetachVNetResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServersClientDetachVNetResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DetachVNet - Detach VNet on a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-10-01-preview +func (client *ServersClient) detachVNet(ctx context.Context, resourceGroupName string, serverName string, parameters ServerDetachVNetParameter, options *ServersClientBeginDetachVNetOptions) (*http.Response, error) { + var err error + const operationName = "ServersClient.BeginDetachVNet" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.detachVNetCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// detachVNetCreateRequest creates the DetachVNet request. +func (client *ServersClient) detachVNetCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerDetachVNetParameter, options *ServersClientBeginDetachVNetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/detachVNet" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-10-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // BeginFailover - Manual failover a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginFailoverOptions contains the optional parameters for the ServersClient.BeginFailover method. @@ -225,7 +305,7 @@ func (client *ServersClient) BeginFailover(ctx context.Context, resourceGroupNam // Failover - Manual failover a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) failover(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginFailoverOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginFailover" @@ -267,7 +347,7 @@ func (client *ServersClient) failoverCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +356,7 @@ func (client *ServersClient) failoverCreateRequest(ctx context.Context, resource // Get - Gets information about a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. @@ -322,7 +402,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +419,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // NewListPager - List all the servers in a given subscription. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServersClientListResponse]{ @@ -376,7 +456,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +473,7 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli // NewListByResourceGroupPager - List all the servers in a given resource group. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager // method. @@ -436,7 +516,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,7 +534,7 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon // BeginResetGtid - Resets GTID on a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for resetting GTID on a server. @@ -480,7 +560,7 @@ func (client *ServersClient) BeginResetGtid(ctx context.Context, resourceGroupNa // ResetGtid - Resets GTID on a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) resetGtid(ctx context.Context, resourceGroupName string, serverName string, parameters ServerGtidSetParameter, options *ServersClientBeginResetGtidOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginResetGtid" @@ -522,7 +602,7 @@ func (client *ServersClient) resetGtidCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -534,7 +614,7 @@ func (client *ServersClient) resetGtidCreateRequest(ctx context.Context, resourc // BeginRestart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for restarting a server. @@ -559,7 +639,7 @@ func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName // Restart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) restart(ctx context.Context, resourceGroupName string, serverName string, parameters ServerRestartParameter, options *ServersClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginRestart" @@ -601,7 +681,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -613,7 +693,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG // BeginStart - Starts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method. @@ -637,7 +717,7 @@ func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName s // Start - Starts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) start(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStart" @@ -679,7 +759,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -688,7 +768,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro // BeginStop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method. @@ -712,7 +792,7 @@ func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName st // Stop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStop" @@ -754,7 +834,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -764,7 +844,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou // server definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for updating a server. @@ -790,7 +870,7 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, options *ServersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginUpdate" @@ -832,7 +912,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -844,7 +924,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr // ValidateEstimateHighAvailability - Validate a deployment of high availability. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for validation of high availability deployment. @@ -892,7 +972,7 @@ func (client *ServersClient) validateEstimateHighAvailabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go deleted file mode 100644 index 1a2a9685d80b..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go +++ /dev/null @@ -1,1282 +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 armmysqlflexibleservers_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/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{ - Location: to.Ptr("southeastasia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, - Properties: &armmysqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("your_password"), - AvailabilityZone: to.Ptr("1"), - Backup: &armmysqlflexibleservers.Backup{ - BackupIntervalHours: to.Ptr[int32](24), - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - }, - CreateMode: to.Ptr(armmysqlflexibleservers.CreateModeDefault), - HighAvailability: &armmysqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - StandbyAvailabilityZone: to.Ptr("3"), - }, - Storage: &armmysqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - Iops: to.Ptr[int32](600), - StorageSizeGB: to.Ptr[int32](100), - }, - Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - }, - SKU: &armmysqlflexibleservers.MySQLServerSKU{ - Name: to.Ptr("Standard_D2ds_v4"), - Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - }, - }, 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateReplica.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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testgr", "replica-server", armmysqlflexibleservers.Server{ - Location: to.Ptr("SoutheastAsia"), - Properties: &armmysqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armmysqlflexibleservers.CreateModeReplica), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"), - }, - }, 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("replica-server"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.572Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("replica-server.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithPointInTimeRestore.json -func ExampleServersClient_BeginCreate_createAServerAsAPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysqlflexibleservers.Server{ - Location: to.Ptr("SoutheastAsia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, - Properties: &armmysqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armmysqlflexibleservers.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:00:37.467Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"), - }, - SKU: &armmysqlflexibleservers.MySQLServerSKU{ - Name: to.Ptr("Standard_D14_v2"), - Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - }, - }, 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("adminuser"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:15:24.000Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("targetserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithBYOK.json -func ExampleServersClient_BeginCreate_createAServerWithByok() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{ - Location: to.Ptr("southeastasia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, - Identity: &armmysqlflexibleservers.MySQLServerIdentity{ - Type: to.Ptr(armmysqlflexibleservers.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]any{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": map[string]any{}, - }, - }, - Properties: &armmysqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("your_password"), - AvailabilityZone: to.Ptr("1"), - Backup: &armmysqlflexibleservers.Backup{ - BackupIntervalHours: to.Ptr[int32](24), - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - }, - CreateMode: to.Ptr(armmysqlflexibleservers.CreateModeDefault), - DataEncryption: &armmysqlflexibleservers.DataEncryption{ - Type: to.Ptr(armmysqlflexibleservers.DataEncryptionTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity"), - PrimaryKeyURI: to.Ptr("https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"), - }, - HighAvailability: &armmysqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - StandbyAvailabilityZone: to.Ptr("3"), - }, - Storage: &armmysqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - Iops: to.Ptr[int32](600), - StorageSizeGB: to.Ptr[int32](100), - }, - Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - }, - SKU: &armmysqlflexibleservers.MySQLServerSKU{ - Name: to.Ptr("Standard_D2ds_v4"), - Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - }, - }, 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate_updateAServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - Network: &armmysqlflexibleservers.Network{ - PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - }, - Storage: &armmysqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - Iops: to.Ptr[int32](200), - StorageSizeGB: to.Ptr[int32](30), - }, - }, - }, 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // Iops: to.Ptr[int32](200), - // StorageSizeGB: to.Ptr[int32](30), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerUpdateWithCustomerMaintenanceWindow.json -func ExampleServersClient_BeginUpdate_updateServerCustomerMaintenanceWindow() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - CustomWindow: to.Ptr("Enabled"), - DayOfWeek: to.Ptr[int32](1), - StartHour: to.Ptr[int32](8), - StartMinute: to.Ptr[int32](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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](8), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerUpdateWithBYOK.json -func ExampleServersClient_BeginUpdate_updateServerWithByok() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Identity: &armmysqlflexibleservers.MySQLServerIdentity{ - Type: to.Ptr(armmysqlflexibleservers.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]any{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": map[string]any{}, - }, - }, - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - DataEncryption: &armmysqlflexibleservers.DataEncryption{ - Type: to.Ptr(armmysqlflexibleservers.DataEncryptionTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity"), - PrimaryKeyURI: to.Ptr("https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"), - }, - }, - }, 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/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 := armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerGet.json -func ExampleServersClient_Get_getAServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "mysqltestserver", 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerGetWithVnet.json -func ExampleServersClient_Get_getAServerWithVnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "mysqltestserver", 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/2941a09d-7bcf-42fe-91ca-1765f521c829/resourceGroups/OrcabrCI-Vnet-Resource-Group/providers/Microsoft.Network/virtualNetworks/OrcabrCI-Vnet/subnets/mysql-subnet"), - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServersListByResourceGroup.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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("TestGroup", 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 = armmysqlflexibleservers.ServerListResult{ - // Value: []*armmysqlflexibleservers.Server{ - // { - // Name: to.Ptr("mysqltestserver1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver1"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver1.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_B1ms"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver2"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("2"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver2.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_B1ms"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver3"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver3"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:28:19.061Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver3.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_E2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierMemoryOptimized), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServersList.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 := armmysqlflexibleservers.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 = armmysqlflexibleservers.ServerListResult{ - // Value: []*armmysqlflexibleservers.Server{ - // { - // Name: to.Ptr("mysqltestserver1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver1"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver1.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_B1ms"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup2/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver2"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("2"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver2.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_B1ms"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver3"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup3/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver3"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:28:19.061Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver3.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_E2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierMemoryOptimized), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerFailover.json -func ExampleServersClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginFailover(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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerValidateEstimateHighAvailability.json -func ExampleServersClient_ValidateEstimateHighAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().ValidateEstimateHighAvailability(ctx, "TestGroup", "testserver", armmysqlflexibleservers.HighAvailabilityValidationEstimation{ - ExpectedStandbyAvailabilityZone: to.Ptr("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.HighAvailabilityValidationEstimation = armmysqlflexibleservers.HighAvailabilityValidationEstimation{ - // EstimatedDowntime: to.Ptr[int32](0), - // ExpectedStandbyAvailabilityZone: to.Ptr("1"), - // ScheduledStandbyAvailabilityZone: to.Ptr("1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/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 := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerRestartParameter{ - MaxFailoverSeconds: to.Ptr[int32](60), - RestartWithFailover: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - }, 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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/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 := armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/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 := armmysqlflexibleservers.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/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerResetGtid.json -func ExampleServersClient_BeginResetGtid() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginResetGtid(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerGtidSetParameter{ - GtidSet: to.Ptr("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), - }, 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/armmysqlflexibleservers/serversmigration_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go index 4b3d1a8ae67f..d64cdfa12154 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go @@ -46,7 +46,7 @@ func NewServersMigrationClient(subscriptionID string, credential azcore.TokenCre // BeginCutoverMigration - Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersMigrationClientBeginCutoverMigrationOptions contains the optional parameters for the ServersMigrationClient.BeginCutoverMigration @@ -72,7 +72,7 @@ func (client *ServersMigrationClient) BeginCutoverMigration(ctx context.Context, // CutoverMigration - Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-10-01-preview func (client *ServersMigrationClient) cutoverMigration(ctx context.Context, resourceGroupName string, serverName string, options *ServersMigrationClientBeginCutoverMigrationOptions) (*http.Response, error) { var err error const operationName = "ServersMigrationClient.BeginCutoverMigration" @@ -114,7 +114,7 @@ func (client *ServersMigrationClient) cutoverMigrationCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go deleted file mode 100644 index 289ac009b450..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go +++ /dev/null @@ -1,89 +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 armmysqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/CutoverMigration.json -func ExampleServersMigrationClient_BeginCutoverMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersMigrationClient().BeginCutoverMigration(ctx, "testrg", "mysqltestserver", 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 = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // Iops: to.Ptr[int32](200), - // StorageSizeGB: to.Ptr[int32](30), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -}