diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go index cfd561e103df..9fb50e2e3bf1 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go @@ -118,7 +118,6 @@ func (client DatabasesClient) FailoverSender(req *http.Request) (future Database func (client DatabasesClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/databasesecurityalertpolicies.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/databasesecurityalertpolicies.go index d574615bd700..731481e7ca09 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/databasesecurityalertpolicies.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/databasesecurityalertpolicies.go @@ -119,7 +119,6 @@ func (client DatabaseSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http func (client DatabaseSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseSecurityAlertPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,7 +198,6 @@ func (client DatabaseSecurityAlertPoliciesClient) GetSender(req *http.Request) ( func (client DatabaseSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result DatabaseSecurityAlertPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -279,7 +277,6 @@ func (client DatabaseSecurityAlertPoliciesClient) ListByDatabaseSender(req *http func (client DatabaseSecurityAlertPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseSecurityAlertListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/elasticpools.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/elasticpools.go index 9e582d9f7b9f..485bf57ccea1 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/elasticpools.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/elasticpools.go @@ -114,7 +114,6 @@ func (client ElasticPoolsClient) FailoverSender(req *http.Request) (future Elast func (client ElasticPoolsClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/instancepools.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/instancepools.go index b524989eaabc..783e4f864f6e 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/instancepools.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/instancepools.go @@ -127,7 +127,6 @@ func (client InstancePoolsClient) CreateOrUpdateSender(req *http.Request) (futur func (client InstancePoolsClient) CreateOrUpdateResponder(resp *http.Response) (result InstancePool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -204,7 +203,6 @@ func (client InstancePoolsClient) DeleteSender(req *http.Request) (future Instan func (client InstancePoolsClient) 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 @@ -280,7 +278,6 @@ func (client InstancePoolsClient) GetSender(req *http.Request) (*http.Response, func (client InstancePoolsClient) GetResponder(resp *http.Response) (result InstancePool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -352,7 +349,6 @@ func (client InstancePoolsClient) ListSender(req *http.Request) (*http.Response, func (client InstancePoolsClient) ListResponder(resp *http.Response) (result InstancePoolListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -465,7 +461,6 @@ func (client InstancePoolsClient) ListByResourceGroupSender(req *http.Request) ( func (client InstancePoolsClient) ListByResourceGroupResponder(resp *http.Response) (result InstancePoolListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -582,7 +577,6 @@ func (client InstancePoolsClient) UpdateSender(req *http.Request) (future Instan func (client InstancePoolsClient) UpdateResponder(resp *http.Response) (result InstancePool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/longtermretentionmanagedinstancebackups.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/longtermretentionmanagedinstancebackups.go index ff083ab6473b..c7a84d2062af 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/longtermretentionmanagedinstancebackups.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/longtermretentionmanagedinstancebackups.go @@ -117,7 +117,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) DeleteSender(req *ht func (client LongTermRetentionManagedInstanceBackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -199,7 +198,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) DeleteByResourceGrou func (client LongTermRetentionManagedInstanceBackupsClient) DeleteByResourceGroupResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -278,7 +276,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) GetSender(req *http. func (client LongTermRetentionManagedInstanceBackupsClient) GetResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -361,7 +358,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroupSe func (client LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroupResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -448,7 +444,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabaseSender func (client LongTermRetentionManagedInstanceBackupsClient) ListByDatabaseResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -570,7 +565,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstanceSender func (client LongTermRetentionManagedInstanceBackupsClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -690,7 +684,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationSender func (client LongTermRetentionManagedInstanceBackupsClient) ListByLocationResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -817,7 +810,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupD func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabaseResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -942,7 +934,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupI func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstanceResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1065,7 +1056,6 @@ func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupL func (client LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocationResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionBackupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabaserestoredetails.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabaserestoredetails.go index dd48b6f9bcc9..d67fe5dc038b 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabaserestoredetails.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabaserestoredetails.go @@ -116,7 +116,6 @@ func (client ManagedDatabaseRestoreDetailsClient) GetSender(req *http.Request) ( func (client ManagedDatabaseRestoreDetailsClient) GetResponder(resp *http.Response) (result ManagedDatabaseRestoreDetailsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabases.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabases.go index f62ca3571d25..18b98b1b9b5d 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabases.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabases.go @@ -125,7 +125,6 @@ func (client ManagedDatabasesClient) CompleteRestoreSender(req *http.Request) (f func (client ManagedDatabasesClient) CompleteRestoreResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -206,7 +205,6 @@ func (client ManagedDatabasesClient) CreateOrUpdateSender(req *http.Request) (fu func (client ManagedDatabasesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedDatabase, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -285,7 +283,6 @@ func (client ManagedDatabasesClient) DeleteSender(req *http.Request) (future Man func (client ManagedDatabasesClient) 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 @@ -363,7 +360,6 @@ func (client ManagedDatabasesClient) GetSender(req *http.Request) (*http.Respons func (client ManagedDatabasesClient) GetResponder(resp *http.Response) (result ManagedDatabase, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -441,7 +437,6 @@ func (client ManagedDatabasesClient) ListByInstanceSender(req *http.Request) (*h func (client ManagedDatabasesClient) ListByInstanceResponder(resp *http.Response) (result ManagedDatabaseListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -560,7 +555,6 @@ func (client ManagedDatabasesClient) UpdateSender(req *http.Request) (future Man func (client ManagedDatabasesClient) UpdateResponder(resp *http.Response) (result ManagedDatabase, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabasesensitivitylabels.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabasesensitivitylabels.go index 23f59744b76e..6e8a24197b73 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabasesensitivitylabels.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/manageddatabasesensitivitylabels.go @@ -125,7 +125,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) CreateOrUpdateSender(req *h func (client ManagedDatabaseSensitivityLabelsClient) CreateOrUpdateResponder(resp *http.Response) (result SensitivityLabel, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -211,7 +210,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) DeleteSender(req *http.Requ func (client ManagedDatabaseSensitivityLabelsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -296,7 +294,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) DisableRecommendationSender func (client ManagedDatabaseSensitivityLabelsClient) DisableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -382,7 +379,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) EnableRecommendationSender( func (client ManagedDatabaseSensitivityLabelsClient) EnableRecommendationResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -468,7 +464,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) GetSender(req *http.Request func (client ManagedDatabaseSensitivityLabelsClient) GetResponder(resp *http.Response) (result SensitivityLabel, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -552,7 +547,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabaseSender func (client ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabaseResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -680,7 +674,6 @@ func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabaseSe func (client ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabaseResponder(resp *http.Response) (result SensitivityLabelListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancelongtermretentionpolicies.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancelongtermretentionpolicies.go index c27fe8371738..1034ec38bdfd 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancelongtermretentionpolicies.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancelongtermretentionpolicies.go @@ -120,7 +120,6 @@ func (client ManagedInstanceLongTermRetentionPoliciesClient) CreateOrUpdateSende func (client ManagedInstanceLongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -200,7 +199,6 @@ func (client ManagedInstanceLongTermRetentionPoliciesClient) GetSender(req *http func (client ManagedInstanceLongTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -280,7 +278,6 @@ func (client ManagedInstanceLongTermRetentionPoliciesClient) ListByDatabaseSende func (client ManagedInstanceLongTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result ManagedInstanceLongTermRetentionPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstanceoperations.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstanceoperations.go index 13a6fa27ad59..5f9a3ae247a1 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstanceoperations.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstanceoperations.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" "net/http" ) @@ -44,6 +45,83 @@ func NewManagedInstanceOperationsClientWithBaseURI(baseURI string, subscriptionI return ManagedInstanceOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// Get gets a management operation on a managed instance. +// 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. +// managedInstanceName - the name of the managed instance. +func (client ManagedInstanceOperationsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID uuid.UUID) (result ManagedInstanceOperation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationsClient.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, managedInstanceName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstanceOperationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ManagedInstanceOperationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstanceOperationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedInstanceOperationsClient) GetPreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-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.Sql/managedInstances/{managedInstanceName}/operations/{operationId}", 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 ManagedInstanceOperationsClient) 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 ManagedInstanceOperationsClient) GetResponder(resp *http.Response) (result ManagedInstanceOperation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListByManagedInstance gets a list of operations performed on the managed instance. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value @@ -114,7 +192,6 @@ func (client ManagedInstanceOperationsClient) ListByManagedInstanceSender(req *h func (client ManagedInstanceOperationsClient) ListByManagedInstanceResponder(resp *http.Response) (result ManagedInstanceOperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstances.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstances.go index 7c3f70dd188d..ecb0a48ccee8 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstances.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstances.go @@ -124,7 +124,6 @@ func (client ManagedInstancesClient) CreateOrUpdateSender(req *http.Request) (fu func (client ManagedInstancesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstance, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -201,7 +200,6 @@ func (client ManagedInstancesClient) DeleteSender(req *http.Request) (future Man func (client ManagedInstancesClient) 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 @@ -277,7 +275,6 @@ func (client ManagedInstancesClient) GetSender(req *http.Request) (*http.Respons func (client ManagedInstancesClient) GetResponder(resp *http.Response) (result ManagedInstance, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -349,7 +346,6 @@ func (client ManagedInstancesClient) ListSender(req *http.Request) (*http.Respon func (client ManagedInstancesClient) ListResponder(resp *http.Response) (result ManagedInstanceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -464,7 +460,6 @@ func (client ManagedInstancesClient) ListByInstancePoolSender(req *http.Request) func (client ManagedInstancesClient) ListByInstancePoolResponder(resp *http.Response) (result ManagedInstanceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -577,7 +572,6 @@ func (client ManagedInstancesClient) ListByResourceGroupSender(req *http.Request func (client ManagedInstancesClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedInstanceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -694,7 +688,6 @@ func (client ManagedInstancesClient) UpdateSender(req *http.Request) (future Man func (client ManagedInstancesClient) UpdateResponder(resp *http.Response) (result ManagedInstance, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancevulnerabilityassessments.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancevulnerabilityassessments.go index e5ac1184ccfd..384eece8c944 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancevulnerabilityassessments.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/managedinstancevulnerabilityassessments.go @@ -126,7 +126,6 @@ func (client ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdateSender func (client ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedInstanceVulnerabilityAssessment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -204,7 +203,6 @@ func (client ManagedInstanceVulnerabilityAssessmentsClient) DeleteSender(req *ht func (client ManagedInstanceVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -281,7 +279,6 @@ func (client ManagedInstanceVulnerabilityAssessmentsClient) GetSender(req *http. func (client ManagedInstanceVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result ManagedInstanceVulnerabilityAssessment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -359,7 +356,6 @@ func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstanceSender func (client ManagedInstanceVulnerabilityAssessmentsClient) ListByInstanceResponder(resp *http.Response) (result ManagedInstanceVulnerabilityAssessmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go index e9c2bd207d78..64a08eac0361 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go @@ -276,6 +276,29 @@ func PossibleSensitivityLabelSourceValues() []SensitivityLabelSource { return []SensitivityLabelSource{Current, Recommended} } +// Status enumerates the values for status. +type Status string + +const ( + // StatusCanceled ... + StatusCanceled Status = "Canceled" + // StatusCompleted ... + StatusCompleted Status = "Completed" + // StatusFailed ... + StatusFailed Status = "Failed" + // StatusInProgress ... + StatusInProgress Status = "InProgress" + // StatusNotStarted ... + StatusNotStarted Status = "NotStarted" + // StatusSlowedDown ... + StatusSlowedDown Status = "SlowedDown" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusCanceled, StatusCompleted, StatusFailed, StatusInProgress, StatusNotStarted, StatusSlowedDown} +} + // AdministratorListResult a list of active directory administrators. type AdministratorListResult struct { autorest.Response `json:"-"` @@ -2433,6 +2456,7 @@ func NewManagedInstanceLongTermRetentionPolicyListResultPage(getNextPage func(co // ManagedInstanceOperation a managed instance operation. type ManagedInstanceOperation struct { + autorest.Response `json:"-"` // ManagedInstanceOperationProperties - Resource properties. *ManagedInstanceOperationProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. @@ -2650,6 +2674,14 @@ func NewManagedInstanceOperationListResultPage(getNextPage func(context.Context, return ManagedInstanceOperationListResultPage{fn: getNextPage} } +// ManagedInstanceOperationParametersPair the parameters of a managed instance operation. +type ManagedInstanceOperationParametersPair struct { + // CurrentParameters - READ-ONLY; The current parameters. + CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty"` + // RequestedParameters - READ-ONLY; The requested parameters. + RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty"` +} + // ManagedInstanceOperationProperties the properties of a managed instance operation. type ManagedInstanceOperationProperties struct { // ManagedInstanceName - READ-ONLY; The name of the managed instance the operation is being performed on. @@ -2678,6 +2710,20 @@ type ManagedInstanceOperationProperties struct { Description *string `json:"description,omitempty"` // IsCancellable - READ-ONLY; Whether the operation can be cancelled. IsCancellable *bool `json:"isCancellable,omitempty"` + // OperationParameters - READ-ONLY; The operation parameters. + OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty"` + // OperationSteps - READ-ONLY; The operation steps. + OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty"` +} + +// ManagedInstanceOperationSteps the steps of a managed instance operation. +type ManagedInstanceOperationSteps struct { + // TotalSteps - READ-ONLY; The total number of operation steps. + TotalSteps *string `json:"totalSteps,omitempty"` + // CurrentStep - READ-ONLY; The number of current operation steps. + CurrentStep *int32 `json:"currentStep,omitempty"` + // StepsList - READ-ONLY; The operation steps list. + StepsList *[]UpsertManagedServerOperationStep `json:"stepsList,omitempty"` } // ManagedInstanceProperties the properties of a managed instance. @@ -2727,6 +2773,10 @@ type ManagedInstanceProperties struct { TimezoneID *string `json:"timezoneId,omitempty"` // InstancePoolID - The Id of the instance pool this managed server belongs to. InstancePoolID *string `json:"instancePoolId,omitempty"` + // MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance. + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' + MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` } // ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a @@ -4100,6 +4150,22 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UpsertManagedServerOperationParameters ... +type UpsertManagedServerOperationParameters struct { + Family *string `json:"family,omitempty"` + Tier *string `json:"tier,omitempty"` + VCores *int32 `json:"vCores,omitempty"` + StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"` +} + +// UpsertManagedServerOperationStep ... +type UpsertManagedServerOperationStep struct { + Order *int32 `json:"order,omitempty"` + Name *string `json:"name,omitempty"` + // Status - Possible values include: 'StatusNotStarted', 'StatusInProgress', 'StatusSlowedDown', 'StatusCompleted', 'StatusFailed', 'StatusCanceled' + Status Status `json:"status,omitempty"` +} + // Usage ARM usage. type Usage struct { // ID - READ-ONLY; Resource ID. diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/privateendpointconnections.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/privateendpointconnections.go index 4864e55c498d..b5a632431e3b 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/privateendpointconnections.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/privateendpointconnections.go @@ -128,7 +128,6 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Re func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,7 +205,6 @@ func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) ( func (client PrivateEndpointConnectionsClient) 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 @@ -284,7 +282,6 @@ func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*ht func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -362,7 +359,6 @@ func (client PrivateEndpointConnectionsClient) ListByServerSender(req *http.Requ func (client PrivateEndpointConnectionsClient) ListByServerResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/serverazureadadministrators.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/serverazureadadministrators.go index 59524fc1c726..2c18e936d8cc 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/serverazureadadministrators.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/serverazureadadministrators.go @@ -129,7 +129,6 @@ func (client ServerAzureADAdministratorsClient) CreateOrUpdateSender(req *http.R func (client ServerAzureADAdministratorsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerAzureADAdministrator, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client ServerAzureADAdministratorsClient) DeleteSender(req *http.Request) func (client ServerAzureADAdministratorsClient) 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 @@ -284,7 +282,6 @@ func (client ServerAzureADAdministratorsClient) GetSender(req *http.Request) (*h func (client ServerAzureADAdministratorsClient) GetResponder(resp *http.Response) (result ServerAzureADAdministrator, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -362,7 +359,6 @@ func (client ServerAzureADAdministratorsClient) ListByServerSender(req *http.Req func (client ServerAzureADAdministratorsClient) ListByServerResponder(resp *http.Response) (result AdministratorListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/servervulnerabilityassessments.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/servervulnerabilityassessments.go index a4a9c38b404c..a6ea28cd5bc1 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/servervulnerabilityassessments.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/servervulnerabilityassessments.go @@ -125,7 +125,6 @@ func (client ServerVulnerabilityAssessmentsClient) CreateOrUpdateSender(req *htt func (client ServerVulnerabilityAssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerVulnerabilityAssessment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -203,7 +202,6 @@ func (client ServerVulnerabilityAssessmentsClient) DeleteSender(req *http.Reques func (client ServerVulnerabilityAssessmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -280,7 +278,6 @@ func (client ServerVulnerabilityAssessmentsClient) GetSender(req *http.Request) func (client ServerVulnerabilityAssessmentsClient) GetResponder(resp *http.Response) (result ServerVulnerabilityAssessment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -358,7 +355,6 @@ func (client ServerVulnerabilityAssessmentsClient) ListByServerSender(req *http. func (client ServerVulnerabilityAssessmentsClient) ListByServerResponder(resp *http.Response) (result ServerVulnerabilityAssessmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go index 1e63e9d2ef70..aa080061588f 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" "github.com/Azure/go-autorest/autorest" + "github.com/satori/go.uuid" ) // DatabaseSecurityAlertPoliciesClientAPI contains the set of methods on the DatabaseSecurityAlertPoliciesClient type. @@ -61,6 +62,7 @@ var _ ManagedInstanceVulnerabilityAssessmentsClientAPI = (*sql.ManagedInstanceVu // ManagedInstanceOperationsClientAPI contains the set of methods on the ManagedInstanceOperationsClient type. type ManagedInstanceOperationsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID uuid.UUID) (result sql.ManagedInstanceOperation, err error) ListByManagedInstance(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceOperationListResultPage, err error) ListByManagedInstanceComplete(ctx context.Context, resourceGroupName string, managedInstanceName string) (result sql.ManagedInstanceOperationListResultIterator, err error) } diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/usages.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/usages.go index 3d3f39be5e15..5a341c288a55 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/usages.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/usages.go @@ -117,7 +117,6 @@ func (client UsagesClient) ListByInstancePoolSender(req *http.Request) (*http.Re func (client UsagesClient) ListByInstancePoolResponder(resp *http.Response) (result UsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/version.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/version.go index 121c4d1ec35e..260e727213c9 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/version.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " sql/2018-06-01-preview" + return "Azure-SDK-For-Go/" + Version() + " sql/2018-06-01-preview" } // Version returns the semantic version (see http://semver.org) of the client.