From ed7cc1e83fe3e2515abe9e08f2878bf35325840a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 14 Dec 2020 16:10:35 +0000 Subject: [PATCH] CodeGen from PR 11884 in Azure/azure-rest-api-specs New API: QPI Reset (#11884) --- .../postgresql/CHANGELOG.md | 12 + .../postgresql/checknameavailability.go | 3 +- .../postgresql/configurations.go | 8 +- .../postgresql/databases.go | 10 +- .../postgresql/firewallrules.go | 10 +- .../locationbasedperformancetier.go | 3 +- .../2017-12-01-preview/postgresql/logfiles.go | 3 +- .../2017-12-01-preview/postgresql/models.go | 300 ++++++++++++++---- .../postgresql/operations.go | 3 +- .../postgresql/postgresqlapi/interfaces.go | 21 ++ .../postgresql/recoverableservers.go | 122 +++++++ .../2017-12-01-preview/postgresql/replicas.go | 3 +- .../postgresql/serveradministrators.go | 10 +- .../postgresql/serverbasedperformancetier.go | 122 +++++++ .../postgresql/serverparameters.go | 124 ++++++++ .../2017-12-01-preview/postgresql/servers.go | 23 +- .../postgresql/serversecurityalertpolicies.go | 5 +- .../postgresql/virtualnetworkrules.go | 11 +- 18 files changed, 688 insertions(+), 105 deletions(-) create mode 100644 services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/CHANGELOG.md create mode 100644 services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/recoverableservers.go create mode 100644 services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverbasedperformancetier.go create mode 100644 services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverparameters.go diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/CHANGELOG.md b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/CHANGELOG.md new file mode 100644 index 000000000000..321c18a960a3 --- /dev/null +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/CHANGELOG.md @@ -0,0 +1,12 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Function `NewVirtualNetworkRuleListResultPage` parameter(s) have been changed from `(func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error))` to `(VirtualNetworkRuleListResult, func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error))` + +## New Content + +- New struct `AzureEntityResource` +- New struct `Resource` diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go index 5cb039d29e3e..df67a2f5b03a 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/checknameavailability.go @@ -81,6 +81,7 @@ func (client CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvail result, err = client.ExecuteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.CheckNameAvailabilityClient", "Execute", resp, "Failure responding to request") + return } return @@ -101,7 +102,7 @@ func (client CheckNameAvailabilityClient) ExecutePreparer(ctx context.Context, n autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/checkNameAvailability", pathParameters), autorest.WithJSON(nameAvailabilityRequest), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go index 2e77f3d81092..8b2189a7347d 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/configurations.go @@ -94,7 +94,7 @@ func (client ConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -157,6 +157,7 @@ func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsClient", "Get", resp, "Failure responding to request") + return } return @@ -179,7 +180,7 @@ func (client ConfigurationsClient) GetPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -234,6 +235,7 @@ func (client ConfigurationsClient) ListByServer(ctx context.Context, resourceGro result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -255,7 +257,7 @@ func (client ConfigurationsClient) ListByServerPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/configurations", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go index 3bc7adb549ba..51b64089aa95 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/databases.go @@ -94,7 +94,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -173,7 +173,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -234,6 +234,7 @@ func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.DatabasesClient", "Get", resp, "Failure responding to request") + return } return @@ -256,7 +257,7 @@ func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -311,6 +312,7 @@ func (client DatabasesClient) ListByServer(ctx context.Context, resourceGroupNam result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.DatabasesClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -332,7 +334,7 @@ func (client DatabasesClient) ListByServerPreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go index c6b839af65f4..1f88aaf9594d 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/firewallrules.go @@ -106,7 +106,7 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -185,7 +185,7 @@ func (client FirewallRulesClient) DeletePreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -246,6 +246,7 @@ func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName str result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -268,7 +269,7 @@ func (client FirewallRulesClient) GetPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -323,6 +324,7 @@ func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGrou result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -344,7 +346,7 @@ func (client FirewallRulesClient) ListByServerPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/firewallRules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go index 043573815490..e1d0a878787d 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/locationbasedperformancetier.go @@ -74,6 +74,7 @@ func (client LocationBasedPerformanceTierClient) List(ctx context.Context, locat result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.LocationBasedPerformanceTierClient", "List", resp, "Failure responding to request") + return } return @@ -94,7 +95,7 @@ func (client LocationBasedPerformanceTierClient) ListPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/performanceTiers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/locations/{locationName}/performanceTiers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go index e32269673e99..6251cf12a5d8 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/logfiles.go @@ -75,6 +75,7 @@ func (client LogFilesClient) ListByServer(ctx context.Context, resourceGroupName result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.LogFilesClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -96,7 +97,7 @@ func (client LogFilesClient) ListByServerPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/logFiles", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/logFiles", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go index 1c4c613b68fd..a4054e73b4af 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/models.go @@ -32,6 +32,18 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql" +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + // CloudError an error response from the Batch service. type CloudError struct { Error *CloudErrorBody `json:"error,omitempty"` @@ -54,11 +66,11 @@ type Configuration struct { autorest.Response `json:"-"` // ConfigurationProperties - The properties of a configuration. *ConfigurationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -191,11 +203,11 @@ type Database struct { autorest.Response `json:"-"` // DatabaseProperties - The properties of a database. *DatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -303,7 +315,8 @@ func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d D return } -// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabasesDeleteFuture struct { azure.Future } @@ -330,11 +343,11 @@ type FirewallRule struct { autorest.Response `json:"-"` // FirewallRuleProperties - The properties of a firewall rule. *FirewallRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -413,8 +426,8 @@ type FirewallRuleProperties struct { EndIPAddress *string `json:"endIpAddress,omitempty"` } -// FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type FirewallRulesCreateOrUpdateFuture struct { azure.Future } @@ -469,11 +482,11 @@ func (future *FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar type LogFile struct { // LogFileProperties - The properties of the log file. *LogFileProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -640,6 +653,18 @@ type PerformanceTierListResult struct { type PerformanceTierProperties struct { // ID - ID of the performance tier. ID *string `json:"id,omitempty"` + // MaxBackupRetentionDays - Maximum Backup retention in days for the performance tier edition + MaxBackupRetentionDays *int32 `json:"maxBackupRetentionDays,omitempty"` + // MinBackupRetentionDays - Minimum Backup retention in days for the performance tier edition + MinBackupRetentionDays *int32 `json:"minBackupRetentionDays,omitempty"` + // MaxStorageMB - Max storage allowed for a server. + MaxStorageMB *int32 `json:"maxStorageMB,omitempty"` + // MinLargeStorageMB - Max storage allowed for a server. + MinLargeStorageMB *int32 `json:"minLargeStorageMB,omitempty"` + // MaxLargeStorageMB - Max storage allowed for a server. + MaxLargeStorageMB *int32 `json:"maxLargeStorageMB,omitempty"` + // MinStorageMB - Max storage allowed for a server. + MinStorageMB *int32 `json:"minStorageMB,omitempty"` // ServiceLevelObjectives - Service level objectives associated with the performance tier ServiceLevelObjectives *[]PerformanceTierServiceLevelObjectives `json:"serviceLevelObjectives,omitempty"` } @@ -714,13 +739,113 @@ func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, e return json.Marshal(objectMap) } -// ProxyResource resource properties. +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location type ProxyResource struct { - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// RecoverableServerProperties the recoverable server's properties. +type RecoverableServerProperties struct { + // LastAvailableBackupDateTime - READ-ONLY; The last available backup date time. + LastAvailableBackupDateTime *string `json:"lastAvailableBackupDateTime,omitempty"` + // ServiceLevelObjective - READ-ONLY; The service level objective + ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"` + // Edition - READ-ONLY; Edition of the performance tier. + Edition *string `json:"edition,omitempty"` + // VCore - READ-ONLY; vCore associated with the service level objective + VCore *int32 `json:"vCore,omitempty"` + // HardwareGeneration - READ-ONLY; Hardware generation associated with the service level objective + HardwareGeneration *string `json:"hardwareGeneration,omitempty"` + // Version - READ-ONLY; The PostgreSQL version + Version *string `json:"version,omitempty"` +} + +// RecoverableServerResource a recoverable server resource. +type RecoverableServerResource struct { + autorest.Response `json:"-"` + // RecoverableServerProperties - Resource properties. + *RecoverableServerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoverableServerResource. +func (rsr RecoverableServerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsr.RecoverableServerProperties != nil { + objectMap["properties"] = rsr.RecoverableServerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecoverableServerResource struct. +func (rsr *RecoverableServerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recoverableServerProperties RecoverableServerProperties + err = json.Unmarshal(*v, &recoverableServerProperties) + if err != nil { + return err + } + rsr.RecoverableServerProperties = &recoverableServerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rsr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rsr.Type = &typeVar + } + } + } + + return nil +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -770,15 +895,15 @@ type Server struct { Sku *Sku `json:"sku,omitempty"` // ServerProperties - Properties of the server. *ServerProperties `json:"properties,omitempty"` - // Location - The location the resource resides in. - Location *string `json:"location,omitempty"` - // Tags - Application-specific metadata in the form of key-value pairs. + // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -794,12 +919,12 @@ func (s Server) MarshalJSON() ([]byte, error) { if s.ServerProperties != nil { objectMap["properties"] = s.ServerProperties } - if s.Location != nil { - objectMap["location"] = s.Location - } if s.Tags != nil { objectMap["tags"] = s.Tags } + if s.Location != nil { + objectMap["location"] = s.Location + } return json.Marshal(objectMap) } @@ -839,23 +964,23 @@ func (s *Server) UnmarshalJSON(body []byte) error { } s.ServerProperties = &serverProperties } - case "location": + case "tags": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - s.Location = &location + s.Tags = tags } - case "tags": + case "location": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - s.Tags = tags + s.Location = &location } case "id": if v != nil { @@ -907,11 +1032,11 @@ type ServerAdministratorResource struct { autorest.Response `json:"-"` // ServerAdministratorProperties - Properties of the server AAD administrator. *ServerAdministratorProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1011,8 +1136,8 @@ func (future *ServerAdministratorsCreateOrUpdateFuture) Result(client ServerAdmi return } -// ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ServerAdministratorsDeleteFuture struct { azure.Future } @@ -1119,6 +1244,35 @@ type ServerListResult struct { Value *[]Server `json:"value,omitempty"` } +// ServerParametersListUpdateConfigurationsFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ServerParametersListUpdateConfigurationsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerParametersListUpdateConfigurationsFuture) Result(client ServerParametersClient) (clr ConfigurationListResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersListUpdateConfigurationsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("postgresql.ServerParametersListUpdateConfigurationsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if clr.Response.Response, err = future.GetResult(sender); err == nil && clr.Response.Response.StatusCode != http.StatusNoContent { + clr, err = client.ListUpdateConfigurationsResponder(clr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersListUpdateConfigurationsFuture", "Result", clr.Response.Response, "Failure responding to request") + } + } + return +} + // ServerPrivateEndpointConnection a private endpoint connection under a server type ServerPrivateEndpointConnection struct { // ID - READ-ONLY; Resource Id of the private endpoint connection. @@ -1406,8 +1560,8 @@ func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() return &spfdc, true } -// ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different region -// from a geo replicated backup. +// ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different +// region from a geo replicated backup. type ServerPropertiesForGeoRestore struct { // SourceServerID - The source server id to restore from. SourceServerID *string `json:"sourceServerId,omitempty"` @@ -1625,7 +1779,8 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } -// ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersCreateFuture struct { azure.Future } @@ -1653,7 +1808,8 @@ func (future *ServersCreateFuture) Result(client ServersClient) (s Server, err e return } -// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersDeleteFuture struct { azure.Future } @@ -1675,8 +1831,8 @@ func (future *ServersDeleteFuture) Result(client ServersClient) (ar autorest.Res return } -// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { azure.Future } @@ -1709,11 +1865,11 @@ type ServerSecurityAlertPolicy struct { autorest.Response `json:"-"` // SecurityAlertPolicyProperties - Resource properties. *SecurityAlertPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1777,7 +1933,8 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } -// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersRestartFuture struct { azure.Future } @@ -1799,7 +1956,8 @@ func (future *ServersRestartFuture) Result(client ServersClient) (ar autorest.Re return } -// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersUpdateFuture struct { azure.Future } @@ -1936,29 +2094,30 @@ type StorageProfile struct { StorageAutogrow StorageAutogrow `json:"storageAutogrow,omitempty"` } -// TrackedResource resource properties including location and tags for track resources. +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' type TrackedResource struct { - // Location - The location the resource resides in. - Location *string `json:"location,omitempty"` - // Tags - Application-specific metadata in the form of key-value pairs. + // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; Resource ID + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for TrackedResource. func (tr TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if tr.Location != nil { - objectMap["location"] = tr.Location - } if tr.Tags != nil { objectMap["tags"] = tr.Tags } + if tr.Location != nil { + objectMap["location"] = tr.Location + } return json.Marshal(objectMap) } @@ -1967,11 +2126,11 @@ type VirtualNetworkRule struct { autorest.Response `json:"-"` // VirtualNetworkRuleProperties - Resource properties. *VirtualNetworkRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2187,8 +2346,11 @@ func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { } // Creates a new instance of the VirtualNetworkRuleListResultPage type. -func NewVirtualNetworkRuleListResultPage(getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { - return VirtualNetworkRuleListResultPage{fn: getNextPage} +func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { + return VirtualNetworkRuleListResultPage{ + fn: getNextPage, + vnrlr: cur, + } } // VirtualNetworkRuleProperties properties of a virtual network rule. @@ -2242,8 +2404,8 @@ func (future *VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetw return } -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkRulesDeleteFuture struct { azure.Future } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go index c1d7eac3222d..a3580a3e7b5e 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/operations.go @@ -71,6 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.OperationsClient", "List", resp, "Failure responding to request") + return } return @@ -86,7 +87,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.DBforPostgreSQL/operations"), + autorest.WithPath("/providers/Microsoft.DBForPostgreSQL/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go index 6033eba5f2ab..8f4e7a8eb7a4 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/postgresqlapi/interfaces.go @@ -82,6 +82,13 @@ type ConfigurationsClientAPI interface { var _ ConfigurationsClientAPI = (*postgresql.ConfigurationsClient)(nil) +// ServerParametersClientAPI contains the set of methods on the ServerParametersClient type. +type ServerParametersClientAPI interface { + ListUpdateConfigurations(ctx context.Context, resourceGroupName string, serverName string, value postgresql.ConfigurationListResult) (result postgresql.ServerParametersListUpdateConfigurationsFuture, err error) +} + +var _ ServerParametersClientAPI = (*postgresql.ServerParametersClient)(nil) + // LogFilesClientAPI contains the set of methods on the LogFilesClient type. type LogFilesClientAPI interface { ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.LogFileListResult, err error) @@ -99,6 +106,20 @@ type ServerAdministratorsClientAPI interface { var _ ServerAdministratorsClientAPI = (*postgresql.ServerAdministratorsClient)(nil) +// RecoverableServersClientAPI contains the set of methods on the RecoverableServersClient type. +type RecoverableServersClientAPI interface { + Get(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.RecoverableServerResource, err error) +} + +var _ RecoverableServersClientAPI = (*postgresql.RecoverableServersClient)(nil) + +// ServerBasedPerformanceTierClientAPI contains the set of methods on the ServerBasedPerformanceTierClient type. +type ServerBasedPerformanceTierClientAPI interface { + List(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.PerformanceTierListResult, err error) +} + +var _ ServerBasedPerformanceTierClientAPI = (*postgresql.ServerBasedPerformanceTierClient)(nil) + // LocationBasedPerformanceTierClientAPI contains the set of methods on the LocationBasedPerformanceTierClient type. type LocationBasedPerformanceTierClientAPI interface { List(ctx context.Context, locationName string) (result postgresql.PerformanceTierListResult, err error) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/recoverableservers.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/recoverableservers.go new file mode 100644 index 000000000000..0a6902c2a80b --- /dev/null +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/recoverableservers.go @@ -0,0 +1,122 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoverableServersClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type RecoverableServersClient struct { + BaseClient +} + +// NewRecoverableServersClient creates an instance of the RecoverableServersClient client. +func NewRecoverableServersClient(subscriptionID string) RecoverableServersClient { + return NewRecoverableServersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRecoverableServersClientWithBaseURI creates an instance of the RecoverableServersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewRecoverableServersClientWithBaseURI(baseURI string, subscriptionID string) RecoverableServersClient { + return RecoverableServersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a recoverable PostgreSQL Server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client RecoverableServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result RecoverableServerResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableServersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.RecoverableServersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "postgresql.RecoverableServersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.RecoverableServersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoverableServersClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/recoverableServers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoverableServersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoverableServersClient) GetResponder(resp *http.Response) (result RecoverableServerResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go index 42700891e58f..99bc38b2e931 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/replicas.go @@ -75,6 +75,7 @@ func (client ReplicasClient) ListByServer(ctx context.Context, resourceGroupName result, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ReplicasClient", "ListByServer", resp, "Failure responding to request") + return } return @@ -96,7 +97,7 @@ func (client ReplicasClient) ListByServerPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Replicas", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Replicas", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go index d76ebcf93f6e..6036df26518f 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serveradministrators.go @@ -106,7 +106,7 @@ func (client ServerAdministratorsClient) CreateOrUpdatePreparer(ctx context.Cont autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), autorest.WithJSON(properties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -183,7 +183,7 @@ func (client ServerAdministratorsClient) DeletePreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -243,6 +243,7 @@ func (client ServerAdministratorsClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +265,7 @@ func (client ServerAdministratorsClient) GetPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/Administrators/activeDirectory", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -319,6 +320,7 @@ func (client ServerAdministratorsClient) List(ctx context.Context, resourceGroup result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerAdministratorsClient", "List", resp, "Failure responding to request") + return } return @@ -340,7 +342,7 @@ func (client ServerAdministratorsClient) ListPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/administrators", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverbasedperformancetier.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverbasedperformancetier.go new file mode 100644 index 000000000000..2b17651605da --- /dev/null +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverbasedperformancetier.go @@ -0,0 +1,122 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerBasedPerformanceTierClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type ServerBasedPerformanceTierClient struct { + BaseClient +} + +// NewServerBasedPerformanceTierClient creates an instance of the ServerBasedPerformanceTierClient client. +func NewServerBasedPerformanceTierClient(subscriptionID string) ServerBasedPerformanceTierClient { + return NewServerBasedPerformanceTierClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerBasedPerformanceTierClientWithBaseURI creates an instance of the ServerBasedPerformanceTierClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewServerBasedPerformanceTierClientWithBaseURI(baseURI string, subscriptionID string) ServerBasedPerformanceTierClient { + return ServerBasedPerformanceTierClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list all the performance tiers for a PostgreSQL server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServerBasedPerformanceTierClient) List(ctx context.Context, resourceGroupName string, serverName string) (result PerformanceTierListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerBasedPerformanceTierClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerBasedPerformanceTierClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "postgresql.ServerBasedPerformanceTierClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerBasedPerformanceTierClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ServerBasedPerformanceTierClient) ListPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/performanceTiers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServerBasedPerformanceTierClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServerBasedPerformanceTierClient) ListResponder(resp *http.Response) (result PerformanceTierListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverparameters.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverparameters.go new file mode 100644 index 000000000000..593cf94b7f7b --- /dev/null +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serverparameters.go @@ -0,0 +1,124 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerParametersClient is the the Microsoft Azure management API provides create, read, update, and delete +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security +// alert policies, log files and configurations with new business model. +type ServerParametersClient struct { + BaseClient +} + +// NewServerParametersClient creates an instance of the ServerParametersClient client. +func NewServerParametersClient(subscriptionID string) ServerParametersClient { + return NewServerParametersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerParametersClientWithBaseURI creates an instance of the ServerParametersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewServerParametersClientWithBaseURI(baseURI string, subscriptionID string) ServerParametersClient { + return ServerParametersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListUpdateConfigurations update a list of configurations in a given server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// value - the parameters for updating a list of server configuration. +func (client ServerParametersClient) ListUpdateConfigurations(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult) (result ServerParametersListUpdateConfigurationsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerParametersClient.ListUpdateConfigurations") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListUpdateConfigurationsPreparer(ctx, resourceGroupName, serverName, value) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersClient", "ListUpdateConfigurations", nil, "Failure preparing request") + return + } + + result, err = client.ListUpdateConfigurationsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerParametersClient", "ListUpdateConfigurations", result.Response(), "Failure sending request") + return + } + + return +} + +// ListUpdateConfigurationsPreparer prepares the ListUpdateConfigurations request. +func (client ServerParametersClient) ListUpdateConfigurationsPreparer(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/updateConfigurations", pathParameters), + autorest.WithJSON(value), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUpdateConfigurationsSender sends the ListUpdateConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client ServerParametersClient) ListUpdateConfigurationsSender(req *http.Request) (future ServerParametersListUpdateConfigurationsFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ListUpdateConfigurationsResponder handles the response to the ListUpdateConfigurations request. The method always +// closes the http.Response Body. +func (client ServerParametersClient) ListUpdateConfigurationsResponder(resp *http.Response) (result ConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go index 49965d793307..2bc935366796 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/servers.go @@ -64,10 +64,10 @@ func (client ServersClient) Create(ctx context.Context, resourceGroupName string if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, }}, - {Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("postgresql.ServersClient", "Create", err.Error()) } @@ -104,7 +104,7 @@ func (client ServersClient) CreatePreparer(ctx context.Context, resourceGroupNam autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -181,7 +181,7 @@ func (client ServersClient) DeletePreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -241,6 +241,7 @@ func (client ServersClient) Get(ctx context.Context, resourceGroupName string, s result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Get", resp, "Failure responding to request") + return } return @@ -262,7 +263,7 @@ func (client ServersClient) GetPreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -313,6 +314,7 @@ func (client ServersClient) List(ctx context.Context) (result ServerListResult, result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "List", resp, "Failure responding to request") + return } return @@ -332,7 +334,7 @@ func (client ServersClient) ListPreparer(ctx context.Context) (*http.Request, er preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/servers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/servers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -386,6 +388,7 @@ func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGro result, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "ListByResourceGroup", resp, "Failure responding to request") + return } return @@ -406,7 +409,7 @@ func (client ServersClient) ListByResourceGroupPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -476,7 +479,7 @@ func (client ServersClient) RestartPreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/restart", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -554,7 +557,7 @@ func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupNam autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go index faaf2e70ee5d..d0ab03333daa 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/serversecurityalertpolicies.go @@ -94,7 +94,7 @@ func (client ServerSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx conte autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -156,6 +156,7 @@ func (client ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourc result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -178,7 +179,7 @@ func (client ServerSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go index 20d3fa818cd6..8afbe8577852 100644 --- a/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go +++ b/services/preview/postgresql/mgmt/2017-12-01-preview/postgresql/virtualnetworkrules.go @@ -103,7 +103,7 @@ func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Conte autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -182,7 +182,7 @@ func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -243,6 +243,7 @@ func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -265,7 +266,7 @@ func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -321,9 +322,11 @@ func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resour result.vnrlr, err = client.ListByServerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") + return } if result.vnrlr.hasNextLink() && result.vnrlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -345,7 +348,7 @@ func (client VirtualNetworkRulesClient) ListByServerPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/virtualNetworkRules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) }