diff --git a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md index 377dcb234dd7..dec63a54f8cb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.2.1 (2024-09-26) +### Other Changes + + ## 1.2.0 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/postgresql/armpostgresql/README.md b/sdk/resourcemanager/postgresql/armpostgresql/README.md index fb323f55d590..05871e702ef9 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/README.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/README.md @@ -57,7 +57,7 @@ clientFactory, err := armpostgresql.NewClientFactory(, cred, &o 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.NewServersClient() +client := clientFactory.NewCheckNameAvailabilityClient() ``` ## Fakes diff --git a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md index 188641623a3d..10e6a0d355eb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 +module-version: 1.2.1 package-singleservers: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go deleted file mode 100644 index c68c35f20b31..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresql.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL"), - }, 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 = armpostgresql.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go index 8f7f4d7175a7..475f857a5373 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/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,120 +26,155 @@ 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 } // 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, + } } // 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, + } } // 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, + } } // 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, + } } // 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, + } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go deleted file mode 100644 index 3e46cc0d9482..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go +++ /dev/null @@ -1,1162 +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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "array_nulls", armpostgresql.Configuration{ - Properties: &armpostgresql.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 = armpostgresql.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("off"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestGroup", "testserver", "array_nulls", 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 = armpostgresql.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationsClient().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.ConfigurationListResult = armpostgresql.ConfigurationListResult{ - // Value: []*armpostgresql.Configuration{ - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), - // }, - // }, - // { - // Name: to.Ptr("bytea_output"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/bytea_output"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the output format for bytea."), - // AllowedValues: to.Ptr("escape,hex"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("hex"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("hex"), - // }, - // }, - // { - // Name: to.Ptr("check_function_bodies"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/check_function_bodies"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Check function bodies during CREATE FUNCTION."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("client_encoding"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_encoding"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the client's character set encoding."), - // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("sql_ascii"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("sql_ascii"), - // }, - // }, - // { - // Name: to.Ptr("client_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_min_messages"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are sent to the client."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("notice"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("notice"), - // }, - // }, - // { - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner to use constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("partition"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("partition"), - // }, - // }, - // { - // Name: to.Ptr("cpu_index_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_index_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each index entry during an index scan."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.005"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.005"), - // }, - // }, - // { - // Name: to.Ptr("cpu_operator_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_operator_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function call."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.0025"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0025"), - // }, - // }, - // { - // Name: to.Ptr("cpu_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each tuple (row)."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.01"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.01"), - // }, - // }, - // { - // Name: to.Ptr("cursor_tuple_fraction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cursor_tuple_fraction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("datestyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/datestyle"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for date and time values."), - // AllowedValues: to.Ptr("(iso|postgres|sql|german)\\,\\s(dmy|mdy|ymd)"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("iso, mdy"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("iso, mdy"), - // }, - // }, - // { - // Name: to.Ptr("deadlock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/deadlock_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the amount of time, in milliseconds, to wait on a lock before checking for deadlock."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_parse"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_parse"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_plan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_plan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's execution plan."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_rewritten"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_rewritten"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's rewritten parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_statistics_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_statistics_target"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default statistics target."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("default_text_search_config"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_text_search_config"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets default text search configuration."), - // AllowedValues: to.Ptr("[A-Za-z\\._]+"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("pg_catalog.english"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("pg_catalog.english"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_deferrable"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_deferrable"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default deferrable status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_isolation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_isolation"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the transaction isolation level of each new transaction."), - // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("read committed"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("read committed"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_read_only"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_read_only"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default read-only status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_with_oids"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_with_oids"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Create new tables with OIDs by default."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("enable_bitmapscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_bitmapscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashagg"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashagg"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashjoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashjoin"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hash join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexonlyscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexonlyscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_material"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_material"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of materialization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_mergejoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_mergejoin"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of merge join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_nestloop"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_nestloop"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of nested-loop join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_seqscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_seqscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_sort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_sort"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of explicit sort steps."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_tidscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_tidscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of TID scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("escape_string_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/escape_string_warning"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Warn about backslash escapes in ordinary string literals."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("exit_on_error"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/exit_on_error"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Terminate session on any error."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("extra_float_digits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/extra_float_digits"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), - // AllowedValues: to.Ptr("-15-3"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("from_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/from_collapse_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which subqueries are not collapsed."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("geqo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables genetic query optimization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("geqo_effort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_effort"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), - // AllowedValues: to.Ptr("1-10"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), - // }, - // }, - // { - // Name: to.Ptr("geqo_generations"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_generations"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of iterations of the algorithm."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_pool_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_pool_size"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of individuals in the population."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_seed"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_seed"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: seed for random path selection."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_selection_bias"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_selection_bias"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: selective pressure within the population."), - // AllowedValues: to.Ptr("1.5-2"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("2.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2.0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_threshold"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), - // AllowedValues: to.Ptr("2-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("12"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("12"), - // }, - // }, - // { - // Name: to.Ptr("gin_fuzzy_search_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/gin_fuzzy_search_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("intervalstyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/intervalstyle"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for interval values."), - // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("postgres"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("postgres"), - // }, - // }, - // { - // Name: to.Ptr("join_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/join_collapse_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("lock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/lock_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any wait for a lock. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("log_checkpoints"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_checkpoints"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each checkpoint."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_connections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_connections"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each successful connection."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_disconnections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_disconnections"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs end of a session, including duration."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_duration"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs the duration of each completed SQL statement."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_error_verbosity"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_error_verbosity"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the verbosity of logged messages."), - // AllowedValues: to.Ptr("terse,default,verbose"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("default"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("default"), - // }, - // }, - // { - // Name: to.Ptr("log_lock_waits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_lock_waits"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs long lock waits."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_min_duration_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_duration_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum execution time (in milliseconds) above which statements will be logged. -1 disables logging statement durations."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("log_min_error_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_error_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes all statements generating error at or above this level to be logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("error"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("error"), - // }, - // }, - // { - // Name: to.Ptr("log_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_messages"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("warning"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("warning"), - // }, - // }, - // { - // Name: to.Ptr("log_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the type of statements logged."), - // AllowedValues: to.Ptr("none,ddl,mod,all"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), - // }, - // }, - // { - // Name: to.Ptr("max_locks_per_transaction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_locks_per_transaction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of locks per transaction."), - // AllowedValues: to.Ptr("10-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_transaction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_pred_locks_per_transaction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate locks per transaction."), - // AllowedValues: to.Ptr("10-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("max_prepared_transactions"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_prepared_transactions"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of simultaneously prepared transactions."), - // AllowedValues: to.Ptr("0-8388607"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("quote_all_identifiers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/quote_all_identifiers"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("When generating SQL fragments, quote all identifiers."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("random_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/random_page_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a nonsequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("4.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4.0"), - // }, - // }, - // { - // Name: to.Ptr("search_path"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/search_path"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."), - // AllowedValues: to.Ptr("[A-Za-z.\"$, ]+"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("\"$user\", public"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("\"$user\", public"), - // }, - // }, - // { - // Name: to.Ptr("seq_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/seq_page_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a sequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("1.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1.0"), - // }, - // }, - // { - // Name: to.Ptr("sql_inheritance"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/sql_inheritance"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes subtables to be included by default in various commands."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("standard_conforming_strings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/standard_conforming_strings"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("statement_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/statement_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("synchronize_seqscans"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronize_seqscans"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable synchronized sequential scans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("synchronous_commit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronous_commit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the current transaction's synchronization level."), - // AllowedValues: to.Ptr("local,remote_write,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("transform_null_equals"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/transform_null_equals"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Treats \"expr=NULL\" as \"expr IS NULL\"."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("xmlbinary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmlbinary"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets how binary values are to be encoded in XML."), - // AllowedValues: to.Ptr("base64,hex"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("base64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("base64"), - // }, - // }, - // { - // Name: to.Ptr("xmloption"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmloption"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."), - // AllowedValues: to.Ptr("content,document"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("content"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("content"), - // }, - // }, - // { - // Name: to.Ptr("force_parallel_mode"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/force_parallel_mode"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Forces use of parallel query facilities."), - // AllowedValues: to.Ptr("off,on,regress"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("idle_in_transaction_session_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/idle_in_transaction_session_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers_per_gather"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_parallel_workers_per_gather"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("min_parallel_relation_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/min_parallel_relation_size"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum size of relations to be considered for parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8388608"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8388608"), - // }, - // }, - // { - // Name: to.Ptr("parallel_setup_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_setup_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of starting up worker processes for parallel query."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("parallel_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of passing each tuple (row) from worker to master backend."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("log_retention_days"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_retention_days"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets how many days a log file is saved for."), - // AllowedValues: to.Ptr("1-7"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("3"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("3"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/constants.go b/sdk/resourcemanager/postgresql/armpostgresql/constants.go index 55d1f4071767..8e67c4850857 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/constants.go @@ -10,7 +10,7 @@ package armpostgresql const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" - moduleVersion = "v1.2.0" + moduleVersion = "v1.2.1" ) // CreateMode - The mode to create a new server. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go deleted file mode 100644 index deff297d9722..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armpostgresql.Database{ - Properties: &armpostgresql.DatabaseProperties{ - Charset: to.Ptr("UTF8"), - Collation: to.Ptr("English_United States.1252"), - }, - }, 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 = armpostgresql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.DatabaseListResult{ - // Value: []*armpostgresql.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db2"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/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/postgresql/armpostgresql/firewallrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go deleted file mode 100644 index e11f98ddaf7c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armpostgresql.FirewallRule{ - Properties: &armpostgresql.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 = armpostgresql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.FirewallRuleListResult{ - // Value: []*armpostgresql.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule2"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/go.mod b/sdk/resourcemanager/postgresql/armpostgresql/go.mod index 84848aadafc1..a68715832a3f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresql/go.mod @@ -4,7 +4,6 @@ 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 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go deleted file mode 100644 index ec07a5fe6dfb..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.PerformanceTierListResult{ - // Value: []*armpostgresql.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: []*armpostgresql.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: []*armpostgresql.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: []*armpostgresql.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/postgresql/armpostgresql/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go deleted file mode 100644 index 35a4f1a08df7..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go +++ /dev/null @@ -1,70 +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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.LogFileListResult{ - // Value: []*armpostgresql.LogFile{ - // { - // Name: to.Ptr("postgresql-2017-06-22_010000.log"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/logFiles/postgresql-2017-06-22_010000.log"), - // Properties: &armpostgresql.LogFileProperties{ - // Type: to.Ptr("text"), - // 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, "2017-06-22T01:59:36.000Z"); return t}()), - // SizeInKB: to.Ptr[int64](4), - // URL: to.Ptr("https://wasd2stageneu1btlm4.file.core.windows.net/42679871f6cc4302b39ab9c2e3044df3/pg_log/postgresql-2017-06-22_010000.log?sv=2015-04-05&sr=f&sig=gqIQsa6VyGyUNpzYYPWLP5gM%2BeF1so9GYbHKu6Zs0DM%3D&se=2017-06-22T03%3A21%3A09Z&sp=r"), - // }, - // }, - // { - // Name: to.Ptr("postgresql-2017-06-22_020000.log"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/logFiles/postgresql-2017-06-22_020000.log"), - // Properties: &armpostgresql.LogFileProperties{ - // Type: to.Ptr("text"), - // 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, "2017-06-22T02:19:36.000Z"); return t}()), - // SizeInKB: to.Ptr[int64](1), - // URL: to.Ptr("https://wasd2stageneu1btlm4.file.core.windows.net/42679871f6cc4302b39ab9c2e3044df3/pg_log/postgresql-2017-06-22_020000.log?sv=2015-04-05&sr=f&sig=i99UWBlYfR0tKaxix8yHAOnfym4HV9Auto6BbZogyRs%3D&se=2017-06-22T03%3A21%3A09Z&sp=r"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go index 6e1ff5dca7b8..f85f31c31118 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go @@ -2563,7 +2563,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/postgresql/armpostgresql/operations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go deleted file mode 100644 index ab1081e3bc84..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go +++ /dev/null @@ -1,207 +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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.OperationListResult{ - // Value: []*armpostgresql.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/performanceTiers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get PostgreSQL Servers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/write"), - // Display: &armpostgresql.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 PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/delete"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/performanceTiers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/read"), - // Display: &armpostgresql.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 PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/write"), - // Display: &armpostgresql.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 PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/delete"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armpostgresql.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 PostgreSQL"), - // 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": "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", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armpostgresql.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 PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go b/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go index 3f00b67c170c..b44f05a23bc8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armpostgresql 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/postgresql/armpostgresql/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go deleted file mode 100644 index 68842d2c0caa..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,229 +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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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", armpostgresql.PrivateEndpointConnection{ - Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armpostgresql.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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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", armpostgresql.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - "key3": to.Ptr("val3"), - }, - }, 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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.PrivateEndpointConnectionListResult{ - // Value: []*armpostgresql.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.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.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go deleted file mode 100644 index 8004a48c2c68..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.PrivateLinkResourceListResult{ - // Value: []*armpostgresql.PrivateLinkResource{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.PrivateLinkResource{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go deleted file mode 100644 index 54a7b75c8c90..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableServersClient().Get(ctx, "testrg", "pgtestsvc4", 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 = armpostgresql.RecoverableServerResource{ - // Name: to.Ptr("recoverableServers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/recoverableServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/recoverableServers"), - // Properties: &armpostgresql.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("9.6"), - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go deleted file mode 100644 index a331f36df66a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go +++ /dev/null @@ -1,186 +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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup_WestCentralUS", "testserver-master", 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 = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("testserver-replica1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica2"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica2.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica3"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica3"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica3.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica4"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica4.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica5"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica5"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica5.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/response_types.go b/sdk/resourcemanager/postgresql/armpostgresql/responses.go similarity index 100% rename from sdk/resourcemanager/postgresql/armpostgresql/response_types.go rename to sdk/resourcemanager/postgresql/armpostgresql/responses.go diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go deleted file mode 100644 index 7c219bc773a9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdministratorsClient().Get(ctx, "testrg", "pgtestsvc4", 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 = armpostgresql.ServerAdministratorResource{ - // Name: to.Ptr("activeDirectory"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"), - // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerAdministratorResource{ - Properties: &armpostgresql.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 = armpostgresql.ServerAdministratorResource{ - // Name: to.Ptr("activeDirectory"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"), - // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdministratorsClient().BeginDelete(ctx, "testrg", "pgtestsvc4", 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerAdministratorsClient().NewListPager("testrg", "pgtestsvc4", 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 = armpostgresql.ServerAdministratorResourceListResult{ - // Value: []*armpostgresql.ServerAdministratorResource{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"), - // Properties: &armpostgresql.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/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go deleted file mode 100644 index ff7046752d7a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerBasedPerformanceTierClient().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.PerformanceTierListResult = armpostgresql.PerformanceTierListResult{ - // Value: []*armpostgresql.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: []*armpostgresql.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: []*armpostgresql.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: []*armpostgresql.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/postgresql/armpostgresql/serverkeys_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go deleted file mode 100644 index 6ce30f118cdd..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.ServerKeyListResult{ - // Value: []*armpostgresql.ServerKey{ - // { - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armpostgresql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()), - // ServerKeyType: to.Ptr(armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.ServerKey{ - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armpostgresql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()), - // ServerKeyType: to.Ptr(armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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", armpostgresql.ServerKey{ - Properties: &armpostgresql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armpostgresql.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 = armpostgresql.ServerKey{ - // Name: to.Ptr("omeVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armpostgresql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T00:00:00.000Z"); return t}()), - // ServerKeyType: to.Ptr(armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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/postgresql/armpostgresql/serverparameters_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go deleted file mode 100644 index b9407efbfb1d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerParametersClient().BeginListUpdateConfigurations(ctx, "TestGroup", "testserver", armpostgresql.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 = armpostgresql.ConfigurationListResult{ - // Value: []*armpostgresql.Configuration{ - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go deleted file mode 100644 index e9aca625b90c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go +++ /dev/null @@ -1,761 +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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{ - Location: to.Ptr("brazilsouth"), - Properties: &armpostgresql.ServerPropertiesForRestore{ - CreateMode: to.Ptr(armpostgresql.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.DBforPostgreSQL/servers/sourceserver"), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("B_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierBasic), - }, - 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 = armpostgresql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup", "pgtestsvc4", armpostgresql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armpostgresql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armpostgresql.CreateModeDefault), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - StorageProfile: &armpostgresql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - StorageMB: to.Ptr[int32](128000), - }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(""), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("B_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierBasic), - }, - 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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup_WestCentralUS", "testserver-replica1", armpostgresql.ServerForCreate{ - Location: to.Ptr("westcentralus"), - Properties: &armpostgresql.ServerPropertiesForReplica{ - CreateMode: to.Ptr(armpostgresql.CreateModeReplica), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresql.Server{ - // Name: to.Ptr("testserver-replica1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-20T00:17:56.677Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armpostgresql.ServerPropertiesForGeoRestore{ - CreateMode: to.Ptr(armpostgresql.CreateModeGeoRestore), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.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 = armpostgresql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerUpdateParameters{ - Properties: &armpostgresql.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.Ptr(""), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - }, - }, 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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc1", 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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:00:58.924Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // MasterServerID: to.Ptr(""), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // ReplicationRole: to.Ptr(""), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS11), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc3"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg1/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T00:11:08.550Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc3.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](204800), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_4"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 2e2a832da058..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.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 = armpostgresql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armpostgresql.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(armpostgresql.ServerSecurityAlertPolicyStateDisabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{ - Properties: &armpostgresql.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(armpostgresql.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 = armpostgresql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armpostgresql.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(armpostgresql.ServerSecurityAlertPolicyStateEnabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{ - Properties: &armpostgresql.SecurityAlertPolicyProperties{ - EmailAccountAdmins: to.Ptr(true), - State: to.Ptr(armpostgresql.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 = armpostgresql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armpostgresql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.ServerSecurityAlertPolicyListResult{ - // Value: []*armpostgresql.ServerSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies"), - // Properties: &armpostgresql.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(armpostgresql.ServerSecurityAlertPolicyStateDisabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go index 4bbbd5f411cc..da6359f1581e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/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/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go deleted file mode 100644 index 547a41d821c9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/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 armpostgresql_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/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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", armpostgresql.VirtualNetworkRule{ - Properties: &armpostgresql.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 = armpostgresql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/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 := armpostgresql.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 = armpostgresql.VirtualNetworkRuleListResult{ - // Value: []*armpostgresql.VirtualNetworkRule{ - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armpostgresql.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.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md index 507346edda21..71e36d1f5fa4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md @@ -1,5 +1,180 @@ # Release History +## 4.0.0 (2024-09-26) +### Breaking Changes + +- Type of `CapabilitiesListResult.Value` has been changed from `[]*CapabilityProperties` to `[]*FlexibleServerCapability` +- Type of `FastProvisioningEditionCapability.SupportedStorageGb` has been changed from `*int64` to `*int32` +- Type of `FlexibleServerEditionCapability.Status` has been changed from `*string` to `*CapabilityStatus` +- Type of `ServerVersionCapability.Status` has been changed from `*string` to `*CapabilityStatus` +- Type of `StorageEditionCapability.Status` has been changed from `*string` to `*CapabilityStatus` +- Type of `StorageTierCapability.Iops` has been changed from `*int64` to `*int32` +- Type of `StorageTierCapability.Status` has been changed from `*string` to `*CapabilityStatus` +- `IdentityTypeSystemAssigned` from enum `IdentityType` has been removed +- Struct `CapabilityProperties` has been removed +- Struct `HyperscaleNodeEditionCapability` has been removed +- Struct `NodeTypeCapability` has been removed +- Struct `StorageMBCapability` has been removed +- Struct `VcoreCapability` has been removed +- Field `SupportedServerVersions` of struct `FlexibleServerEditionCapability` has been removed +- Field `SupportedVcores` of struct `ServerVersionCapability` has been removed +- Field `SupportedStorageMB` of struct `StorageEditionCapability` has been removed +- Field `IsBaseline`, `TierName` of struct `StorageTierCapability` has been removed + +### Features Added + +- New value `CreateModeReviveDropped` added to enum type `CreateMode` +- New value `OriginCustomerOnDemand` added to enum type `Origin` +- New value `ServerVersionFifteen`, `ServerVersionSixteen` added to enum type `ServerVersion` +- New enum type `AzureManagedDiskPerformanceTiers` with values `AzureManagedDiskPerformanceTiersP1`, `AzureManagedDiskPerformanceTiersP10`, `AzureManagedDiskPerformanceTiersP15`, `AzureManagedDiskPerformanceTiersP2`, `AzureManagedDiskPerformanceTiersP20`, `AzureManagedDiskPerformanceTiersP3`, `AzureManagedDiskPerformanceTiersP30`, `AzureManagedDiskPerformanceTiersP4`, `AzureManagedDiskPerformanceTiersP40`, `AzureManagedDiskPerformanceTiersP50`, `AzureManagedDiskPerformanceTiersP6`, `AzureManagedDiskPerformanceTiersP60`, `AzureManagedDiskPerformanceTiersP70`, `AzureManagedDiskPerformanceTiersP80` +- New enum type `CancelEnum` with values `CancelEnumFalse`, `CancelEnumTrue` +- New enum type `CapabilityStatus` with values `CapabilityStatusAvailable`, `CapabilityStatusDefault`, `CapabilityStatusDisabled`, `CapabilityStatusVisible` +- New enum type `ExecutionStatus` with values `ExecutionStatusCancelled`, `ExecutionStatusFailed`, `ExecutionStatusRunning`, `ExecutionStatusSucceeded` +- New enum type `FastProvisioningSupportedEnum` with values `FastProvisioningSupportedEnumDisabled`, `FastProvisioningSupportedEnumEnabled` +- New enum type `GeoBackupSupportedEnum` with values `GeoBackupSupportedEnumDisabled`, `GeoBackupSupportedEnumEnabled` +- New enum type `HaMode` with values `HaModeSameZone`, `HaModeZoneRedundant` +- New enum type `KeyStatusEnum` with values `KeyStatusEnumInvalid`, `KeyStatusEnumValid` +- New enum type `LogicalReplicationOnSourceDbEnum` with values `LogicalReplicationOnSourceDbEnumFalse`, `LogicalReplicationOnSourceDbEnumTrue` +- New enum type `MigrateRolesEnum` with values `MigrateRolesEnumFalse`, `MigrateRolesEnumTrue` +- New enum type `MigrationDbState` with values `MigrationDbStateCanceled`, `MigrationDbStateCanceling`, `MigrationDbStateFailed`, `MigrationDbStateInProgress`, `MigrationDbStateSucceeded`, `MigrationDbStateWaitingForCutoverTrigger` +- New enum type `MigrationListFilter` with values `MigrationListFilterActive`, `MigrationListFilterAll` +- New enum type `MigrationMode` with values `MigrationModeOffline`, `MigrationModeOnline` +- New enum type `MigrationNameAvailabilityReason` with values `MigrationNameAvailabilityReasonAlreadyExists`, `MigrationNameAvailabilityReasonInvalid` +- New enum type `MigrationOption` with values `MigrationOptionMigrate`, `MigrationOptionValidate`, `MigrationOptionValidateAndMigrate` +- New enum type `MigrationState` with values `MigrationStateCanceled`, `MigrationStateCleaningUp`, `MigrationStateFailed`, `MigrationStateInProgress`, `MigrationStateSucceeded`, `MigrationStateValidationFailed`, `MigrationStateWaitingForUserAction` +- New enum type `MigrationSubState` with values `MigrationSubStateCancelingRequestedDBMigrations`, `MigrationSubStateCompleted`, `MigrationSubStateCompletingMigration`, `MigrationSubStateMigratingData`, `MigrationSubStatePerformingPreRequisiteSteps`, `MigrationSubStateValidationInProgress`, `MigrationSubStateWaitingForCutoverTrigger`, `MigrationSubStateWaitingForDBsToMigrateSpecification`, `MigrationSubStateWaitingForDataMigrationScheduling`, `MigrationSubStateWaitingForDataMigrationWindow`, `MigrationSubStateWaitingForLogicalReplicationSetupRequestOnSourceDB`, `MigrationSubStateWaitingForTargetDBOverwriteConfirmation` +- New enum type `OnlineResizeSupportedEnum` with values `OnlineResizeSupportedEnumDisabled`, `OnlineResizeSupportedEnumEnabled` +- New enum type `OverwriteDbsInTargetEnum` with values `OverwriteDbsInTargetEnumFalse`, `OverwriteDbsInTargetEnumTrue` +- New enum type `PrivateEndpointConnectionProvisioningState` with values `PrivateEndpointConnectionProvisioningStateCreating`, `PrivateEndpointConnectionProvisioningStateDeleting`, `PrivateEndpointConnectionProvisioningStateFailed`, `PrivateEndpointConnectionProvisioningStateSucceeded` +- New enum type `PrivateEndpointServiceConnectionStatus` with values `PrivateEndpointServiceConnectionStatusApproved`, `PrivateEndpointServiceConnectionStatusPending`, `PrivateEndpointServiceConnectionStatusRejected` +- New enum type `ReadReplicaPromoteMode` with values `ReadReplicaPromoteModeStandalone`, `ReadReplicaPromoteModeSwitchover` +- New enum type `ReplicationPromoteOption` with values `ReplicationPromoteOptionForced`, `ReplicationPromoteOptionPlanned` +- New enum type `ReplicationState` with values `ReplicationStateActive`, `ReplicationStateBroken`, `ReplicationStateCatchup`, `ReplicationStateProvisioning`, `ReplicationStateReconfiguring`, `ReplicationStateUpdating` +- New enum type `RestrictedEnum` with values `RestrictedEnumDisabled`, `RestrictedEnumEnabled` +- New enum type `SSLMode` with values `SSLModePrefer`, `SSLModeRequire`, `SSLModeVerifyCA`, `SSLModeVerifyFull` +- New enum type `SourceType` with values `SourceTypeAWS`, `SourceTypeAWSAURORA`, `SourceTypeAWSEC2`, `SourceTypeAWSRDS`, `SourceTypeAzureVM`, `SourceTypeEDB`, `SourceTypeGCP`, `SourceTypeGCPAlloyDB`, `SourceTypeGCPCloudSQL`, `SourceTypeGCPCompute`, `SourceTypeOnPremises`, `SourceTypePostgreSQLSingleServer` +- New enum type `StartDataMigrationEnum` with values `StartDataMigrationEnumFalse`, `StartDataMigrationEnumTrue` +- New enum type `StorageAutoGrow` with values `StorageAutoGrowDisabled`, `StorageAutoGrowEnabled` +- New enum type `StorageAutoGrowthSupportedEnum` with values `StorageAutoGrowthSupportedEnumDisabled`, `StorageAutoGrowthSupportedEnumEnabled` +- New enum type `StorageType` with values `StorageTypePremiumLRS`, `StorageTypePremiumV2LRS` +- New enum type `ThreatProtectionName` with values `ThreatProtectionNameDefault` +- New enum type `ThreatProtectionState` with values `ThreatProtectionStateDisabled`, `ThreatProtectionStateEnabled` +- New enum type `TriggerCutoverEnum` with values `TriggerCutoverEnumFalse`, `TriggerCutoverEnumTrue` +- New enum type `ValidationState` with values `ValidationStateFailed`, `ValidationStateSucceeded`, `ValidationStateWarning` +- New enum type `VirtualEndpointType` with values `VirtualEndpointTypeReadWrite` +- New enum type `ZoneRedundantHaAndGeoBackupSupportedEnum` with values `ZoneRedundantHaAndGeoBackupSupportedEnumDisabled`, `ZoneRedundantHaAndGeoBackupSupportedEnumEnabled` +- New enum type `ZoneRedundantHaSupportedEnum` with values `ZoneRedundantHaSupportedEnumDisabled`, `ZoneRedundantHaSupportedEnumEnabled` +- New function `*BackupsClient.BeginCreate(context.Context, string, string, string, *BackupsClientBeginCreateOptions) (*runtime.Poller[BackupsClientCreateResponse], error)` +- New function `*BackupsClient.BeginDelete(context.Context, string, string, string, *BackupsClientBeginDeleteOptions) (*runtime.Poller[BackupsClientDeleteResponse], error)` +- New function `*ClientFactory.NewFlexibleServerClient() *FlexibleServerClient` +- New function `*ClientFactory.NewLogFilesClient() *LogFilesClient` +- New function `*ClientFactory.NewLtrBackupOperationsClient() *LtrBackupOperationsClient` +- New function `*ClientFactory.NewMigrationsClient() *MigrationsClient` +- New function `*ClientFactory.NewPostgreSQLServerManagementClient() *PostgreSQLServerManagementClient` +- New function `*ClientFactory.NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient` +- New function `*ClientFactory.NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient` +- New function `*ClientFactory.NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient` +- New function `*ClientFactory.NewServerCapabilitiesClient() *ServerCapabilitiesClient` +- New function `*ClientFactory.NewServerThreatProtectionSettingsClient() *ServerThreatProtectionSettingsClient` +- New function `*ClientFactory.NewVirtualEndpointsClient() *VirtualEndpointsClient` +- New function `NewFlexibleServerClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FlexibleServerClient, error)` +- New function `*FlexibleServerClient.BeginStartLtrBackup(context.Context, string, string, LtrBackupRequest, *FlexibleServerClientBeginStartLtrBackupOptions) (*runtime.Poller[FlexibleServerClientStartLtrBackupResponse], error)` +- New function `*FlexibleServerClient.TriggerLtrPreBackup(context.Context, string, string, LtrPreBackupRequest, *FlexibleServerClientTriggerLtrPreBackupOptions) (FlexibleServerClientTriggerLtrPreBackupResponse, error)` +- New function `NewLogFilesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LogFilesClient, error)` +- New function `*LogFilesClient.NewListByServerPager(string, string, *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse]` +- New function `NewLtrBackupOperationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LtrBackupOperationsClient, error)` +- New function `*LtrBackupOperationsClient.Get(context.Context, string, string, string, *LtrBackupOperationsClientGetOptions) (LtrBackupOperationsClientGetResponse, error)` +- New function `*LtrBackupOperationsClient.NewListByServerPager(string, string, *LtrBackupOperationsClientListByServerOptions) *runtime.Pager[LtrBackupOperationsClientListByServerResponse]` +- New function `NewMigrationsClient(azcore.TokenCredential, *arm.ClientOptions) (*MigrationsClient, error)` +- New function `*MigrationsClient.Create(context.Context, string, string, string, string, MigrationResource, *MigrationsClientCreateOptions) (MigrationsClientCreateResponse, error)` +- New function `*MigrationsClient.Delete(context.Context, string, string, string, string, *MigrationsClientDeleteOptions) (MigrationsClientDeleteResponse, error)` +- New function `*MigrationsClient.Get(context.Context, string, string, string, string, *MigrationsClientGetOptions) (MigrationsClientGetResponse, error)` +- New function `*MigrationsClient.NewListByTargetServerPager(string, string, string, *MigrationsClientListByTargetServerOptions) *runtime.Pager[MigrationsClientListByTargetServerResponse]` +- New function `*MigrationsClient.Update(context.Context, string, string, string, string, MigrationResourceForPatch, *MigrationsClientUpdateOptions) (MigrationsClientUpdateResponse, error)` +- New function `NewPostgreSQLServerManagementClient(azcore.TokenCredential, *arm.ClientOptions) (*PostgreSQLServerManagementClient, error)` +- New function `*PostgreSQLServerManagementClient.CheckMigrationNameAvailability(context.Context, string, string, string, MigrationNameAvailabilityResource, *PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse, error)` +- New function `NewPrivateEndpointConnectionClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionClient, error)` +- New function `*PrivateEndpointConnectionClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], error)` +- New function `*PrivateEndpointConnectionClient.BeginUpdate(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionClientUpdateResponse], error)` +- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)` +- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.NewListByServerPager(string, string, *PrivateEndpointConnectionsClientListByServerOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByServerResponse]` +- New function `NewPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateLinkResourcesClient, error)` +- New function `*PrivateLinkResourcesClient.Get(context.Context, string, string, string, *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error)` +- New function `*PrivateLinkResourcesClient.NewListByServerPager(string, string, *PrivateLinkResourcesClientListByServerOptions) *runtime.Pager[PrivateLinkResourcesClientListByServerResponse]` +- New function `NewServerCapabilitiesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerCapabilitiesClient, error)` +- New function `*ServerCapabilitiesClient.NewListPager(string, string, *ServerCapabilitiesClientListOptions) *runtime.Pager[ServerCapabilitiesClientListResponse]` +- New function `NewServerThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerThreatProtectionSettingsClient, error)` +- New function `*ServerThreatProtectionSettingsClient.BeginCreateOrUpdate(context.Context, string, string, ThreatProtectionName, ServerThreatProtectionSettingsModel, *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerThreatProtectionSettingsClientCreateOrUpdateResponse], error)` +- New function `*ServerThreatProtectionSettingsClient.Get(context.Context, string, string, ThreatProtectionName, *ServerThreatProtectionSettingsClientGetOptions) (ServerThreatProtectionSettingsClientGetResponse, error)` +- New function `*ServerThreatProtectionSettingsClient.NewListByServerPager(string, string, *ServerThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[ServerThreatProtectionSettingsClientListByServerResponse]` +- New function `NewVirtualEndpointsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VirtualEndpointsClient, error)` +- New function `*VirtualEndpointsClient.BeginCreate(context.Context, string, string, string, VirtualEndpointResource, *VirtualEndpointsClientBeginCreateOptions) (*runtime.Poller[VirtualEndpointsClientCreateResponse], error)` +- New function `*VirtualEndpointsClient.BeginDelete(context.Context, string, string, string, *VirtualEndpointsClientBeginDeleteOptions) (*runtime.Poller[VirtualEndpointsClientDeleteResponse], error)` +- New function `*VirtualEndpointsClient.Get(context.Context, string, string, string, *VirtualEndpointsClientGetOptions) (VirtualEndpointsClientGetResponse, error)` +- New function `*VirtualEndpointsClient.NewListByServerPager(string, string, *VirtualEndpointsClientListByServerOptions) *runtime.Pager[VirtualEndpointsClientListByServerResponse]` +- New function `*VirtualEndpointsClient.BeginUpdate(context.Context, string, string, string, VirtualEndpointResourceForPatch, *VirtualEndpointsClientBeginUpdateOptions) (*runtime.Poller[VirtualEndpointsClientUpdateResponse], error)` +- New struct `AdminCredentials` +- New struct `BackupSettings` +- New struct `BackupStoreDetails` +- New struct `DbLevelValidationStatus` +- New struct `DbMigrationStatus` +- New struct `DbServerMetadata` +- New struct `FlexibleServerCapability` +- New struct `LogFile` +- New struct `LogFileListResult` +- New struct `LogFileProperties` +- New struct `LtrBackupOperationResponseProperties` +- New struct `LtrBackupRequest` +- New struct `LtrBackupResponse` +- New struct `LtrPreBackupRequest` +- New struct `LtrPreBackupResponse` +- New struct `LtrPreBackupResponseProperties` +- New struct `LtrServerBackupOperation` +- New struct `LtrServerBackupOperationList` +- New struct `MigrationNameAvailabilityResource` +- New struct `MigrationResource` +- New struct `MigrationResourceForPatch` +- New struct `MigrationResourceListResult` +- New struct `MigrationResourceProperties` +- New struct `MigrationResourcePropertiesForPatch` +- New struct `MigrationSecretParameters` +- New struct `MigrationStatus` +- New struct `MigrationSubStateDetails` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnection` +- New struct `PrivateEndpointConnectionListResult` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceListResult` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkServiceConnectionState` +- New struct `Replica` +- New struct `ServerSKU` +- New struct `ServerSKUCapability` +- New struct `ServerThreatProtectionListResult` +- New struct `ServerThreatProtectionProperties` +- New struct `ServerThreatProtectionSettingsModel` +- New struct `StorageMbCapability` +- New struct `ValidationDetails` +- New struct `ValidationMessage` +- New struct `ValidationSummaryItem` +- New struct `VirtualEndpointResource` +- New struct `VirtualEndpointResourceForPatch` +- New struct `VirtualEndpointResourceProperties` +- New struct `VirtualEndpointsListResult` +- New field `GeoBackupEncryptionKeyStatus`, `GeoBackupKeyURI`, `GeoBackupUserAssignedIdentityID`, `PrimaryEncryptionKeyStatus` in struct `DataEncryption` +- New field `Reason`, `ServerCount`, `Status`, `SupportedTier` in struct `FastProvisioningEditionCapability` +- New field `DefaultSKUName`, `Reason`, `SupportedServerSKUs` in struct `FlexibleServerEditionCapability` +- New field `PrivateEndpointConnections`, `Replica` in struct `ServerProperties` +- New field `AdministratorLogin`, `Network`, `Replica` in struct `ServerPropertiesForUpdate` +- New field `Reason` in struct `ServerVersionCapability` +- New field `AutoGrow`, `Iops`, `Throughput`, `Tier`, `Type` in struct `Storage` +- New field `DefaultStorageSizeMb`, `Reason`, `SupportedStorageMb` in struct `StorageEditionCapability` +- New field `Reason` in struct `StorageTierCapability` +- New field `TenantID` in struct `UserAssignedIdentity` + + ## 4.0.0-beta.5 (2024-04-26) ### Features Added diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go index b7e47a4b60e1..bdc195fa499f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go @@ -46,7 +46,7 @@ func NewAdministratorsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - objectID - Guid of the objectId for the administrator. @@ -74,7 +74,7 @@ func (client *AdministratorsClient) BeginCreate(ctx context.Context, resourceGro // Create - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *AdministratorsClient) create(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters ActiveDirectoryAdministratorAdd, options *AdministratorsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AdministratorsClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *AdministratorsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *AdministratorsClient) createCreateRequest(ctx context.Context, res // BeginDelete - Deletes an Active Directory Administrator associated with the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - objectID - Guid of the objectId for the administrator. @@ -159,7 +159,7 @@ func (client *AdministratorsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes an Active Directory Administrator associated with the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *AdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AdministratorsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *AdministratorsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *AdministratorsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets information about a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - objectID - Guid of the objectId for the administrator. @@ -265,7 +265,7 @@ func (client *AdministratorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *AdministratorsClient) getHandleResponse(resp *http.Response) (Admi // NewListByServerPager - List all the AAD administrators for a given server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - AdministratorsClientListByServerOptions contains the optional parameters for the AdministratorsClient.NewListByServerPager @@ -330,7 +330,7 @@ func (client *AdministratorsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go deleted file mode 100644 index 805867bd5774..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go +++ /dev/null @@ -1,159 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorAdd.json -func ExampleAdministratorsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdministratorsClient().BeginCreate(ctx, "testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", armpostgresqlflexibleservers.ActiveDirectoryAdministratorAdd{ - Properties: &armpostgresqlflexibleservers.AdministratorPropertiesForAdd{ - PrincipalName: to.Ptr("testuser1@microsoft.com"), - PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - }, - }, 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.ActiveDirectoryAdministrator = armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // Name: to.Ptr("testuser1@microsoft.com"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuser1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorDelete.json -func ExampleAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdministratorsClient().BeginDelete(ctx, "testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", 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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorGet.json -func ExampleAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdministratorsClient().Get(ctx, "testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", 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.ActiveDirectoryAdministrator = armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // Name: to.Ptr("testuser1@microsoft.com"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuer1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorsListByServer.json -func ExampleAdministratorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdministratorsClient().NewListByServerPager("testrg", "pgtestsvc1", 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 = armpostgresqlflexibleservers.AdministratorListResult{ - // Value: []*armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // { - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuer1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // }, - // { - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/gggggggg-gggg-gggg-gggg-gggggggggggg"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("gggggggg-gggg-gggg-gggg-gggggggggggg"), - // PrincipalName: to.Ptr("testgroup1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeGroup), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md index 7bf352b05e7e..7d4bec8917c8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md @@ -5,10 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 4.0.0-beta.5 +module-version: 4.0.0 package-flexibleservers: true -tag: package-flexibleserver-2023-12-01-preview ``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go index 7e1da582697d..c9bbf8de721a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go @@ -43,10 +43,172 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } +// BeginCreate - Create a specific backup for PostgreSQL flexible server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - backupName - The name of the backup. +// - options - BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. +func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginCreateOptions) (*runtime.Poller[BackupsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, serverName, backupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Create a specific backup for PostgreSQL flexible server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +func (client *BackupsClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "BackupsClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, backupName, 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.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" + 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)) + if backupName == "" { + return nil, errors.New("parameter backupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDelete - Deletes a specific backup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - backupName - The name of the backup. +// - options - BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. +func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginDeleteOptions) (*runtime.Poller[BackupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, backupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a specific backup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "BackupsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, backupName, 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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}" + 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)) + if backupName == "" { + return nil, errors.New("parameter backupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // Get - Get specific backup for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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 +259,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +276,7 @@ func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClie // NewListByServerPager - List all the backups for a given server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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 +324,7 @@ func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go deleted file mode 100644 index d3b968d6f3ac..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go +++ /dev/null @@ -1,186 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().Get(ctx, "TestGroup", "postgresqltestserver", "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 = armpostgresqlflexibleservers.ServerBackup{ - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210615T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupListByServer.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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupsClient().NewListByServerPager("TestGroup", "postgresqltestserver", 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 = armpostgresqlflexibleservers.ServerBackupListResult{ - // Value: []*armpostgresqlflexibleservers.ServerBackup{ - // { - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210615T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210616T160520"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210617T160525"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210618T160529"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210619T160533"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210620T160538"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210621T160543"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210622T160803"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210622T210807"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210623T212413"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210624T061328"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // 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/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go index 47cd4a4a8185..ffae1a920e6c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go @@ -46,7 +46,7 @@ func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.Tok // Execute - Check the availability of name for resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - nameAvailabilityRequest - The required parameters for checking if resource name is available. // - options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute // method. @@ -84,7 +84,7 @@ func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go deleted file mode 100644 index 57a05cca01d2..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go +++ /dev/null @@ -1,48 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/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 = armpostgresqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go index 7931137a0033..72db5538417f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go @@ -46,7 +46,7 @@ func NewCheckNameAvailabilityWithLocationClient(subscriptionID string, credentia // Execute - Check the availability of name for resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - locationName - The name of the location. // - nameAvailabilityRequest - The required parameters for checking if resource name is available. // - options - CheckNameAvailabilityWithLocationClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityWithLocationClient.Execute @@ -89,7 +89,7 @@ func (client *CheckNameAvailabilityWithLocationClient) executeCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go deleted file mode 100644 index 8e5bc0cf003f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go +++ /dev/null @@ -1,48 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailabilityLocationBased.json -func ExampleCheckNameAvailabilityWithLocationClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityWithLocationClient().Execute(ctx, "westus", armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/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 = armpostgresqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go index 29e9b49c170a..945457b2a39b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go @@ -145,9 +145,9 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { } } -// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient. -func (c *ClientFactory) NewPostgreSQLManagementClient() *PostgreSQLManagementClient { - return &PostgreSQLManagementClient{ +// NewPostgreSQLServerManagementClient creates a new instance of PostgreSQLServerManagementClient. +func (c *ClientFactory) NewPostgreSQLServerManagementClient() *PostgreSQLServerManagementClient { + return &PostgreSQLServerManagementClient{ internal: c.internal, } } @@ -176,14 +176,6 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli } } -// NewQuotaUsagesClient creates a new instance of QuotaUsagesClient. -func (c *ClientFactory) NewQuotaUsagesClient() *QuotaUsagesClient { - return &QuotaUsagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { return &ReplicasClient{ diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go index 8a48aafb23d0..d47a9de89975 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go @@ -46,7 +46,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets information about a configuration of server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -97,7 +97,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // NewListByServerPager - List all the configurations in a given server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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 @@ -162,7 +162,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ConfigurationsClient) listByServerHandleResponse(resp *http.Respon // BeginPut - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -207,7 +207,7 @@ func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupN // Put - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *ConfigurationsClient) put(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginPutOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginPut" @@ -253,7 +253,7 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -265,7 +265,7 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour // BeginUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -293,7 +293,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-12-01-preview +// Generated from API version 2024-08-01 func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginUpdate" @@ -339,7 +339,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go deleted file mode 100644 index 2388fac0899c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go +++ /dev/null @@ -1,2007 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("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.ConfigurationListResult = armpostgresqlflexibleservers.ConfigurationListResult{ - // Value: []*armpostgresqlflexibleservers.Configuration{ - // { - // Name: to.Ptr("application_name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/application_name"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the application name to be reported in statistics and logs."), - // AllowedValues: to.Ptr("[A-Za-z0-9._-]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/array_nulls"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Starts the autovacuum subprocess."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_analyze_scale_factor"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_analyze_scale_factor"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of tuple inserts, updates, or deletes prior to analyze as a fraction of reltuples."), - // AllowedValues: to.Ptr("0-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_analyze_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_analyze_threshold"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum number of tuple inserts, updates, or deletes prior to analyze."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("50"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_naptime"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_naptime"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time to sleep between autovacuum runs."), - // AllowedValues: to.Ptr("1-2147483"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("60"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("60"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_cost_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_cost_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost delay in milliseconds, for autovacuum."), - // AllowedValues: to.Ptr("-1-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_cost_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_cost_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost amount available before napping, for autovacuum."), - // AllowedValues: to.Ptr("-1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_scale_factor"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_scale_factor"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of tuple updates or deletes prior to vacuum as a fraction of reltuples."), - // AllowedValues: to.Ptr("0-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.2"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_threshold"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum number of tuple updates or deletes prior to vacuum."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("50"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_work_mem"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_work_mem"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum memory to be used by each autovacuum worker process."), - // AllowedValues: to.Ptr("-1-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("backend_flush_after"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backend_flush_after"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), - // AllowedValues: to.Ptr("0-256"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Background writer sleep time between rounds."), - // AllowedValues: to.Ptr("10-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_flush_after"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_flush_after"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), - // AllowedValues: to.Ptr("0-256"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_lru_maxpages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_lru_maxpages"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Background writer maximum number of LRU pages to flush per round."), - // AllowedValues: to.Ptr("0-1073741823"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_lru_multiplier"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_lru_multiplier"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Multiple of the average buffer usage to free per round."), - // AllowedValues: to.Ptr("0-10"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("bytea_output"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bytea_output"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the output format for bytea."), - // AllowedValues: to.Ptr("escape,hex"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("hex"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("hex"), - // }, - // }, - // { - // Name: to.Ptr("check_function_bodies"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/check_function_bodies"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Checks function bodies during CREATE FUNCTION."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("checkpoint_completion_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_completion_target"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time spent flushing dirty buffers during checkpoint, as fraction of checkpoint interval."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.5"), - // }, - // }, - // { - // Name: to.Ptr("checkpoint_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum time between automatic WAL checkpoints."), - // AllowedValues: to.Ptr("30-86400"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("300"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("300"), - // }, - // }, - // { - // Name: to.Ptr("checkpoint_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_warning"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables warnings if checkpoint segments are filled more frequently than this."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30"), - // }, - // }, - // { - // Name: to.Ptr("client_encoding"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/client_encoding"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the client's character set encoding."), - // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("sql_ascii"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("sql_ascii"), - // }, - // }, - // { - // Name: to.Ptr("client_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/client_min_messages"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are sent to the client."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("notice"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("notice"), - // }, - // }, - // { - // Name: to.Ptr("commit_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/commit_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the delay in microseconds between transaction commit and flushing WAL to disk."), - // AllowedValues: to.Ptr("0-100000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("commit_siblings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/commit_siblings"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum concurrent open transactions before performing commit_delay."), - // AllowedValues: to.Ptr("0-1000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), - // }, - // }, - // { - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner to use constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("partition"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("partition"), - // }, - // }, - // { - // Name: to.Ptr("cpu_index_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_index_tuple_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each index entry during an index scan."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.005"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.005"), - // }, - // }, - // { - // Name: to.Ptr("cpu_operator_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_operator_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function call."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.0025"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0025"), - // }, - // }, - // { - // Name: to.Ptr("cpu_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_tuple_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each tuple (row)."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.01"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.01"), - // }, - // }, - // { - // Name: to.Ptr("cursor_tuple_fraction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cursor_tuple_fraction"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("DateStyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/DateStyle"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for date and time values."), - // AllowedValues: to.Ptr("(ISO|POSTGRES|SQL|GERMAN)(, (DMY|MDY|YMD))?"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("ISO, MDY"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("ISO, MDY"), - // }, - // }, - // { - // Name: to.Ptr("deadlock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/deadlock_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the amount of time, in milliseconds, to wait on a lock before checking for deadlock."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("debug_pretty_print"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_pretty_print"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indents parse and plan tree displays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_parse"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_parse"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_plan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_plan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's execution plan."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_rewritten"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_rewritten"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's rewritten parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_statistics_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_statistics_target"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default statistics target."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("default_tablespace"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_tablespace"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default tablespace to create tables and indexes in."), - // AllowedValues: to.Ptr("[A-Za-z._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("default_text_search_config"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_text_search_config"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets default text search configuration."), - // AllowedValues: to.Ptr("[A-Za-z._]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("pg_catalog.english"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("pg_catalog.english"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_deferrable"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_deferrable"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default deferrable status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_isolation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_isolation"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the transaction isolation level of each new transaction."), - // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("read committed"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("read committed"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_read_only"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_read_only"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default read-only status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_with_oids"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_with_oids"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Creates new tables with OIDs by default."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("effective_cache_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/effective_cache_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's assumption about the size of the disk cache."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("3145728"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("3145728"), - // }, - // }, - // { - // Name: to.Ptr("enable_bitmapscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_bitmapscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_gathermerge"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_gathermerge"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of gather merge plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashagg"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_hashagg"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashjoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_hashjoin"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hash join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexonlyscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_indexonlyscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_indexscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_material"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_material"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of materialization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_mergejoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_mergejoin"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of merge join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_nestloop"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_nestloop"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of nested loop join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_seqscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_seqscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_sort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_sort"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of explicit sort steps."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_tidscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_tidscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of TID scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("escape_string_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/escape_string_warning"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Warns about backslash escapes in ordinary string literals."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("exit_on_error"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/exit_on_error"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Terminates session on any error."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("extra_float_digits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/extra_float_digits"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), - // AllowedValues: to.Ptr("-15-3"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("force_parallel_mode"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/force_parallel_mode"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Forces use of parallel query facilities."), - // AllowedValues: to.Ptr("off,on,regress"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("from_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/from_collapse_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which subqueries are not collapsed."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("geqo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables genetic query optimization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("geqo_effort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_effort"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), - // AllowedValues: to.Ptr("1-10"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), - // }, - // }, - // { - // Name: to.Ptr("geqo_generations"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_generations"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of iterations of the algorithm."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_pool_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_pool_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of individuals in the population."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_seed"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_seed"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: seed for random path selection."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_selection_bias"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_selection_bias"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: selective pressure within the population."), - // AllowedValues: to.Ptr("1.5-2"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("geqo_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_threshold"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), - // AllowedValues: to.Ptr("2-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("12"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("12"), - // }, - // }, - // { - // Name: to.Ptr("gin_fuzzy_search_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/gin_fuzzy_search_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("gin_pending_list_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/gin_pending_list_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum size of the pending list for GIN index."), - // AllowedValues: to.Ptr("64-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("4096"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4096"), - // }, - // }, - // { - // Name: to.Ptr("idle_in_transaction_session_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/idle_in_transaction_session_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("IntervalStyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/IntervalStyle"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for interval values."), - // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("postgres"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("postgres"), - // }, - // }, - // { - // Name: to.Ptr("join_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/join_collapse_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("lc_monetary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_monetary"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the locale for formatting monetary amounts."), - // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("en_US.utf-8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("en_US.utf-8"), - // }, - // }, - // { - // Name: to.Ptr("lc_numeric"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_numeric"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the locale for formatting numbers."), - // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("en_US.utf-8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("en_US.utf-8"), - // }, - // }, - // { - // Name: to.Ptr("lo_compat_privileges"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lo_compat_privileges"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables backward compatibility mode for privilege checks on large objects."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("lock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lock_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any wait for a lock. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("log_autovacuum_min_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_autovacuum_min_duration"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum execution time above which autovacuum actions will be logged."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("log_checkpoints"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_checkpoints"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each checkpoint."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("log_connections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_connections"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each successful connection."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("log_destination"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_destination"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the destination for server log output."), - // AllowedValues: to.Ptr("stderr,csvlog"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("stderr"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("stderr"), - // }, - // }, - // { - // Name: to.Ptr("log_disconnections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_disconnections"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs end of a session, including duration."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_duration"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs the duration of each completed SQL statement."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_error_verbosity"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_error_verbosity"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the verbosity of logged messages."), - // AllowedValues: to.Ptr("terse,default,verbose"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("default"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("default"), - // }, - // }, - // { - // Name: to.Ptr("log_lock_waits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_lock_waits"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs long lock waits."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_min_duration_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_duration_statement"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum execution time (in milliseconds) above which statements will be logged. -1 disables logging statement durations."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("log_min_error_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_error_statement"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Causes all statements generating error at or above this level to be logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("error"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("error"), - // }, - // }, - // { - // Name: to.Ptr("log_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_messages"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("warning"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("warning"), - // }, - // }, - // { - // Name: to.Ptr("log_replication_commands"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_replication_commands"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each replication command."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the type of statements logged."), - // AllowedValues: to.Ptr("none,ddl,mod,all"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), - // }, - // }, - // { - // Name: to.Ptr("log_statement_stats"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement_stats"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("For each query, writes cumulative performance statistics to the server log."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_temp_files"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_temp_files"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs the use of temporary files larger than this number of kilobytes."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("maintenance_work_mem"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/maintenance_work_mem"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum memory to be used for maintenance operations."), - // AllowedValues: to.Ptr("1024-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("332800"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("332800"), - // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_workers"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel workers than can be active at one time."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers_per_gather"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_workers_per_gather"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_page"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_page"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate-locked tuples per page."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_relation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_relation"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate-locked pages and tuples per relation."), - // AllowedValues: to.Ptr("-2147483648-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-2"), - // }, - // }, - // { - // Name: to.Ptr("max_standby_archive_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_standby_archive_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum delay before canceling queries when a hot standby server is processing archived WAL data."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30000"), - // }, - // }, - // { - // Name: to.Ptr("max_standby_streaming_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_standby_streaming_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30000"), - // }, - // }, - // { - // Name: to.Ptr("max_sync_workers_per_subscription"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_sync_workers_per_subscription"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Maximum number of table synchronization workers per subscription."), - // AllowedValues: to.Ptr("0-262143"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("max_wal_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_wal_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the WAL size that triggers a checkpoint."), - // AllowedValues: to.Ptr("2-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("min_parallel_index_scan_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_parallel_index_scan_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum amount of index data for a parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("min_parallel_table_scan_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_parallel_table_scan_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum amount of table data for a parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("min_wal_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_wal_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum size to shrink the WAL to."), - // AllowedValues: to.Ptr("2-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("80"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("80"), - // }, - // }, - // { - // Name: to.Ptr("operator_precedence_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/operator_precedence_warning"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Emits a warning for constructs that changed meaning since PostgreSQL 9.4."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("parallel_setup_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_setup_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of starting up worker processes for parallel query."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("parallel_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_tuple_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of passing each tuple (row) from worker to master backend."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("quote_all_identifiers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/quote_all_identifiers"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("When generating SQL fragments, quotes all identifiers."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("random_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/random_page_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a nonsequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }, - // { - // Name: to.Ptr("row_security"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/row_security"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables row security."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("search_path"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/search_path"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."), - // AllowedValues: to.Ptr("[A-Za-z.\"$, ]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("\"$user\", public"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("\"$user\", public"), - // }, - // }, - // { - // Name: to.Ptr("seq_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/seq_page_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a sequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("session_replication_role"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/session_replication_role"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the session's behavior for triggers and rewrite rules."), - // AllowedValues: to.Ptr("origin,replica,local"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("origin"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("origin"), - // }, - // }, - // { - // Name: to.Ptr("standard_conforming_strings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/standard_conforming_strings"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("statement_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/statement_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("synchronize_seqscans"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronize_seqscans"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables synchronized sequential scans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("synchronous_commit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronous_commit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the current transaction's synchronization level."), - // AllowedValues: to.Ptr("local,remote_write,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("tcp_keepalives_count"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_count"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Maximum number of TCP keepalive retransmits."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("9"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("9"), - // }, - // }, - // { - // Name: to.Ptr("tcp_keepalives_idle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_idle"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time between issuing TCP keepalives."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("120"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("120"), - // }, - // }, - // { - // Name: to.Ptr("tcp_keepalives_interval"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_interval"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time between TCP keepalive retransmits."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30"), - // }, - // }, - // { - // Name: to.Ptr("temp_buffers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_buffers"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of temporary buffers used by each database session."), - // AllowedValues: to.Ptr("100-1073741823"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("temp_tablespaces"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_tablespaces"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the tablespace(s) to use for temporary tables and sort files."), - // AllowedValues: to.Ptr("[A-Za-z._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("TimeZone"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/TimeZone"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the time zone for displaying and interpreting time stamps."), - // AllowedValues: to.Ptr("[A-Za-z0-9/+_-]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("UTC"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("UTC"), - // }, - // }, - // { - // Name: to.Ptr("track_activities"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_activities"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects information about executing commands."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("track_counts"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_counts"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects statistics on database activity."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("track_functions"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_functions"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects function-level statistics on database activity."), - // AllowedValues: to.Ptr("none,pl,all"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), - // }, - // }, - // { - // Name: to.Ptr("track_io_timing"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_io_timing"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects timing statistics for database I/O activity."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("transform_null_equals"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/transform_null_equals"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Treats \"expr=NULL\" as \"expr IS NULL\"."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost delay in milliseconds."), - // AllowedValues: to.Ptr("0-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost amount available before napping."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_page_dirty"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_dirty"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost for a page dirtied by vacuum."), - // AllowedValues: to.Ptr("0-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("20"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("20"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_page_hit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_hit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost for a page found in the buffer cache."), - // AllowedValues: to.Ptr("0-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_page_miss"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_miss"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost for a page not found in the buffer cache."), - // AllowedValues: to.Ptr("0-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("10"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("10"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_defer_cleanup_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_defer_cleanup_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of transactions by which VACUUM and HOT cleanup should be deferred, if any."), - // AllowedValues: to.Ptr("0-1000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_freeze_min_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_freeze_min_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum age at which VACUUM should freeze a table row."), - // AllowedValues: to.Ptr("0-1000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("50000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50000000"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_freeze_table_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_freeze_table_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Age at which VACUUM should scan whole table to freeze tuples."), - // AllowedValues: to.Ptr("0-2000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("150000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("150000000"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_multixact_freeze_min_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_multixact_freeze_min_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum age at which VACUUM should freeze a MultiXactId in a table row."), - // AllowedValues: to.Ptr("0-1000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("5000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5000000"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_multixact_freeze_table_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_multixact_freeze_table_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Multixact age at which VACUUM should scan whole table to freeze tuples."), - // AllowedValues: to.Ptr("0-2000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("150000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("150000000"), - // }, - // }, - // { - // Name: to.Ptr("wal_receiver_status_interval"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_receiver_status_interval"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum interval between WAL receiver status reports to the primary."), - // AllowedValues: to.Ptr("0-2147483"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("10"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("10"), - // }, - // }, - // { - // Name: to.Ptr("wal_writer_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_writer_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time between WAL flushes performed in the WAL writer."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("wal_writer_flush_after"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_writer_flush_after"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Amount of WAL written out by WAL writer that triggers a flush."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("128"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("128"), - // }, - // }, - // { - // Name: to.Ptr("work_mem"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/work_mem"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files."), - // AllowedValues: to.Ptr("4096-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("115712"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("115712"), - // }, - // }, - // { - // Name: to.Ptr("xmlbinary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/xmlbinary"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets how binary values are to be encoded in XML."), - // AllowedValues: to.Ptr("base64,hex"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("base64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("base64"), - // }, - // }, - // { - // Name: to.Ptr("xmloption"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/xmloption"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."), - // AllowedValues: to.Ptr("content,document"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("content"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("content"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "testrg", "testserver", "array_nulls", 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 = armpostgresqlflexibleservers.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/array_nulls"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "testrg", "testserver", "event_scheduler", armpostgresqlflexibleservers.ConfigurationForUpdate{ - Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - Source: to.Ptr("user-override"), - 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 = armpostgresqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/event_scheduler"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("ON"), - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go index a8ffe852f9e5..ea722bbe5c03 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go @@ -10,7 +10,7 @@ package armpostgresqlflexibleservers const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers" - moduleVersion = "v4.0.0-beta.5" + moduleVersion = "v4.0.0" ) // ActiveDirectoryAuthEnum - If Enabled, Azure Active Directory authentication is enabled. @@ -598,12 +598,14 @@ func PossibleOperationOriginValues() []OperationOrigin { type Origin string const ( - OriginFull Origin = "Full" + OriginCustomerOnDemand Origin = "Customer On-Demand" + OriginFull Origin = "Full" ) // PossibleOriginValues returns the possible values for the Origin const type. func PossibleOriginValues() []Origin { return []Origin{ + OriginCustomerOnDemand, OriginFull, } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go index 91d53969805c..782a0185e72b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go @@ -46,7 +46,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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) BeginCreate(ctx context.Context, resourceGroupNam // Create - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *DatabasesClient) create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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) createCreateRequest(ctx context.Context, resource // BeginDelete - Deletes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -157,7 +157,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-12-01-preview +// Generated from API version 2024-08-01 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" @@ -203,7 +203,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,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-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -263,7 +263,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // NewListByServerPager - List all the databases in a given server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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 @@ -328,7 +328,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go deleted file mode 100644 index 2feb992e6a72..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseCreate.json -func ExampleDatabasesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "TestGroup", "testserver", "db1", armpostgresqlflexibleservers.Database{ - Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - Charset: to.Ptr("utf8"), - Collation: to.Ptr("en_US.utf8"), - }, - }, 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 = armpostgresqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.DatabaseListResult{ - // Value: []*armpostgresqlflexibleservers.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db2"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go index ffc1de34f60b..2434c9b83f0a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go @@ -24,6 +24,14 @@ import ( // BackupsServer is a fake server for instances of the armpostgresqlflexibleservers.BackupsClient type. type BackupsServer struct { + // BeginCreate is the fake for method BackupsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method BackupsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientDeleteResponse], errResp azfake.ErrorResponder) + // Get is the fake for method BackupsClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.BackupsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.BackupsClientGetResponse], errResp azfake.ErrorResponder) @@ -39,6 +47,8 @@ type BackupsServer struct { func NewBackupsServerTransport(srv *BackupsServer) *BackupsServerTransport { return &BackupsServerTransport{ srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientDeleteResponse]](), newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsClientListByServerResponse]](), } } @@ -47,6 +57,8 @@ func NewBackupsServerTransport(srv *BackupsServer) *BackupsServerTransport { // Don't use this type directly, use NewBackupsServerTransport instead. type BackupsServerTransport struct { srv *BackupsServer + beginCreate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.BackupsClientDeleteResponse]] newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.BackupsClientListByServerResponse]] } @@ -62,6 +74,10 @@ func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { var err error switch method { + case "BackupsClient.BeginCreate": + resp, err = b.dispatchBeginCreate(req) + case "BackupsClient.BeginDelete": + resp, err = b.dispatchBeginDelete(req) case "BackupsClient.Get": resp, err = b.dispatchGet(req) case "BackupsClient.NewListByServerPager": @@ -77,6 +93,102 @@ func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { return resp, nil } +func (b *BackupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if b.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := b.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + 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 + } + backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + b.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + b.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + b.beginCreate.remove(req) + } + + return resp, nil +} + +func (b *BackupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if b.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := b.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + 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 + } + backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + b.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + b.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + b.beginDelete.remove(req) + } + + return resp, nil +} + func (b *BackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if b.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlservermanagement_server.go similarity index 68% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlservermanagement_server.go index bdb33a1752a8..d5405100ba16 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlservermanagement_server.go @@ -21,28 +21,28 @@ import ( "regexp" ) -// PostgreSQLManagementServer is a fake server for instances of the armpostgresqlflexibleservers.PostgreSQLManagementClient type. -type PostgreSQLManagementServer struct { - // CheckMigrationNameAvailability is the fake for method PostgreSQLManagementClient.CheckMigrationNameAvailability +// PostgreSQLServerManagementServer is a fake server for instances of the armpostgresqlflexibleservers.PostgreSQLServerManagementClient type. +type PostgreSQLServerManagementServer struct { + // CheckMigrationNameAvailability is the fake for method PostgreSQLServerManagementClient.CheckMigrationNameAvailability // HTTP status codes to indicate success: http.StatusOK - CheckMigrationNameAvailability func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters armpostgresqlflexibleservers.MigrationNameAvailabilityResource, options *armpostgresqlflexibleservers.PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse], errResp azfake.ErrorResponder) + CheckMigrationNameAvailability func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters armpostgresqlflexibleservers.MigrationNameAvailabilityResource, options *armpostgresqlflexibleservers.PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse], errResp azfake.ErrorResponder) } -// NewPostgreSQLManagementServerTransport creates a new instance of PostgreSQLManagementServerTransport with the provided implementation. -// The returned PostgreSQLManagementServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PostgreSQLManagementClient via the +// NewPostgreSQLServerManagementServerTransport creates a new instance of PostgreSQLServerManagementServerTransport with the provided implementation. +// The returned PostgreSQLServerManagementServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PostgreSQLServerManagementClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewPostgreSQLManagementServerTransport(srv *PostgreSQLManagementServer) *PostgreSQLManagementServerTransport { - return &PostgreSQLManagementServerTransport{srv: srv} +func NewPostgreSQLServerManagementServerTransport(srv *PostgreSQLServerManagementServer) *PostgreSQLServerManagementServerTransport { + return &PostgreSQLServerManagementServerTransport{srv: srv} } -// PostgreSQLManagementServerTransport connects instances of armpostgresqlflexibleservers.PostgreSQLManagementClient to instances of PostgreSQLManagementServer. -// Don't use this type directly, use NewPostgreSQLManagementServerTransport instead. -type PostgreSQLManagementServerTransport struct { - srv *PostgreSQLManagementServer +// PostgreSQLServerManagementServerTransport connects instances of armpostgresqlflexibleservers.PostgreSQLServerManagementClient to instances of PostgreSQLServerManagementServer. +// Don't use this type directly, use NewPostgreSQLServerManagementServerTransport instead. +type PostgreSQLServerManagementServerTransport struct { + srv *PostgreSQLServerManagementServer } -// Do implements the policy.Transporter interface for PostgreSQLManagementServerTransport. -func (p *PostgreSQLManagementServerTransport) Do(req *http.Request) (*http.Response, error) { +// Do implements the policy.Transporter interface for PostgreSQLServerManagementServerTransport. +func (p *PostgreSQLServerManagementServerTransport) Do(req *http.Request) (*http.Response, error) { rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) method, ok := rawMethod.(string) if !ok { @@ -53,7 +53,7 @@ func (p *PostgreSQLManagementServerTransport) Do(req *http.Request) (*http.Respo var err error switch method { - case "PostgreSQLManagementClient.CheckMigrationNameAvailability": + case "PostgreSQLServerManagementClient.CheckMigrationNameAvailability": resp, err = p.dispatchCheckMigrationNameAvailability(req) default: err = fmt.Errorf("unhandled API %s", method) @@ -66,7 +66,7 @@ func (p *PostgreSQLManagementServerTransport) Do(req *http.Request) (*http.Respo return resp, nil } -func (p *PostgreSQLManagementServerTransport) dispatchCheckMigrationNameAvailability(req *http.Request) (*http.Response, error) { +func (p *PostgreSQLServerManagementServerTransport) dispatchCheckMigrationNameAvailability(req *http.Request) (*http.Response, error) { if p.srv.CheckMigrationNameAvailability == nil { return nil, &nonRetriableError{errors.New("fake for method CheckMigrationNameAvailability not implemented")} } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go deleted file mode 100644 index 67c9e3810b25..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go +++ /dev/null @@ -1,108 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" - "net/http" - "net/url" - "regexp" -) - -// QuotaUsagesServer is a fake server for instances of the armpostgresqlflexibleservers.QuotaUsagesClient type. -type QuotaUsagesServer struct { - // NewListPager is the fake for method QuotaUsagesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(locationName string, options *armpostgresqlflexibleservers.QuotaUsagesClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.QuotaUsagesClientListResponse]) -} - -// NewQuotaUsagesServerTransport creates a new instance of QuotaUsagesServerTransport with the provided implementation. -// The returned QuotaUsagesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.QuotaUsagesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewQuotaUsagesServerTransport(srv *QuotaUsagesServer) *QuotaUsagesServerTransport { - return &QuotaUsagesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.QuotaUsagesClientListResponse]](), - } -} - -// QuotaUsagesServerTransport connects instances of armpostgresqlflexibleservers.QuotaUsagesClient to instances of QuotaUsagesServer. -// Don't use this type directly, use NewQuotaUsagesServerTransport instead. -type QuotaUsagesServerTransport struct { - srv *QuotaUsagesServer - newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.QuotaUsagesClientListResponse]] -} - -// Do implements the policy.Transporter interface for QuotaUsagesServerTransport. -func (q *QuotaUsagesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "QuotaUsagesClient.NewListPager": - resp, err = q.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (q *QuotaUsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if q.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := q.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceType/flexibleServers/usages` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) - if err != nil { - return nil, err - } - resp := q.srv.NewListPager(locationNameParam, nil) - newListPager = &resp - q.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.QuotaUsagesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - q.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - q.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go index d2aac137a47a..2afb2a05c9d8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go @@ -33,11 +33,10 @@ type ServerFactory struct { LtrBackupOperationsServer LtrBackupOperationsServer MigrationsServer MigrationsServer OperationsServer OperationsServer - PostgreSQLManagementServer PostgreSQLManagementServer + PostgreSQLServerManagementServer PostgreSQLServerManagementServer PrivateEndpointConnectionServer PrivateEndpointConnectionServer PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer PrivateLinkResourcesServer PrivateLinkResourcesServer - QuotaUsagesServer QuotaUsagesServer ReplicasServer ReplicasServer ServerCapabilitiesServer ServerCapabilitiesServer ServerThreatProtectionSettingsServer ServerThreatProtectionSettingsServer @@ -74,11 +73,10 @@ type ServerFactoryTransport struct { trLtrBackupOperationsServer *LtrBackupOperationsServerTransport trMigrationsServer *MigrationsServerTransport trOperationsServer *OperationsServerTransport - trPostgreSQLManagementServer *PostgreSQLManagementServerTransport + trPostgreSQLServerManagementServer *PostgreSQLServerManagementServerTransport trPrivateEndpointConnectionServer *PrivateEndpointConnectionServerTransport trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQuotaUsagesServer *QuotaUsagesServerTransport trReplicasServer *ReplicasServerTransport trServerCapabilitiesServer *ServerCapabilitiesServerTransport trServerThreatProtectionSettingsServer *ServerThreatProtectionSettingsServerTransport @@ -160,11 +158,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) - case "PostgreSQLManagementClient": - initServer(s, &s.trPostgreSQLManagementServer, func() *PostgreSQLManagementServerTransport { - return NewPostgreSQLManagementServerTransport(&s.srv.PostgreSQLManagementServer) + case "PostgreSQLServerManagementClient": + initServer(s, &s.trPostgreSQLServerManagementServer, func() *PostgreSQLServerManagementServerTransport { + return NewPostgreSQLServerManagementServerTransport(&s.srv.PostgreSQLServerManagementServer) }) - resp, err = s.trPostgreSQLManagementServer.Do(req) + resp, err = s.trPostgreSQLServerManagementServer.Do(req) case "PrivateEndpointConnectionClient": initServer(s, &s.trPrivateEndpointConnectionServer, func() *PrivateEndpointConnectionServerTransport { return NewPrivateEndpointConnectionServerTransport(&s.srv.PrivateEndpointConnectionServer) @@ -180,9 +178,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) }) resp, err = s.trPrivateLinkResourcesServer.Do(req) - case "QuotaUsagesClient": - initServer(s, &s.trQuotaUsagesServer, func() *QuotaUsagesServerTransport { return NewQuotaUsagesServerTransport(&s.srv.QuotaUsagesServer) }) - resp, err = s.trQuotaUsagesServer.Do(req) case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go index 76d49a313054..aa79e452ac9b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -74,7 +74,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-12-01-preview +// Generated from API version 2024-08-01 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" @@ -120,7 +120,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a PostgreSQL server firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -159,7 +159,7 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a PostgreSQL server firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 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" @@ -205,7 +205,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - List all the firewall rules in a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -265,7 +265,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListByServerPager - List all the firewall rules in a given PostgreSQL server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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 @@ -330,7 +330,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go deleted file mode 100644 index aeb0a869d4bb..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "testrg", "testserver", "rule1", armpostgresqlflexibleservers.FirewallRule{ - Properties: &armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "testrg", "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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "testrg", "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 = armpostgresqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("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.FirewallRuleListResult = armpostgresqlflexibleservers.FirewallRuleListResult{ - // Value: []*armpostgresqlflexibleservers.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule2"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go index 33e59f5ce068..8df43b9f6213 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go @@ -46,7 +46,7 @@ func NewFlexibleServerClient(subscriptionID string, credential azcore.TokenCrede // BeginStartLtrBackup - Start the Long Term Retention Backup operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - Request body for operation @@ -73,7 +73,7 @@ func (client *FlexibleServerClient) BeginStartLtrBackup(ctx context.Context, res // StartLtrBackup - Start the Long Term Retention Backup operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *FlexibleServerClient) startLtrBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, options *FlexibleServerClientBeginStartLtrBackupOptions) (*http.Response, error) { var err error const operationName = "FlexibleServerClient.BeginStartLtrBackup" @@ -115,7 +115,7 @@ func (client *FlexibleServerClient) startLtrBackupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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 *FlexibleServerClient) startLtrBackupCreateRequest(ctx context.Cont // backup operation to succeed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - Request body for operation @@ -176,7 +176,7 @@ func (client *FlexibleServerClient) triggerLtrPreBackupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go deleted file mode 100644 index 7ea34c59d3ad..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go +++ /dev/null @@ -1,91 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionPreBackup.json -func ExampleFlexibleServerClient_TriggerLtrPreBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFlexibleServerClient().TriggerLtrPreBackup(ctx, "rgLongTermRetention", "pgsqlltrtestserver", armpostgresqlflexibleservers.LtrPreBackupRequest{ - BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ - BackupName: to.Ptr("backup1"), - }, - }, 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.LtrPreBackupResponse = armpostgresqlflexibleservers.LtrPreBackupResponse{ - // Properties: &armpostgresqlflexibleservers.LtrPreBackupResponseProperties{ - // NumberOfContainers: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionBackup.json -func ExampleFlexibleServerClient_BeginStartLtrBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFlexibleServerClient().BeginStartLtrBackup(ctx, "rgLongTermRetention", "pgsqlltrtestserver", armpostgresqlflexibleservers.LtrBackupRequest{ - BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ - BackupName: to.Ptr("backup1"), - }, - TargetDetails: &armpostgresqlflexibleservers.BackupStoreDetails{ - SasURIList: []*string{ - to.Ptr("sasuri")}, - }, - }, 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.LtrBackupResponse = armpostgresqlflexibleservers.LtrBackupResponse{ - // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ - // BackupMetadata: to.Ptr("backupmetadata"), - // DataTransferredInBytes: to.Ptr[int64](23), - // DatasourceSizeInBytes: to.Ptr[int64](23), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // PercentComplete: to.Ptr[float64](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go index 2706fe5b2308..e3178c9f1e52 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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-01-preview +// Generated from API version 2024-08-01 // - 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-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go deleted file mode 100644 index d80bd2e864e7..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go +++ /dev/null @@ -1,39 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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.Value = "postgres.database.azure.com" -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod index 646c9957b1af..cbf96c442376 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostg 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/postgresql/armpostgresqlflexibleservers/go.sum b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.sum +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go index f22c3439a214..6f43bd57cf99 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go @@ -45,7 +45,7 @@ func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore // NewExecutePager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - locationName - The name of the location. // - options - LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewExecutePager // method. @@ -88,7 +88,7 @@ func (client *LocationBasedCapabilitiesClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go deleted file mode 100644 index 4c6732511aa8..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go +++ /dev/null @@ -1,1706 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CapabilitiesByLocation.json -func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedCapabilitiesClient().NewExecutePager("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 = armpostgresqlflexibleservers.CapabilitiesListResult{ - // Value: []*armpostgresqlflexibleservers.FlexibleServerCapability{ - // { - // Name: to.Ptr("FlexibleServerCapabilities"), - // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportedEnumEnabled), - // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeoBackupSupportedEnumEnabled), - // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineResizeSupportedEnumDisabled), - // Restricted: to.Ptr(armpostgresqlflexibleservers.RestrictedEnumDisabled), - // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportedEnumEnabled), - // SupportedFastProvisioningEditions: []*armpostgresqlflexibleservers.FastProvisioningEditionCapability{ - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }, - // { - // ServerCount: to.Ptr[int32](23), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }}, - // SupportedServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // DefaultSKUName: to.Ptr("Standard_B1ms"), - // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](640), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](1280), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](1700), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](2400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3100), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_B12ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](12), - // }, - // { - // Name: to.Ptr("Standard_B16ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4300), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_B20ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](5000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](20), - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](32768), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("P4"), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](120), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int32](120), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P6"), - // StorageSizeMb: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int32](240), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P10"), - // StorageSizeMb: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int32](500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P15"), - // StorageSizeMb: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int32](1100), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P20"), - // StorageSizeMb: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int32](2300), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P30"), - // StorageSizeMb: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int32](5000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P40"), - // StorageSizeMb: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P50"), - // StorageSizeMb: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P60"), - // StorageSizeMb: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int32](16000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P60"), - // Iops: to.Ptr[int32](16000), - // }, - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P70"), - // StorageSizeMb: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int32](18000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P80"), - // StorageSizeMb: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int32](20000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("ManagedDiskV2"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](3000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](80000), - // SupportedMaximumThroughput: to.Ptr[int32](750), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKUName: to.Ptr("Standard_D2ds_v4"), - // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_D2ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_D4ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_D8ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_D16ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_D32ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_D48ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_D64ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_D96ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("P4"), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](120), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int32](120), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P6"), - // StorageSizeMb: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int32](240), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P10"), - // StorageSizeMb: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int32](500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P15"), - // StorageSizeMb: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int32](1100), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P20"), - // StorageSizeMb: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int32](2300), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P30"), - // StorageSizeMb: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int32](5000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P40"), - // StorageSizeMb: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P50"), - // StorageSizeMb: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P60"), - // StorageSizeMb: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int32](16000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P60"), - // Iops: to.Ptr[int32](16000), - // }, - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P70"), - // StorageSizeMb: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int32](18000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P80"), - // StorageSizeMb: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int32](20000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("ManagedDiskV2"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](3000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](80000), - // SupportedMaximumThroughput: to.Ptr[int32](750), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKUName: to.Ptr("Standard_E2ds_v4"), - // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_E2ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_E4ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_E8ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_E16ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_E32ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_E48ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_E64ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_E96ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](131072), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("P4"), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](120), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int32](120), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P6"), - // StorageSizeMb: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int32](240), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P10"), - // StorageSizeMb: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int32](500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P15"), - // StorageSizeMb: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int32](1100), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P20"), - // StorageSizeMb: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int32](2300), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P30"), - // StorageSizeMb: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int32](5000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P40"), - // StorageSizeMb: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P50"), - // StorageSizeMb: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P60"), - // StorageSizeMb: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int32](16000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P60"), - // Iops: to.Ptr[int32](16000), - // }, - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P70"), - // StorageSizeMb: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int32](18000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P80"), - // StorageSizeMb: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int32](20000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("ManagedDiskV2"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](3000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](80000), - // SupportedMaximumThroughput: to.Ptr[int32](750), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }}, - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14"), - // to.Ptr("15")}, - // }, - // { - // Name: to.Ptr("12"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("13"), - // to.Ptr("14"), - // to.Ptr("15")}, - // }, - // { - // Name: to.Ptr("13"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("14"), - // to.Ptr("15")}, - // }, - // { - // Name: to.Ptr("14"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("15")}, - // }}, - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaAndGeoBackupSupportedEnumEnabled), - // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaSupportedEnumEnabled), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go index 8c9e17eb9c18..f55bfbf76ada 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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-12-01-preview +// Generated from API version 2024-08-01 // - 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-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go deleted file mode 100644 index 00d317ae9453..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLogFilesClient().NewListByServerPager("testrg", "postgresqltestsvc1", 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 = armpostgresqlflexibleservers.LogFileListResult{ - // Value: []*armpostgresqlflexibleservers.LogFile{ - // { - // Name: to.Ptr("postgresql-slow-postgresqltestsvc1-2018022823.log"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestsvc1/logFiles/postgresql-slow-postgresqltestsvc1-2018022823.log"), - // Properties: &armpostgresqlflexibleservers.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/postgresql-slow-postgresqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&se=2018-03-01T07%3A12%3A13Z&sp=r"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go index 2b6956a8376e..6f151c9ccdad 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go @@ -46,7 +46,7 @@ func NewLtrBackupOperationsClient(subscriptionID string, credential azcore.Token // Get - Gets the result of the give long term retention backup operation for the flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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 *LtrBackupOperationsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *LtrBackupOperationsClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the result of the give long term retention backup operations for the flexible server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - LtrBackupOperationsClientListByServerOptions contains the optional parameters for the LtrBackupOperationsClient.NewListByServerPager @@ -162,7 +162,7 @@ func (client *LtrBackupOperationsClient) listByServerCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go deleted file mode 100644 index fc127db6622b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationGet.json -func ExampleLtrBackupOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLtrBackupOperationsClient().Get(ctx, "rgLongTermRetention", "pgsqlltrtestserver", "backup1", 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.LtrServerBackupOperation = armpostgresqlflexibleservers.LtrServerBackupOperation{ - // Name: to.Ptr("backup1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rgLongTermRetention/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsqlltrtestserver"), - // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ - // BackupMetadata: to.Ptr("backupMetadata"), - // BackupName: to.Ptr("backup1"), - // DataTransferredInBytes: to.Ptr[int64](9), - // DatasourceSizeInBytes: to.Ptr[int64](21), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // PercentComplete: to.Ptr[float64](4), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationListByServer.json -func ExampleLtrBackupOperationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLtrBackupOperationsClient().NewListByServerPager("rgLongTermRetention", "pgsqlltrtestserver", 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.LtrServerBackupOperationList = armpostgresqlflexibleservers.LtrServerBackupOperationList{ - // Value: []*armpostgresqlflexibleservers.LtrServerBackupOperation{ - // { - // Name: to.Ptr("backup1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rgLongTermRetention/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsqlltrtestserver"), - // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ - // BackupMetadata: to.Ptr("backupMetadata"), - // BackupName: to.Ptr("backup1"), - // DataTransferredInBytes: to.Ptr[int64](9), - // DatasourceSizeInBytes: to.Ptr[int64](21), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // PercentComplete: to.Ptr[float64](4), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), - // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go index d2c1baaf144b..144555882423 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go @@ -43,7 +43,7 @@ func NewMigrationsClient(credential azcore.TokenCredential, options *arm.ClientO // Create - Creates a new migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - subscriptionID - The subscription ID of the target database server. // - resourceGroupName - The resource group name of the target database server. // - targetDbServerName - The name of the target database server. @@ -96,7 +96,7 @@ func (client *MigrationsClient) createCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -117,7 +117,7 @@ func (client *MigrationsClient) createHandleResponse(resp *http.Response) (Migra // Delete - Deletes a migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - subscriptionID - The subscription ID of the target database server. // - resourceGroupName - The resource group name of the target database server. // - targetDbServerName - The name of the target database server. @@ -168,7 +168,7 @@ func (client *MigrationsClient) deleteCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,7 @@ func (client *MigrationsClient) deleteCreateRequest(ctx context.Context, subscri // Get - Gets details of a migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - subscriptionID - The subscription ID of the target database server. // - resourceGroupName - The resource group name of the target database server. // - targetDbServerName - The name of the target database server. @@ -229,7 +229,7 @@ func (client *MigrationsClient) getCreateRequest(ctx context.Context, subscripti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,7 @@ func (client *MigrationsClient) getHandleResponse(resp *http.Response) (Migratio // NewListByTargetServerPager - List all the migrations on a given target server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - subscriptionID - The subscription ID of the target database server. // - resourceGroupName - The resource group name of the target database server. // - targetDbServerName - The name of the target database server. @@ -295,7 +295,7 @@ func (client *MigrationsClient) listByTargetServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") if options != nil && options.MigrationListFilter != nil { reqQP.Set("migrationListFilter", string(*options.MigrationListFilter)) } @@ -317,7 +317,7 @@ func (client *MigrationsClient) listByTargetServerHandleResponse(resp *http.Resp // migration definition. Certain property updates initiate migration state transitions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - subscriptionID - The subscription ID of the target database server. // - resourceGroupName - The resource group name of the target database server. // - targetDbServerName - The name of the target database server. @@ -370,7 +370,7 @@ func (client *MigrationsClient) updateCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go deleted file mode 100644 index b5237d105f72..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go +++ /dev/null @@ -1,1230 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json -func ExampleMigrationsClient_Create_createMigrationWithOtherSourceTypesForValidateAndMigrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ - AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), - }, - }, - SourceDbServerResourceID: to.Ptr("testsource:5432@pguser"), - SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), - SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateValidationInProgress), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("testsource:5432@pguser"), - // SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), - // SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Validate_Only.json -func ExampleMigrationsClient_Create_createPreMigrationValidation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ - AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), - }, - }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateValidationInProgress), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Other_Users.json -func ExampleMigrationsClient_Create_migrationsCreateByPassingUserNames() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ - AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), - }, - SourceServerUsername: to.Ptr("newadmin@testsource"), - TargetServerUsername: to.Ptr("targetadmin"), - }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_PrivateEndpoint_Servers.json -func ExampleMigrationsClient_Create_migrationsCreateWithPrivateEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ - AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), - }, - }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Roles.json -func ExampleMigrationsClient_Create_migrationsCreateWithRoles() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumTrue), - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ - AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), - }, - }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumTrue), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create.json -func ExampleMigrationsClient_Create_migrationsCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - DbsToMigrate: []*string{ - to.Ptr("db1"), - to.Ptr("db2"), - to.Ptr("db3"), - to.Ptr("db4")}, - MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ - AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ - SourceServerPassword: to.Ptr("xxxxxxxx"), - TargetServerPassword: to.Ptr("xxxxxxxx"), - }, - }, - SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Get.json -func ExampleMigrationsClient_Get_migrationsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("B_Gen5_2"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), - // }, - // StorageMb: to.Ptr[int32](1024), - // Version: to.Ptr("10"), - // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // StorageMb: to.Ptr[int32](2048), - // Version: to.Ptr("11"), - // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationAndMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationandmigration", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithsuccessfulvalidationandmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationandmigration"), - // Location: to.Ptr("eastus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ - // "testdb3": &armpostgresqlflexibleservers.DbMigrationStatus{ - // AppliedChanges: to.Ptr[int32](0), - // CdcDeleteCounter: to.Ptr[int32](0), - // CdcInsertCounter: to.Ptr[int32](0), - // CdcUpdateCounter: to.Ptr[int32](0), - // DatabaseName: to.Ptr("testdb3"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:49.681Z"); return t}()), - // FullLoadCompletedTables: to.Ptr[int32](10), - // FullLoadErroredTables: to.Ptr[int32](0), - // FullLoadLoadingTables: to.Ptr[int32](0), - // FullLoadQueuedTables: to.Ptr[int32](0), - // IncomingChanges: to.Ptr[int32](0), - // Latency: to.Ptr[int32](0), - // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateSucceeded), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:28.995Z"); return t}()), - // }, - // }, - // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ - // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ - // { - // DatabaseName: to.Ptr("testdb3"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.894Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.553Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("CollationsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }}, - // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("AuthenticationAndConnectivityValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("SourceVersionValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ServerParametersValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:00.499Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:28.077Z"); return t}()), - // }, - // }, - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("testdb3")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("f2354e72-2828-4a19-ad20-b4cd9e2673c1"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:57:30.736Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:15.999Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationbutmigrationfailure", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithsuccessfulvalidationbutmigrationfailure"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationbutmigrationfailure"), - // Location: to.Ptr("eastus2"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ - // "testdb6": &armpostgresqlflexibleservers.DbMigrationStatus{ - // AppliedChanges: to.Ptr[int32](0), - // CdcDeleteCounter: to.Ptr[int32](0), - // CdcInsertCounter: to.Ptr[int32](0), - // CdcUpdateCounter: to.Ptr[int32](0), - // DatabaseName: to.Ptr("testdb6"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:53.252Z"); return t}()), - // FullLoadCompletedTables: to.Ptr[int32](0), - // FullLoadErroredTables: to.Ptr[int32](0), - // FullLoadLoadingTables: to.Ptr[int32](0), - // FullLoadQueuedTables: to.Ptr[int32](0), - // IncomingChanges: to.Ptr[int32](0), - // Latency: to.Ptr[int32](0), - // Message: to.Ptr("Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."), - // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateFailed), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:52.922Z"); return t}()), - // }, - // }, - // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ - // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ - // { - // DatabaseName: to.Ptr("address_standardizer"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }}, - // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("AuthenticationAndConnectivityValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:21.623Z"); return t}()), - // }, - // }, - // Error: to.Ptr("testdb6: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration. "), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateFailed), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("testdb6")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("da52db29-cfeb-4670-a1ad-683edb14c621"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("eastus2"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // }, - // StorageMb: to.Ptr[int32](102400), - // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/source-rg/providers/Microsoft.DBforPostgreSQL/servers/testsource"), - // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("East US 2"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")), - // }, - // StorageMb: to.Ptr[int32](131072), - // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationonly", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithsuccessfulvalidationonly"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationonly"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ - // }, - // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ - // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ - // { - // DatabaseName: to.Ptr("UnknownCollationTest"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.248Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:38.904Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("CollationsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }}, - // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("AuthenticationAndConnectivityValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("SourceVersionValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ServerParametersValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.666Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:35.634Z"); return t}()), - // }, - // }, - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("UnknownCollationTest")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("77840327-7be8-44b8-adc0-af0ccccfeb36"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:30:05.885Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:28:58.775Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json -func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithvalidationfailure", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigrationwithvalidationfailure"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget/migrations/testmigrationwithvalidationfailure"), - // Location: to.Ptr("East US"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ - // }, - // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ - // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ - // { - // DatabaseName: to.Ptr("c.utf-8"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // Messages: []*armpostgresqlflexibleservers.ValidationMessage{ - // { - // Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), - // }}, - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), - // }, - // { - // Type: to.Ptr("CollationsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }, - // { - // DatabaseName: to.Ptr("postgres"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("CollationsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }, - // { - // DatabaseName: to.Ptr("readme_to_recover"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("CollationsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }, - // { - // DatabaseName: to.Ptr("testdb1"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }, - // { - // DatabaseName: to.Ptr("testdb2"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }, - // { - // DatabaseName: to.Ptr("testSchema"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // }, - // { - // DatabaseName: to.Ptr("UnknownCollationTest"), - // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), - // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), - // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("SchemaValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ExtensionsValidation"), - // Messages: []*armpostgresqlflexibleservers.ValidationMessage{ - // { - // Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), - // }}, - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), - // }}, - // }}, - // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ - // { - // Type: to.Ptr("AuthenticationAndConnectivityValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("SourceVersionValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }, - // { - // Type: to.Ptr("ServerParametersValidation"), - // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), - // }}, - // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), - // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:33.136Z"); return t}()), - // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:59.917Z"); return t}()), - // }, - // }, - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateValidationFailed), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("c.utf-8"), - // to.Ptr("postgres"), - // to.Ptr("readme_to_recover"), - // to.Ptr("testdb1"), - // to.Ptr("testdb2"), - // to.Ptr("testSchema"), - // to.Ptr("UnknownCollationTest")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("a3e2d3cc-b139-4201-9431-e4f3003140fd"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), - // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:21:00.043Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:47.448Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Cancel.json -func ExampleMigrationsClient_Update_cancelMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Update(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ - Properties: &armpostgresqlflexibleservers.MigrationResourcePropertiesForPatch{ - Cancel: to.Ptr(armpostgresqlflexibleservers.CancelEnumTrue), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateCanceled), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("postgres")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOnline), - // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-15T07:23:56.326Z"); return t}()), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-15T07:22:57.700Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("eastasia"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("B_Gen5_2"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), - // }, - // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("East Asia"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")), - // }, - // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Update.json -func ExampleMigrationsClient_Update_migrationsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationsClient().Update(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ - Properties: &armpostgresqlflexibleservers.MigrationResourcePropertiesForPatch{ - SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - }, - }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), - // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("B_Gen5_2"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), - // }, - // StorageMb: to.Ptr[int32](1024), - // Version: to.Ptr("10"), - // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // StorageMb: to.Ptr[int32](2048), - // Version: to.Ptr("11"), - // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Delete.json -func ExampleMigrationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMigrationsClient().Delete(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_ListByTargetServer.json -func ExampleMigrationsClient_NewListByTargetServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMigrationsClient().NewListByTargetServerPager("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", &armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions{MigrationListFilter: to.Ptr(armpostgresqlflexibleservers.MigrationListFilterAll)}) - 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.MigrationResourceListResult = armpostgresqlflexibleservers.MigrationResourceListResult{ - // Value: []*armpostgresqlflexibleservers.MigrationResource{ - // { - // Name: to.Ptr("testmigration"), - // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ - // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ - // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ - // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), - // }, - // Error: to.Ptr(""), - // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), - // }, - // DbsToMigrate: []*string{ - // to.Ptr("db1"), - // to.Ptr("db2"), - // to.Ptr("db3"), - // to.Ptr("db4")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), - // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), - // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), - // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("B_Gen5_2"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), - // }, - // StorageMb: to.Ptr[int32](1024), - // Version: to.Ptr("10"), - // }, - // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), - // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), - // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ - // Location: to.Ptr("westus"), - // SKU: &armpostgresqlflexibleservers.ServerSKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // StorageMb: to.Ptr[int32](2048), - // Version: to.Ptr("11"), - // }, - // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), - // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go index d853b32e2120..1dec5e862b41 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go @@ -168,10 +168,10 @@ type ConfigurationListResult struct { // ConfigurationProperties - The properties of a configuration. type ConfigurationProperties struct { - // Source of the configuration. + // Source of the configuration. Required to update the configuration. Source *string - // Value of the configuration. + // Value of the configuration. Required to update the configuration. Value *string // READ-ONLY; Allowed values of the configuration. @@ -757,8 +757,8 @@ type MigrationResourceProperties struct { // Indicates whether to setup LogicalReplicationOnSourceDb, if needed SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum - // Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it - // for connection + // Source server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration + // service will always use it for connection SourceDbServerFullyQualifiedDomainName *string // ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source types this @@ -772,8 +772,8 @@ type MigrationResourceProperties struct { // Indicates whether the data migration should start right away StartDataMigration *StartDataMigrationEnum - // Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it - // for connection + // Target server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration + // service will always use it for connection TargetDbServerFullyQualifiedDomainName *string // To trigger cutover for entire migration we need to send this flag as True @@ -829,8 +829,8 @@ type MigrationResourcePropertiesForPatch struct { // Indicates whether to setup LogicalReplicationOnSourceDb, if needed SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum - // Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it - // for connection + // Source server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration + // service will always use it for connection SourceDbServerFullyQualifiedDomainName *string // ResourceId of the source database server @@ -839,8 +839,8 @@ type MigrationResourcePropertiesForPatch struct { // Indicates whether the data migration should start right away StartDataMigration *StartDataMigrationEnum - // Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it - // for connection + // Target server fully qualified domain name (FQDN) or IP address. It is a optional value, if customer provide it, migration + // service will always use it for connection TargetDbServerFullyQualifiedDomainName *string // To trigger cutover for entire migration we need to send this flag as True @@ -901,15 +901,6 @@ type NameAvailability struct { Type *string } -// NameProperty - Name property for quota usage -type NameProperty struct { - // Localized name - LocalizedValue *string - - // Name value - Value *string -} - // Network properties of a server. type Network struct { // Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, @@ -1068,33 +1059,6 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } -// QuotaUsage - Quota usage for flexible servers -type QuotaUsage struct { - // Current Quota usage value - CurrentValue *int64 - - // Fully qualified ARM resource Id - ID *string - - // Quota limit - Limit *int64 - - // Name of quota usage for flexible servers - Name *NameProperty - - // Quota unit - Unit *string -} - -// QuotaUsagesListResult - Capability for the PostgreSQL server -type QuotaUsagesListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string - - // READ-ONLY; A list of quota usages. - Value []*QuotaUsage -} - // Replica properties of a server type Replica struct { // Sets the promote mode for a replica server. This is a write only property. @@ -1297,6 +1261,10 @@ type ServerProperties struct { } type ServerPropertiesForUpdate struct { + // The administrator's login name of a server. Can only be specified when the server is trying to switch to password authentication + // and does not have default administrator login. + AdministratorLogin *string + // The password of the administrator login. AdministratorLoginPassword *string diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go index 4009ce36f1f4..bb4551fcac80 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go @@ -2182,37 +2182,6 @@ func (n *NameAvailability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NameProperty. -func (n NameProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "localizedValue", n.LocalizedValue) - populate(objectMap, "value", n.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NameProperty. -func (n *NameProperty) 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", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Network. func (n Network) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2645,80 +2614,6 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaUsage. -func (q QuotaUsage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentValue", q.CurrentValue) - populate(objectMap, "id", q.ID) - populate(objectMap, "limit", q.Limit) - populate(objectMap, "name", q.Name) - populate(objectMap, "unit", q.Unit) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsage. -func (q *QuotaUsage) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &q.CurrentValue) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &q.ID) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &q.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &q.Name) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &q.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QuotaUsagesListResult. -func (q QuotaUsagesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", q.NextLink) - populate(objectMap, "value", q.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsagesListResult. -func (q *QuotaUsagesListResult) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &q.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Replica. func (r Replica) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3172,6 +3067,7 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForUpdate. func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", s.AdministratorLogin) populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) populate(objectMap, "authConfig", s.AuthConfig) populate(objectMap, "backup", s.Backup) @@ -3196,6 +3092,9 @@ func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) + delete(rawMsg, key) case "administratorLoginPassword": err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) delete(rawMsg, key) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go index f21c2cc23ac8..121ef9f9b726 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - Lists all of the available REST API operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { var err error @@ -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-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go deleted file mode 100644 index 0e3552604848..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go +++ /dev/null @@ -1,204 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.OperationListResult{ - // Value: []*armpostgresqlflexibleservers.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/read"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get PostgreSQL Servers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/write"), - // Display: &armpostgresqlflexibleservers.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 PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/delete"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/read"), - // Display: &armpostgresqlflexibleservers.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 PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/write"), - // Display: &armpostgresqlflexibleservers.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 PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/delete"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armpostgresqlflexibleservers.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 PostgreSQL"), - // 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": "compute_limit", - // "aggregationType": "Average", - // "displayDescription": "Compute Unit limit", - // "displayName": "Compute Unit limit", - // "unit": "Count", - // }, - // map[string]any{ - // "name": "compute_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "Compute Unit percentage", - // "displayName": "Compute Unit percentage", - // "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": "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", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armpostgresqlflexibleservers.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 PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go index f52d3dbbe0aa..164f6fa65136 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go @@ -31,6 +31,18 @@ type AdministratorsClientListByServerOptions struct { // placeholder for future optional parameters } +// BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. +type BackupsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. +type BackupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. type BackupsClientGetOptions struct { // placeholder for future optional parameters @@ -195,9 +207,9 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } -// PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability +// PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLServerManagementClient.CheckMigrationNameAvailability // method. -type PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions struct { +type PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions struct { // placeholder for future optional parameters } @@ -238,11 +250,6 @@ type PrivateLinkResourcesClientListByServerOptions struct { // placeholder for future optional parameters } -// QuotaUsagesClientListOptions contains the optional parameters for the QuotaUsagesClient.NewListPager method. -type QuotaUsagesClientListOptions struct { - // placeholder for future optional parameters -} - // ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method. type ReplicasClientListByServerOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go deleted file mode 100644 index c32bff212399..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckMigrationNameAvailability.json -func ExamplePostgreSQLManagementClient_CheckMigrationNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostgreSQLManagementClient().CheckMigrationNameAvailability(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", armpostgresqlflexibleservers.MigrationNameAvailabilityResource{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - }, 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.MigrationNameAvailabilityResource = armpostgresqlflexibleservers.MigrationNameAvailabilityResource{ - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), - // NameAvailable: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client.go similarity index 61% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client.go index 4fbe7ed4f0f0..ab7a1c324c91 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client.go @@ -20,21 +20,21 @@ import ( "strings" ) -// PostgreSQLManagementClient contains the methods for the PostgreSQLManagementClient group. -// Don't use this type directly, use NewPostgreSQLManagementClient() instead. -type PostgreSQLManagementClient struct { +// PostgreSQLServerManagementClient contains the methods for the PostgreSQLServerManagementClient group. +// Don't use this type directly, use NewPostgreSQLServerManagementClient() instead. +type PostgreSQLServerManagementClient struct { internal *arm.Client } -// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient with the specified values. +// NewPostgreSQLServerManagementClient creates a new instance of PostgreSQLServerManagementClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. -func NewPostgreSQLManagementClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PostgreSQLManagementClient, error) { +func NewPostgreSQLServerManagementClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PostgreSQLServerManagementClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } - client := &PostgreSQLManagementClient{ + client := &PostgreSQLServerManagementClient{ internal: cl, } return client, nil @@ -43,37 +43,37 @@ func NewPostgreSQLManagementClient(credential azcore.TokenCredential, options *a // CheckMigrationNameAvailability - This method checks whether a proposed migration name is valid and available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - subscriptionID - The subscription ID of the target database server. // - resourceGroupName - The resource group name of the target database server. // - targetDbServerName - The name of the target database server. // - parameters - The required parameters for checking if a migration name is available. -// - options - PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability -// method. -func (client *PostgreSQLManagementClient) CheckMigrationNameAvailability(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { +// - options - PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the +// PostgreSQLServerManagementClient.CheckMigrationNameAvailability method. +func (client *PostgreSQLServerManagementClient) CheckMigrationNameAvailability(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse, error) { var err error - const operationName = "PostgreSQLManagementClient.CheckMigrationNameAvailability" + const operationName = "PostgreSQLServerManagementClient.CheckMigrationNameAvailability" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.checkMigrationNameAvailabilityCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, parameters, options) if err != nil { - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err } resp, err := client.checkMigrationNameAvailabilityHandleResponse(httpResp) return resp, err } // checkMigrationNameAvailabilityCreateRequest creates the CheckMigrationNameAvailability request. -func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (*policy.Request, error) { +func (client *PostgreSQLServerManagementClient) checkMigrationNameAvailabilityCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/checkMigrationNameAvailability" if subscriptionID == "" { return nil, errors.New("parameter subscriptionID cannot be empty") @@ -92,7 +92,7 @@ func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -102,10 +102,10 @@ func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityCreateRe } // checkMigrationNameAvailabilityHandleResponse handles the CheckMigrationNameAvailability response. -func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityHandleResponse(resp *http.Response) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { - result := PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{} +func (client *PostgreSQLServerManagementClient) checkMigrationNameAvailabilityHandleResponse(resp *http.Response) (PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse, error) { + result := PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MigrationNameAvailabilityResource); err != nil { - return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go index cef9b05b5b5f..3ed7b3f4eeaa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -73,7 +73,7 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionClient.BeginDelete" @@ -119,7 +119,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // BeginUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -155,7 +155,7 @@ func (client *PrivateEndpointConnectionClient) BeginUpdate(ctx context.Context, // Update - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *PrivateEndpointConnectionClient) update(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionClient.BeginUpdate" @@ -201,7 +201,7 @@ func (client *PrivateEndpointConnectionClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go deleted file mode 100644 index bd46f1f811a6..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", armpostgresqlflexibleservers.PrivateEndpointConnection{ - Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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 = armpostgresqlflexibleservers.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("postgresqlServer")}, - // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", 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/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go index b1c58d972b74..94637d3a4101 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -98,7 +98,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServerPager - Gets all private endpoint connections on a server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager @@ -163,7 +163,7 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go deleted file mode 100644 index f094f66494c6..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,120 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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.1fa229cd-bf3f-47f0-8c49-afb36723997e", 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 = armpostgresqlflexibleservers.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("postgresqlServer")}, - // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.PrivateEndpointConnectionListResult{ - // Value: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("postgresqlServer")}, - // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("postgresqlServer")}, - // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go index ef7bcab606c7..2f670ea3e0b3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource for PostgreSQL server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - groupName - The name of the private link resource. @@ -98,7 +98,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the private link resources for PostgreSQL server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager @@ -163,7 +163,7 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go deleted file mode 100644 index 6cc21c83100a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,90 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.PrivateLinkResourceListResult{ - // Value: []*armpostgresqlflexibleservers.PrivateLinkResource{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresqlflexibleservers.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.meru.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.PrivateLinkResource{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresqlflexibleservers.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.meru.com")}, - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go deleted file mode 100644 index 38b21f00056d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go +++ /dev/null @@ -1,103 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpostgresqlflexibleservers - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// QuotaUsagesClient contains the methods for the QuotaUsages group. -// Don't use this type directly, use NewQuotaUsagesClient() instead. -type QuotaUsagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewQuotaUsagesClient creates a new instance of QuotaUsagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewQuotaUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaUsagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &QuotaUsagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Get quota usages at specified location in a given subscription. -// -// Generated from API version 2023-12-01-preview -// - locationName - The name of the location. -// - options - QuotaUsagesClientListOptions contains the optional parameters for the QuotaUsagesClient.NewListPager method. -func (client *QuotaUsagesClient) NewListPager(locationName string, options *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[QuotaUsagesClientListResponse]{ - More: func(page QuotaUsagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *QuotaUsagesClientListResponse) (QuotaUsagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "QuotaUsagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, locationName, options) - }, nil) - if err != nil { - return QuotaUsagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *QuotaUsagesClient) listCreateRequest(ctx context.Context, locationName string, options *QuotaUsagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *QuotaUsagesClient) listHandleResponse(resp *http.Response) (QuotaUsagesClientListResponse, error) { - result := QuotaUsagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.QuotaUsagesListResult); err != nil { - return QuotaUsagesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go deleted file mode 100644 index ab354dfc3af6..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go +++ /dev/null @@ -1,66 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/QuotaUsagesForFlexibleServers.json -func ExampleQuotaUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQuotaUsagesClient().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.QuotaUsagesListResult = armpostgresqlflexibleservers.QuotaUsagesListResult{ - // Value: []*armpostgresqlflexibleservers.QuotaUsage{ - // { - // Name: &armpostgresqlflexibleservers.NameProperty{ - // LocalizedValue: to.Ptr("standardBSFamily"), - // Value: to.Ptr("standardBSFamily"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr(""), - // Limit: to.Ptr[int64](10000), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armpostgresqlflexibleservers.NameProperty{ - // LocalizedValue: to.Ptr("standardDDSv4Family"), - // Value: to.Ptr("standardDDSv4Family"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr(""), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go index d6717b9eaa03..3ad005f1e3a1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/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-01-preview +// Generated from API version 2024-08-01 // - 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 @@ -94,7 +94,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go deleted file mode 100644 index 389a11e94a09..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go +++ /dev/null @@ -1,105 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByServerPager("testrg", "sourcepgservername", 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 = armpostgresqlflexibleservers.ServerListResult{ - // Value: []*armpostgresqlflexibleservers.Server{ - // { - // Name: to.Ptr("pgtestsvc5rep"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-27T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // ReplicationState: to.Ptr(armpostgresqlflexibleservers.ReplicationStateActive), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go index 621cf7a0c5f6..bfee46d2acbd 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go @@ -31,6 +31,17 @@ type AdministratorsClientListByServerResponse struct { AdministratorListResult } +// BackupsClientCreateResponse contains the response from method BackupsClient.BeginCreate. +type BackupsClientCreateResponse struct { + // Server backup properties + ServerBackup +} + +// BackupsClientDeleteResponse contains the response from method BackupsClient.BeginDelete. +type BackupsClientDeleteResponse struct { + // placeholder for future response values +} + // BackupsClientGetResponse contains the response from method BackupsClient.Get. type BackupsClientGetResponse struct { // Server backup properties @@ -205,8 +216,8 @@ type OperationsClientListResponse struct { OperationListResult } -// PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse contains the response from method PostgreSQLManagementClient.CheckMigrationNameAvailability. -type PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse struct { +// PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse contains the response from method PostgreSQLServerManagementClient.CheckMigrationNameAvailability. +type PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse struct { // Represents a migration name's availability. MigrationNameAvailabilityResource } @@ -246,12 +257,6 @@ type PrivateLinkResourcesClientListByServerResponse struct { PrivateLinkResourceListResult } -// QuotaUsagesClientListResponse contains the response from method QuotaUsagesClient.NewListPager. -type QuotaUsagesClientListResponse struct { - // Capability for the PostgreSQL server - QuotaUsagesListResult -} - // ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager. type ReplicasClientListByServerResponse struct { // A list of servers. diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go index 613171e0d3a1..d03779f1efc1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go @@ -45,7 +45,7 @@ func NewServerCapabilitiesClient(subscriptionID string, credential azcore.TokenC // NewListPager - Get capabilities for a flexible server. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServerCapabilitiesClientListOptions contains the optional parameters for the ServerCapabilitiesClient.NewListPager @@ -93,7 +93,7 @@ func (client *ServerCapabilitiesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go deleted file mode 100644 index 792f33c1dfe1..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go +++ /dev/null @@ -1,1706 +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 armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCapabilities.json -func ExampleServerCapabilitiesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerCapabilitiesClient().NewListPager("testrg", "pgtestsvc4", 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 = armpostgresqlflexibleservers.CapabilitiesListResult{ - // Value: []*armpostgresqlflexibleservers.FlexibleServerCapability{ - // { - // Name: to.Ptr("FlexibleServerCapabilities"), - // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportedEnumEnabled), - // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeoBackupSupportedEnumEnabled), - // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineResizeSupportedEnumDisabled), - // Restricted: to.Ptr(armpostgresqlflexibleservers.RestrictedEnumDisabled), - // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportedEnumEnabled), - // SupportedFastProvisioningEditions: []*armpostgresqlflexibleservers.FastProvisioningEditionCapability{ - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("12"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("13"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }, - // { - // ServerCount: to.Ptr[int32](23), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("14"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_b1ms"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_b2s"), - // SupportedStorageGb: to.Ptr[int32](32), - // SupportedTier: to.Ptr("Burstable"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_d2s_v3"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_d2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](128), - // SupportedTier: to.Ptr("GeneralPurpose"), - // }, - // { - // ServerCount: to.Ptr[int32](0), - // SupportedServerVersions: to.Ptr("15"), - // SupportedSKU: to.Ptr("standard_e2ds_v4"), - // SupportedStorageGb: to.Ptr[int32](512), - // SupportedTier: to.Ptr("MemoryOptimized"), - // }}, - // SupportedServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // DefaultSKUName: to.Ptr("Standard_B1ms"), - // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](640), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](1280), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](1700), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](2400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3100), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_B12ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](12), - // }, - // { - // Name: to.Ptr("Standard_B16ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4300), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_B20ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](5000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](20), - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](32768), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("P4"), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](120), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int32](120), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P6"), - // StorageSizeMb: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int32](240), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P10"), - // StorageSizeMb: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int32](500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P15"), - // StorageSizeMb: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int32](1100), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P20"), - // StorageSizeMb: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int32](2300), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P30"), - // StorageSizeMb: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int32](5000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P40"), - // StorageSizeMb: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P50"), - // StorageSizeMb: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P60"), - // StorageSizeMb: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int32](16000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P60"), - // Iops: to.Ptr[int32](16000), - // }, - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P70"), - // StorageSizeMb: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int32](18000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P80"), - // StorageSizeMb: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int32](20000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("ManagedDiskV2"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](3000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](80000), - // SupportedMaximumThroughput: to.Ptr[int32](750), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKUName: to.Ptr("Standard_D2ds_v4"), - // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_D2ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_D4ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_D8ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_D16ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_D32ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_D48ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_D64ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_D96ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("P4"), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](120), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int32](120), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P6"), - // StorageSizeMb: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int32](240), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P10"), - // StorageSizeMb: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int32](500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P15"), - // StorageSizeMb: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int32](1100), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P20"), - // StorageSizeMb: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int32](2300), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P30"), - // StorageSizeMb: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int32](5000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P40"), - // StorageSizeMb: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P50"), - // StorageSizeMb: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P60"), - // StorageSizeMb: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int32](16000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P60"), - // Iops: to.Ptr[int32](16000), - // }, - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P70"), - // StorageSizeMb: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int32](18000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P80"), - // StorageSizeMb: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int32](20000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("ManagedDiskV2"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](3000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](80000), - // SupportedMaximumThroughput: to.Ptr[int32](750), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKUName: to.Ptr("Standard_E2ds_v4"), - // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_E2ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3200), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_E4ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](6400), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_E8ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](12800), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_E16ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_E32ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("Standard_E48ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("Standard_E64ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("Standard_E96ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](20000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // DefaultStorageSizeMb: to.Ptr[int64](131072), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("P4"), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](120), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int32](120), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P6"), - // StorageSizeMb: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int32](240), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int32](240), - // }, - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P10"), - // StorageSizeMb: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int32](500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P10"), - // Iops: to.Ptr[int32](500), - // }, - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P15"), - // StorageSizeMb: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int32](1100), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P15"), - // Iops: to.Ptr[int32](1100), - // }, - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P20"), - // StorageSizeMb: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int32](2300), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P20"), - // Iops: to.Ptr[int32](2300), - // }, - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P30"), - // StorageSizeMb: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int32](5000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P30"), - // Iops: to.Ptr[int32](5000), - // }, - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P40"), - // StorageSizeMb: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P40"), - // Iops: to.Ptr[int32](7500), - // }, - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P50"), - // StorageSizeMb: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P50"), - // Iops: to.Ptr[int32](7500), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P60"), - // StorageSizeMb: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int32](16000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P60"), - // Iops: to.Ptr[int32](16000), - // }, - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P70"), - // StorageSizeMb: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int32](18000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P70"), - // Iops: to.Ptr[int32](18000), - // }, - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }, - // { - // DefaultIopsTier: to.Ptr("P80"), - // StorageSizeMb: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int32](20000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P80"), - // Iops: to.Ptr[int32](20000), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("ManagedDiskV2"), - // DefaultStorageSizeMb: to.Ptr[int64](65536), - // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ - // { - // DefaultIopsTier: to.Ptr("None"), - // MaximumStorageSizeMb: to.Ptr[int64](67108864), - // StorageSizeMb: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int32](3000), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("None"), - // Iops: to.Ptr[int32](0), - // }}, - // SupportedMaximumIops: to.Ptr[int32](80000), - // SupportedMaximumThroughput: to.Ptr[int32](750), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }}, - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14"), - // to.Ptr("15")}, - // }, - // { - // Name: to.Ptr("12"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("13"), - // to.Ptr("14"), - // to.Ptr("15")}, - // }, - // { - // Name: to.Ptr("13"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("14"), - // to.Ptr("15")}, - // }, - // { - // Name: to.Ptr("14"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("15")}, - // }}, - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaAndGeoBackupSupportedEnumEnabled), - // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaSupportedEnumEnabled), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go index 3af79c908c91..b13c792f8e5e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go @@ -46,7 +46,7 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -72,7 +72,7 @@ func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 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" @@ -114,7 +114,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,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-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -151,7 +151,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-01-preview +// Generated from API version 2024-08-01 func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDelete" @@ -193,7 +193,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets information about a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -248,7 +248,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // NewListPager - List all the servers in a given subscription. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - 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]{ @@ -302,7 +302,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +319,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-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager // method. @@ -362,7 +362,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon // BeginRestart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. @@ -405,7 +405,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-01-preview +// Generated from API version 2024-08-01 func (client *ServersClient) restart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginRestart" @@ -447,7 +447,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -462,7 +462,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-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -487,7 +487,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-01-preview +// Generated from API version 2024-08-01 func (client *ServersClient) start(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStart" @@ -529,7 +529,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,7 +538,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-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -563,7 +563,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-01-preview +// Generated from API version 2024-08-01 func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStop" @@ -605,7 +605,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -615,7 +615,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-01-preview +// Generated from API version 2024-08-01 // - 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. @@ -642,7 +642,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-01-preview +// Generated from API version 2024-08-01 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" @@ -684,7 +684,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go deleted file mode 100644 index 5bea7e497558..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go +++ /dev/null @@ -1,2210 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json -func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5geo", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("eastus"), - Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeGeoRestore), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - }, - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5geo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5geo"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-27T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), - // GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5geo.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModePointInTimeRestore), - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-27T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("password"), - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - Network: &armpostgresqlflexibleservers.Network{ - DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](512), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D4s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithAadAuthEnabled.json -func ExampleServersClient_BeginCreate_createANewServerWithActiveDirectoryAuthenticationEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("password"), - AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - }, - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - }, - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - Network: &armpostgresqlflexibleservers.Network{ - DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](512), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D4s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReplica.json -func ExampleServersClient_BeginCreate_serverCreateReplica() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5rep", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReplica), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr(""), - GeoBackupUserAssignedIdentityID: to.Ptr(""), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - }, - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5rep"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-27T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // ReplicationState: to.Ptr(armpostgresqlflexibleservers.ReplicationStateActive), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReviveDropped.json -func ExampleServersClient_BeginCreate_serverCreateReviveDropped() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5-rev", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReviveDropped), - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T00:04:59.407Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5"), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc5-rev"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5-rev"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("2"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-27T00:28:17.727Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5-rev.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json -func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("password"), - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr(""), - GeoBackupUserAssignedIdentityID: to.Ptr(""), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - }, - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - Network: &armpostgresqlflexibleservers.Network{ - DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](512), - }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D4s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json -func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced), - }, - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json -func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned), - }, - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](0), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate_serverUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - StorageSizeGB: to.Ptr[int32](1024), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - }, - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithAadAuthEnabled.json -func ExampleServersClient_BeginUpdate_serverUpdateWithAadAuthEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - }, - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](1024), - Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - }, - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json -func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - CustomWindow: to.Ptr("Enabled"), - DayOfWeek: to.Ptr[int32](0), - 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](8), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json -func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, - }, - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - }, - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ - // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity-1": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("90008082-e024-4cc3-8fcf-63bcdb9cf6b6"), - // }, - // }, - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - // GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), - // GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), - // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), - // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json -func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionFourteen), - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionFourteen), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedSwitchover.json -func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced), - }, - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](5), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json -func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - Replica: &armpostgresqlflexibleservers.Replica{ - PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), - PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned), - }, - }, - }, 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4-replica"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](20), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // Replica: &armpostgresqlflexibleservers.Replica{ - // Capacity: to.Ptr[int32](5), - // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](5000), - // StorageSizeGB: to.Ptr[int32](1024), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D8s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "testrg", "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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGet.json -func ExampleServersClient_Get_serverGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc1", 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T23:07:25.816Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithPrivateEndpoints.json -func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc2", 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T23:07:25.816Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // PrivateEndpointConnections: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ - // { - // Name: to.Ptr("asdfasdfa.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc2/privateEndpointConnections/asdfasdfa.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), - // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("postgresqlServer")}, - // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/pe-test-rg/providers/Microsoft.Network/privateEndpoints/asdfasdfa"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithVnet.json -func ExampleServersClient_Get_serverGetWithVnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc4", 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 = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.ServerListResult{ - // Value: []*armpostgresqlflexibleservers.Server{ - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T23:15:38.813Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.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 = armpostgresqlflexibleservers.ServerListResult{ - // Value: []*armpostgresqlflexibleservers.Server{ - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), - // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // StorageSizeGB: to.Ptr[int32](512), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // }, - // AvailabilityZone: to.Ptr("1"), - // Backup: &armpostgresqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T23:15:38.813Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), - // Iops: to.Ptr[int32](2300), - // StorageSizeGB: to.Ptr[int32](512), - // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestart.json -func ExampleServersClient_BeginRestart_serverRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "testrg", "testserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: 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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestartWithFailover.json -func ExampleServersClient_BeginRestart_serverRestartWithFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "testrg", "testserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: &armpostgresqlflexibleservers.RestartParameter{ - FailoverMode: to.Ptr(armpostgresqlflexibleservers.FailoverModeForcedFailover), - RestartWithFailover: to.Ptr(true), - }, - }) - 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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginStart(ctx, "testrg", "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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginStop(ctx, "testrg", "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) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go index f1ba3541d370..11ab03cdfbbb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go @@ -46,7 +46,7 @@ func NewServerThreatProtectionSettingsClient(subscriptionID string, credential a // BeginCreateOrUpdate - Creates or updates a server's Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - threatProtectionName - The name of the Threat Protection state. @@ -74,7 +74,7 @@ func (client *ServerThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates a server's Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *ServerThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServerThreatProtectionSettingsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest( // Get - Get a server's Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - threatProtectionName - The name of the Threat Protection state. @@ -184,7 +184,7 @@ func (client *ServerThreatProtectionSettingsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *ServerThreatProtectionSettingsClient) getHandleResponse(resp *http // NewListByServerPager - Get a list of server's Threat Protection state. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServerThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.NewListByServerPager @@ -249,7 +249,7 @@ func (client *ServerThreatProtectionSettingsClient) listByServerCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go deleted file mode 100644 index e220d2c1ad0f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,122 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsListByServer.json -func ExampleServerThreatProtectionSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerThreatProtectionSettingsClient().NewListByServerPager("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.ServerThreatProtectionListResult = armpostgresqlflexibleservers.ServerThreatProtectionListResult{ - // Value: []*armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-2080/advancedThreatProtectionSettings/Default"), - // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsGet.json -func ExampleServerThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", armpostgresqlflexibleservers.ThreatProtectionNameDefault, 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.ServerThreatProtectionSettingsModel = armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsCreateOrUpdate.json -func ExampleServerThreatProtectionSettingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armpostgresqlflexibleservers.ThreatProtectionNameDefault, armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - }, - }, 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.ServerThreatProtectionSettingsModel = armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go index fc25c762adcc..ad768a36628d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go @@ -46,7 +46,7 @@ func NewVirtualEndpointsClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new virtual endpoint for PostgreSQL flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - virtualEndpointName - The name of the virtual endpoint. @@ -74,7 +74,7 @@ func (client *VirtualEndpointsClient) BeginCreate(ctx context.Context, resourceG // Create - Creates a new virtual endpoint for PostgreSQL flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *VirtualEndpointsClient) create(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, options *VirtualEndpointsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "VirtualEndpointsClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, r // BeginDelete - Deletes a virtual endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - virtualEndpointName - The name of the virtual endpoint. @@ -159,7 +159,7 @@ func (client *VirtualEndpointsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a virtual endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *VirtualEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualEndpointsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets information about a virtual endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - virtualEndpointName - The name of the virtual endpoint. @@ -265,7 +265,7 @@ func (client *VirtualEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *VirtualEndpointsClient) getHandleResponse(resp *http.Response) (Vi // NewListByServerPager - List all the servers in a given resource group. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - VirtualEndpointsClientListByServerOptions contains the optional parameters for the VirtualEndpointsClient.NewListByServerPager @@ -330,7 +330,7 @@ func (client *VirtualEndpointsClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *VirtualEndpointsClient) listByServerHandleResponse(resp *http.Resp // in the normal virtual endpoint definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - virtualEndpointName - The name of the virtual endpoint. @@ -378,7 +378,7 @@ func (client *VirtualEndpointsClient) BeginUpdate(ctx context.Context, resourceG // normal virtual endpoint definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-08-01 func (client *VirtualEndpointsClient) update(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualEndpointsClient.BeginUpdate" @@ -424,7 +424,7 @@ func (client *VirtualEndpointsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go deleted file mode 100644 index aa8245a870a1..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go +++ /dev/null @@ -1,200 +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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointCreate.json -func ExampleVirtualEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualEndpointsClient().BeginCreate(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", armpostgresqlflexibleservers.VirtualEndpointResource{ - Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - Members: []*string{ - to.Ptr("testPrimary1")}, - }, - }, 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.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ - // Name: to.Ptr("pgVirtualEndpoint1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), - // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - // Members: []*string{ - // to.Ptr("testPrimary1")}, - // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointUpdate.json -func ExampleVirtualEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualEndpointsClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", armpostgresqlflexibleservers.VirtualEndpointResourceForPatch{ - Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - Members: []*string{ - to.Ptr("testReplica1")}, - }, - }, 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.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ - // Name: to.Ptr("pgVirtualEndpoint1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), - // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - // Members: []*string{ - // to.Ptr("testReplica1")}, - // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointDelete.json -func ExampleVirtualEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualEndpointsClient().BeginDelete(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", 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/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsGet.json -func ExampleVirtualEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualEndpointsClient().Get(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", 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.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ - // Name: to.Ptr("pgVirtualEndpoint1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), - // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - // Members: []*string{ - // to.Ptr("testReplica1")}, - // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsListByServer.json -func ExampleVirtualEndpointsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualEndpointsClient().NewListByServerPager("testrg", "pgtestsvc4", 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.VirtualEndpointsListResult = armpostgresqlflexibleservers.VirtualEndpointsListResult{ - // Value: []*armpostgresqlflexibleservers.VirtualEndpointResource{ - // { - // Name: to.Ptr("pgVirtualEndpoint1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), - // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ - // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), - // Members: []*string{ - // to.Ptr("testReplica1")}, - // VirtualEndpoints: []*string{ - // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), - // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go index fbd00545fb4a..6f14bcaa1bfb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go @@ -46,7 +46,7 @@ func NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore // 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-01-preview +// Generated from API version 2024-08-01 // - locationName - The name of the location. // - parameters - The required parameters for creating or updating a server. // - options - VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute @@ -89,7 +89,7 @@ func (client *VirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-08-01") 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/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go deleted file mode 100644 index 911b7b435350..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_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 armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualNetworkSubnetUsage.json -func ExampleVirtualNetworkSubnetUsageClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkSubnetUsageClient().Execute(ctx, "westus", armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter{ - VirtualNetworkArmResourceID: 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 = armpostgresqlflexibleservers.VirtualNetworkSubnetUsageResult{ - // DelegatedSubnetsUsage: []*armpostgresqlflexibleservers.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"), - // } -}