diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go b/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go index 2fe6378d7bfd..18b9f04698fd 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go @@ -26,8 +26,7 @@ import ( ) // CheckNameAvailabilityClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type CheckNameAvailabilityClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/client.go b/services/mysql/mgmt/2017-04-30-preview/mysql/client.go index eaaf2b5e71da..8fb41d952da2 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/client.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/client.go @@ -1,7 +1,7 @@ // Package mysql implements the Azure ARM Mysql service API version 2017-04-30-preview. // // The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources -// including servers, databases, firewall rules, VNET rules, log files and configurations. +// including servers, databases, firewall rules, log files and configurations. package mysql // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go b/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go index b4f2e72d6cf0..89703f5aa99e 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go @@ -25,8 +25,7 @@ import ( ) // ConfigurationsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type ConfigurationsClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go b/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go index a23d07db3bed..4b6cf0efdbe1 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go @@ -25,7 +25,7 @@ import ( ) // DatabasesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type DatabasesClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go b/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go index 18742fc4b380..d64978bfbab1 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go @@ -26,8 +26,7 @@ import ( ) // FirewallRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type FirewallRulesClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go b/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go index 42021ed107fd..be6a669bbf66 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go @@ -25,8 +25,8 @@ import ( ) // LocationBasedPerformanceTierClient is the the Microsoft Azure management API provides create, read, update, and -// delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files -// and configurations. +// delete functionality for Azure MySQL resources including servers, databases, firewall rules, log files and +// configurations. type LocationBasedPerformanceTierClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go b/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go index f0aca9cbf130..428fcb069f36 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go @@ -25,7 +25,7 @@ import ( ) // LogFilesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type LogFilesClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/models.go b/services/mysql/mgmt/2017-04-30-preview/mysql/models.go index fbeb080dbfa2..45bad97a2593 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/models.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/models.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" "net/http" ) @@ -92,22 +91,6 @@ const ( SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" ) -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // VirtualNetworkRuleStateDeleting ... - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - // VirtualNetworkRuleStateInitializing ... - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - // VirtualNetworkRuleStateInProgress ... - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - // VirtualNetworkRuleStateReady ... - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - // VirtualNetworkRuleStateUnknown ... - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" -) - // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"` @@ -209,22 +192,30 @@ func (future ConfigurationsCreateOrUpdateFuture) Result(client ConfigurationsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return c, autorest.NewError("mysql.ConfigurationsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return c, azure.NewAsyncOpIncompleteError("mysql.ConfigurationsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { c, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } c, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -320,22 +311,30 @@ func (future DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Da var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("mysql.DatabasesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("mysql.DatabasesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -351,22 +350,30 @@ func (future DatabasesDeleteFuture) Result(client DatabasesClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("mysql.DatabasesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("mysql.DatabasesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -463,22 +470,30 @@ func (future FirewallRulesCreateOrUpdateFuture) Result(client FirewallRulesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fr, autorest.NewError("mysql.FirewallRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return fr, azure.NewAsyncOpIncompleteError("mysql.FirewallRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { fr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } fr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -494,22 +509,30 @@ func (future FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("mysql.FirewallRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("mysql.FirewallRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1073,22 +1096,30 @@ func (future ServersCreateOrUpdateFuture) Result(client ServersClient) (s Server var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("mysql.ServersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("mysql.ServersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1104,22 +1135,30 @@ func (future ServersDeleteFuture) Result(client ServersClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("mysql.ServersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("mysql.ServersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1135,22 +1174,30 @@ func (future ServersUpdateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("mysql.ServersUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("mysql.ServersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1245,244 +1292,3 @@ type TrackedResource struct { // Tags - Application-specific metadata in the form of key-value pairs. Tags *map[string]*string `json:"tags,omitempty"` } - -// VirtualNetworkRule a virtual network rule. -type VirtualNetworkRule struct { - autorest.Response `json:"-"` - // ID - Resource ID - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vnr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vnr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - - return nil -} - -// VirtualNetworkRuleListResult a list of virtual network rules. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - Array of results. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkRuleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkRuleListResultPage) Next() error { - next, err := page.fn(page.vnrlr) - if err != nil { - return err - } - page.vnrlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// VirtualNetworkRuleProperties properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` - // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' - State VirtualNetworkRuleState `json:"state,omitempty"` -} - -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesCreateOrUpdateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return vnr, autorest.NewError("mysql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - vnr, err = client.CreateOrUpdateResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - vnr, err = client.CreateOrUpdateResponder(resp) - return -} - -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesDeleteFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("mysql.VirtualNetworkRulesDeleteFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteResponder(resp) - return -} diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go b/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go index bef9c1a0b767..921148785f33 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go @@ -25,7 +25,7 @@ import ( ) // OperationsClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type OperationsClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go b/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go index 6c4231906199..c7db15a3fee5 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go @@ -25,8 +25,7 @@ import ( ) // PerformanceTiersClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type PerformanceTiersClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go b/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go index 2ba105ecbd5a..5e6b843032b8 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go @@ -26,7 +26,7 @@ import ( ) // ServersClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type ServersClient struct { BaseClient } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/version.go b/services/mysql/mgmt/2017-04-30-preview/mysql/version.go index 98d1d47e071f..8c0a2becfea1 100644 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/version.go +++ b/services/mysql/mgmt/2017-04-30-preview/mysql/version.go @@ -19,10 +19,10 @@ package mysql // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.1.1-beta services" + return "Azure-SDK-For-Go/v12.2.1-beta services" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.1.1-beta" + return "v12.2.1-beta" } diff --git a/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go b/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go deleted file mode 100644 index 8b0f96eba296..000000000000 --- a/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go +++ /dev/null @@ -1,357 +0,0 @@ -package mysql - -// 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/autorest/validation" - "net/http" -) - -// VirtualNetworkRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. -type VirtualNetworkRulesClient struct { - BaseClient -} - -// NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an existing virtual network rule. -// -// resourceGroupName is 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 is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. parameters is the requested virtual Network Rule Resource state. -func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "mysql.VirtualNetworkRulesClient", "CreateOrUpdate") - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkRulesCreateOrUpdateFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the virtual network rule with the given name. -// -// resourceGroupName is 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 is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkRulesDeleteFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual network rule. -// -// resourceGroupName is 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 is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-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.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of virtual network rules in a server. -// -// resourceGroupName is 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 is the name of the server. -func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.vnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.vnrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client VirtualNetworkRulesClient) ListByServerPreparer(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-04-30-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.DBforMySQL/servers/{serverName}/virtualNetworkRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client VirtualNetworkRulesClient) listByServerNextResults(lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { - req, err := lastResults.virtualNetworkRuleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultIterator, err error) { - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go index 29e445e60a79..3306d08c5b1b 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go @@ -26,7 +26,7 @@ import ( ) // CheckNameAvailabilityClient 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, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type CheckNameAvailabilityClient struct { BaseClient diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go index 785e8418f89b..6c97a46756e5 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go @@ -1,7 +1,7 @@ // Package postgresql implements the Azure ARM Postgresql service API version 2017-04-30-preview. // // The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL -// resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// resources including servers, databases, firewall rules, log files and configurations. package postgresql // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go index 6197dd99badc..abcd2d284ec1 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go @@ -25,7 +25,7 @@ import ( ) // ConfigurationsClient 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, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type ConfigurationsClient struct { BaseClient diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go index 5d39b3d6a54d..de74f8be17b2 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go @@ -25,8 +25,7 @@ import ( ) // DatabasesClient 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, log files and -// configurations. +// for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type DatabasesClient struct { BaseClient } diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go index 278875996a74..f136834aaad2 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go @@ -26,7 +26,7 @@ import ( ) // FirewallRulesClient 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, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type FirewallRulesClient struct { BaseClient diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go index 9ebcecfdc7ca..7e24e1ce81f8 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go @@ -25,8 +25,8 @@ import ( ) // LocationBasedPerformanceTierClient 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, log -// files and configurations. +// delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and +// configurations. type LocationBasedPerformanceTierClient struct { BaseClient } diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go index 9071c55206b5..55f242da7dc6 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go @@ -25,7 +25,7 @@ import ( ) // LogFilesClient 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, log files and configurations. +// Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type LogFilesClient struct { BaseClient } diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go index d27c184bde12..321a1029584d 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" "net/http" ) @@ -92,22 +91,6 @@ const ( SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" ) -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // VirtualNetworkRuleStateDeleting ... - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - // VirtualNetworkRuleStateInitializing ... - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - // VirtualNetworkRuleStateInProgress ... - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - // VirtualNetworkRuleStateReady ... - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - // VirtualNetworkRuleStateUnknown ... - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" -) - // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"` @@ -209,22 +192,30 @@ func (future ConfigurationsCreateOrUpdateFuture) Result(client ConfigurationsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return c, autorest.NewError("postgresql.ConfigurationsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return c, azure.NewAsyncOpIncompleteError("postgresql.ConfigurationsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { c, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } c, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -320,22 +311,30 @@ func (future DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Da var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("postgresql.DatabasesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("postgresql.DatabasesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -351,22 +350,30 @@ func (future DatabasesDeleteFuture) Result(client DatabasesClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("postgresql.DatabasesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("postgresql.DatabasesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -463,22 +470,30 @@ func (future FirewallRulesCreateOrUpdateFuture) Result(client FirewallRulesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fr, autorest.NewError("postgresql.FirewallRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return fr, azure.NewAsyncOpIncompleteError("postgresql.FirewallRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { fr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } fr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -494,22 +509,30 @@ func (future FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("postgresql.FirewallRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("postgresql.FirewallRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1073,22 +1096,30 @@ func (future ServersCreateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("postgresql.ServersCreateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("postgresql.ServersCreateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1104,22 +1135,30 @@ func (future ServersDeleteFuture) Result(client ServersClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("postgresql.ServersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("postgresql.ServersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1135,22 +1174,30 @@ func (future ServersUpdateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("postgresql.ServersUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("postgresql.ServersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1245,244 +1292,3 @@ type TrackedResource struct { // Tags - Application-specific metadata in the form of key-value pairs. Tags *map[string]*string `json:"tags,omitempty"` } - -// VirtualNetworkRule a virtual network rule. -type VirtualNetworkRule struct { - autorest.Response `json:"-"` - // ID - Resource ID - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vnr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vnr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - - return nil -} - -// VirtualNetworkRuleListResult a list of virtual network rules. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - Array of results. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkRuleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkRuleListResultPage) Next() error { - next, err := page.fn(page.vnrlr) - if err != nil { - return err - } - page.vnrlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// VirtualNetworkRuleProperties properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` - // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' - State VirtualNetworkRuleState `json:"state,omitempty"` -} - -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesCreateOrUpdateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return vnr, autorest.NewError("postgresql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - vnr, err = client.CreateOrUpdateResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - vnr, err = client.CreateOrUpdateResponder(resp) - return -} - -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesDeleteFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("postgresql.VirtualNetworkRulesDeleteFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteResponder(resp) - return -} diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go index f74784add21e..b9e3b4c75591 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go @@ -25,8 +25,7 @@ import ( ) // OperationsClient 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, log files and -// configurations. +// for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type OperationsClient struct { BaseClient } diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go index cc6ce2f269f7..c55894d8af49 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go @@ -25,7 +25,7 @@ import ( ) // PerformanceTiersClient 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, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type PerformanceTiersClient struct { BaseClient diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go index cffb6bfc4418..455b605f7e62 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go @@ -26,7 +26,7 @@ import ( ) // ServersClient 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, log files and configurations. +// Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type ServersClient struct { BaseClient } diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go index 32e98908d99b..6268234d9a23 100644 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go +++ b/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go @@ -19,10 +19,10 @@ package postgresql // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.1.1-beta services" + return "Azure-SDK-For-Go/v12.2.1-beta services" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.1.1-beta" + return "v12.2.1-beta" } diff --git a/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go b/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go deleted file mode 100644 index ad3cde800ccd..000000000000 --- a/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go +++ /dev/null @@ -1,357 +0,0 @@ -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/autorest/validation" - "net/http" -) - -// VirtualNetworkRulesClient 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, log files and -// configurations. -type VirtualNetworkRulesClient struct { - BaseClient -} - -// NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an existing virtual network rule. -// -// resourceGroupName is 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 is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. parameters is the requested virtual Network Rule Resource state. -func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "postgresql.VirtualNetworkRulesClient", "CreateOrUpdate") - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - 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)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkRulesCreateOrUpdateFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the virtual network rule with the given name. -// -// resourceGroupName is 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 is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkRulesDeleteFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual network rule. -// -// resourceGroupName is 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 is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "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.VirtualNetworkRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-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}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of virtual network rules in a server. -// -// resourceGroupName is 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 is the name of the server. -func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.vnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.vnrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client VirtualNetworkRulesClient) ListByServerPreparer(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-04-30-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}/virtualNetworkRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client VirtualNetworkRulesClient) listByServerNextResults(lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { - req, err := lastResults.virtualNetworkRuleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultIterator, err error) { - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -}