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..52dd42eb0eca 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,84 @@ 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, + client.ByInspecting(), + 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 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..428ecc465e13 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 @@ -2433,6 +2433,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. @@ -2727,6 +2728,8 @@ 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"` + // 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 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/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.