diff --git a/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go b/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go index 389ad50698f3..a3fb9d42db63 100644 --- a/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go +++ b/profiles/preview/preview/sqlvirtualmachine/mgmt/sqlvirtualmachine/models.go @@ -142,6 +142,14 @@ const ( HA ScaleType = original.HA ) +type StorageWorkloadType = original.StorageWorkloadType + +const ( + StorageWorkloadTypeDW StorageWorkloadType = original.StorageWorkloadTypeDW + StorageWorkloadTypeGENERAL StorageWorkloadType = original.StorageWorkloadTypeGENERAL + StorageWorkloadTypeOLTP StorageWorkloadType = original.StorageWorkloadTypeOLTP +) + type AdditionalFeaturesServerConfigurations = original.AdditionalFeaturesServerConfigurations type AutoBackupSettings = original.AutoBackupSettings type AutoPatchingSettings = original.AutoPatchingSettings @@ -181,6 +189,7 @@ type ProxyResource = original.ProxyResource type Resource = original.Resource type ResourceIdentity = original.ResourceIdentity type SQLConnectivityUpdateSettings = original.SQLConnectivityUpdateSettings +type SQLStorageSettings = original.SQLStorageSettings type SQLStorageUpdateSettings = original.SQLStorageUpdateSettings type SQLVirtualMachine = original.SQLVirtualMachine type SQLVirtualMachinesClient = original.SQLVirtualMachinesClient @@ -189,6 +198,7 @@ type SQLVirtualMachinesDeleteFutureType = original.SQLVirtualMachinesDeleteFutur type SQLVirtualMachinesUpdateFutureType = original.SQLVirtualMachinesUpdateFutureType type SQLWorkloadTypeUpdateSettings = original.SQLWorkloadTypeUpdateSettings type ServerConfigurationsManagementSettings = original.ServerConfigurationsManagementSettings +type StorageConfigurationSettings = original.StorageConfigurationSettings type TrackedResource = original.TrackedResource type Update = original.Update type WsfcDomainCredentials = original.WsfcDomainCredentials @@ -293,6 +303,9 @@ func PossibleSQLWorkloadTypeValues() []SQLWorkloadType { func PossibleScaleTypeValues() []ScaleType { return original.PossibleScaleTypeValues() } +func PossibleStorageWorkloadTypeValues() []StorageWorkloadType { + return original.PossibleStorageWorkloadTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go index 95ed1722326a..2be41094dae8 100644 --- a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go +++ b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/models.go @@ -272,6 +272,23 @@ func PossibleSQLWorkloadTypeValues() []SQLWorkloadType { return []SQLWorkloadType{DW, GENERAL, OLTP} } +// StorageWorkloadType enumerates the values for storage workload type. +type StorageWorkloadType string + +const ( + // StorageWorkloadTypeDW ... + StorageWorkloadTypeDW StorageWorkloadType = "DW" + // StorageWorkloadTypeGENERAL ... + StorageWorkloadTypeGENERAL StorageWorkloadType = "GENERAL" + // StorageWorkloadTypeOLTP ... + StorageWorkloadTypeOLTP StorageWorkloadType = "OLTP" +) + +// PossibleStorageWorkloadTypeValues returns an array of possible values for the StorageWorkloadType const type. +func PossibleStorageWorkloadTypeValues() []StorageWorkloadType { + return []StorageWorkloadType{StorageWorkloadTypeDW, StorageWorkloadTypeGENERAL, StorageWorkloadTypeOLTP} +} + // AdditionalFeaturesServerConfigurations additional SQL Server feature settings. type AdditionalFeaturesServerConfigurations struct { // IsRServicesEnabled - Enable or disable R services (SQL 2016 onwards). @@ -1348,6 +1365,8 @@ type Properties struct { KeyVaultCredentialSettings *KeyVaultCredentialSettings `json:"keyVaultCredentialSettings,omitempty"` // ServerConfigurationsManagementSettings - SQL Server configuration management settings. ServerConfigurationsManagementSettings *ServerConfigurationsManagementSettings `json:"serverConfigurationsManagementSettings,omitempty"` + // StorageConfigurationSettings - Storage Configuration Settings. + StorageConfigurationSettings *StorageConfigurationSettings `json:"storageConfigurationSettings,omitempty"` } // ProxyResource ARM proxy resource. @@ -1404,6 +1423,14 @@ type SQLConnectivityUpdateSettings struct { SQLAuthUpdatePassword *string `json:"sqlAuthUpdatePassword,omitempty"` } +// SQLStorageSettings set disk storage settings for SQL Server. +type SQLStorageSettings struct { + // Luns - Logical Unit Numbers for the disks. + Luns *[]int32 `json:"luns,omitempty"` + // DefaultFilePath - SQL Server default file path + DefaultFilePath *string `json:"defaultFilePath,omitempty"` +} + // SQLStorageUpdateSettings set disk storage settings for SQL Server. type SQLStorageUpdateSettings struct { // DiskCount - Virtual machine disk count. @@ -1616,6 +1643,20 @@ type SQLWorkloadTypeUpdateSettings struct { SQLWorkloadType SQLWorkloadType `json:"sqlWorkloadType,omitempty"` } +// StorageConfigurationSettings storage Configurations for SQL Data, Log and TempDb. +type StorageConfigurationSettings struct { + // SQLDataSettings - SQL Server Data Storage Settings. + SQLDataSettings *SQLStorageSettings `json:"sqlDataSettings,omitempty"` + // SQLLogSettings - SQL Server Log Storage Settings. + SQLLogSettings *SQLStorageSettings `json:"sqlLogSettings,omitempty"` + // SQLTempDbSettings - SQL Server TempDb Storage Settings. + SQLTempDbSettings *SQLStorageSettings `json:"sqlTempDbSettings,omitempty"` + // DiskConfigurationType - Disk configuration to apply to SQL Server. Possible values include: 'NEW', 'EXTEND', 'ADD' + DiskConfigurationType DiskConfigurationType `json:"diskConfigurationType,omitempty"` + // StorageWorkloadType - Storage workload type. Possible values include: 'StorageWorkloadTypeGENERAL', 'StorageWorkloadTypeOLTP', 'StorageWorkloadTypeDW' + StorageWorkloadType StorageWorkloadType `json:"storageWorkloadType,omitempty"` +} + // TrackedResource ARM tracked top level resource. type TrackedResource struct { // Location - Resource location. diff --git a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go index 5b767f58666e..65cee379b0d0 100644 --- a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go +++ b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachineapi/interfaces.go @@ -58,6 +58,7 @@ type SQLVirtualMachinesClientAPI interface { Get(ctx context.Context, resourceGroupName string, SQLVirtualMachineName string, expand string) (result sqlvirtualmachine.SQLVirtualMachine, err error) List(ctx context.Context) (result sqlvirtualmachine.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result sqlvirtualmachine.ListResultPage, err error) + ListBySQLVMGroup(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (result sqlvirtualmachine.ListResultPage, err error) Update(ctx context.Context, resourceGroupName string, SQLVirtualMachineName string, parameters sqlvirtualmachine.Update) (result sqlvirtualmachine.SQLVirtualMachinesUpdateFutureType, err error) } diff --git a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go index a7e6269dfccc..67d4e85ecac2 100644 --- a/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go +++ b/services/preview/sqlvirtualmachine/mgmt/2017-03-01-preview/sqlvirtualmachine/sqlvirtualmachines.go @@ -507,6 +507,122 @@ func (client SQLVirtualMachinesClient) ListByResourceGroupComplete(ctx context.C return } +// ListBySQLVMGroup gets the list of sql virtual machines in a SQL virtual machine group. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLVirtualMachineGroupName - name of the SQL virtual machine group. +func (client SQLVirtualMachinesClient) ListBySQLVMGroup(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVirtualMachinesClient.ListBySQLVMGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySQLVMGroupNextResults + req, err := client.ListBySQLVMGroupPreparer(ctx, resourceGroupName, SQLVirtualMachineGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "ListBySQLVMGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySQLVMGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "ListBySQLVMGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListBySQLVMGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "ListBySQLVMGroup", resp, "Failure responding to request") + } + + return +} + +// ListBySQLVMGroupPreparer prepares the ListBySQLVMGroup request. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupPreparer(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlVirtualMachineGroupName": autorest.Encode("path", SQLVirtualMachineGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-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.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/sqlVirtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySQLVMGroupSender sends the ListBySQLVMGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySQLVMGroupResponder handles the response to the ListBySQLVMGroup request. The method always +// closes the http.Response Body. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySQLVMGroupNextResults retrieves the next set of results, if any. +func (client SQLVirtualMachinesClient) listBySQLVMGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "listBySQLVMGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySQLVMGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "listBySQLVMGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySQLVMGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sqlvirtualmachine.SQLVirtualMachinesClient", "listBySQLVMGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySQLVMGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLVirtualMachinesClient) ListBySQLVMGroupComplete(ctx context.Context, resourceGroupName string, SQLVirtualMachineGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVirtualMachinesClient.ListBySQLVMGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySQLVMGroup(ctx, resourceGroupName, SQLVirtualMachineGroupName) + return +} + // Update updates a SQL virtual machine. // Parameters: // resourceGroupName - name of the resource group that contains the resource. You can obtain this value from