diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index 0d80dd1aa71c..7304674d88f3 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservi type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI +type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go index 683b49dd75be..ee20b507ed49 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go @@ -100,6 +100,12 @@ const ( Updating ProvisioningState = original.Updating ) +type QuotaUnit = original.QuotaUnit + +const ( + Count QuotaUnit = original.Count +) + type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess const ( @@ -117,8 +123,19 @@ const ( type Status = original.Status const ( - StatusDisabled Status = original.StatusDisabled - StatusEnabled Status = original.StatusEnabled + Failure Status = original.Failure + InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum + InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit + InvalidVMFamilyName Status = original.InvalidVMFamilyName + Success Status = original.Success + Undefined Status = original.Undefined +) + +type Status1 = original.Status1 + +const ( + Status1Disabled Status1 = original.Status1Disabled + Status1Enabled Status1 = original.Status1Enabled ) type UnderlyingResourceAction = original.UnderlyingResourceAction @@ -131,7 +148,7 @@ const ( type UsageUnit = original.UsageUnit const ( - Count UsageUnit = original.Count + UsageUnitCount UsageUnit = original.UsageUnitCount ) type VMPriority = original.VMPriority @@ -176,6 +193,9 @@ type ListUsagesResult = original.ListUsagesResult type ListUsagesResultIterator = original.ListUsagesResultIterator type ListUsagesResultPage = original.ListUsagesResultPage type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult +type ListWorkspaceQuotas = original.ListWorkspaceQuotas +type ListWorkspaceQuotasIterator = original.ListWorkspaceQuotasIterator +type ListWorkspaceQuotasPage = original.ListWorkspaceQuotasPage type MachineLearningComputeClient = original.MachineLearningComputeClient type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture @@ -189,13 +209,20 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage type Password = original.Password +type QuotaBaseProperties = original.QuotaBaseProperties +type QuotaUpdateParameters = original.QuotaUpdateParameters +type QuotasClient = original.QuotasClient type RegistryListCredentialsResult = original.RegistryListCredentialsResult type Resource = original.Resource type ResourceID = original.ResourceID +type ResourceName = original.ResourceName +type ResourceQuota = original.ResourceQuota type ScaleSettings = original.ScaleSettings type ServicePrincipalCredentials = original.ServicePrincipalCredentials type SslConfiguration = original.SslConfiguration type SystemService = original.SystemService +type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas +type UpdateWorkspaceQuotasResult = original.UpdateWorkspaceQuotasResult type Usage = original.Usage type UsageName = original.UsageName type UsagesClient = original.UsagesClient @@ -225,6 +252,12 @@ func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIter func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { return original.NewListUsagesResultPage(getNextPage) } +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return original.NewListWorkspaceQuotasIterator(page) +} +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return original.NewListWorkspaceQuotasPage(getNextPage) +} func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { return original.NewMachineLearningComputeClient(subscriptionID) } @@ -243,6 +276,12 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { return original.NewPaginatedComputeResourcesListPage(getNextPage) } +func NewQuotasClient(subscriptionID string) QuotasClient { + return original.NewQuotasClient(subscriptionID) +} +func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -291,12 +330,18 @@ func PossibleNodeStateValues() []NodeState { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleQuotaUnitValues() []QuotaUnit { + return original.PossibleQuotaUnitValues() +} func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { return original.PossibleRemoteLoginPortPublicAccessValues() } func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } +func PossibleStatus1Values() []Status1 { + return original.PossibleStatus1Values() +} func PossibleStatusValues() []Status { return original.PossibleStatusValues() } diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index 0d80dd1aa71c..7304674d88f3 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservi type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI +type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go index de8a0ceee1f8..d685dcb8580c 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go @@ -100,6 +100,12 @@ const ( Updating ProvisioningState = original.Updating ) +type QuotaUnit = original.QuotaUnit + +const ( + Count QuotaUnit = original.Count +) + type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess const ( @@ -117,8 +123,19 @@ const ( type Status = original.Status const ( - StatusDisabled Status = original.StatusDisabled - StatusEnabled Status = original.StatusEnabled + Failure Status = original.Failure + InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum + InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit + InvalidVMFamilyName Status = original.InvalidVMFamilyName + Success Status = original.Success + Undefined Status = original.Undefined +) + +type Status1 = original.Status1 + +const ( + Status1Disabled Status1 = original.Status1Disabled + Status1Enabled Status1 = original.Status1Enabled ) type UnderlyingResourceAction = original.UnderlyingResourceAction @@ -131,7 +148,7 @@ const ( type UsageUnit = original.UsageUnit const ( - Count UsageUnit = original.Count + UsageUnitCount UsageUnit = original.UsageUnitCount ) type VMPriority = original.VMPriority @@ -176,6 +193,9 @@ type ListUsagesResult = original.ListUsagesResult type ListUsagesResultIterator = original.ListUsagesResultIterator type ListUsagesResultPage = original.ListUsagesResultPage type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult +type ListWorkspaceQuotas = original.ListWorkspaceQuotas +type ListWorkspaceQuotasIterator = original.ListWorkspaceQuotasIterator +type ListWorkspaceQuotasPage = original.ListWorkspaceQuotasPage type MachineLearningComputeClient = original.MachineLearningComputeClient type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture @@ -189,13 +209,20 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage type Password = original.Password +type QuotaBaseProperties = original.QuotaBaseProperties +type QuotaUpdateParameters = original.QuotaUpdateParameters +type QuotasClient = original.QuotasClient type RegistryListCredentialsResult = original.RegistryListCredentialsResult type Resource = original.Resource type ResourceID = original.ResourceID +type ResourceName = original.ResourceName +type ResourceQuota = original.ResourceQuota type ScaleSettings = original.ScaleSettings type ServicePrincipalCredentials = original.ServicePrincipalCredentials type SslConfiguration = original.SslConfiguration type SystemService = original.SystemService +type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas +type UpdateWorkspaceQuotasResult = original.UpdateWorkspaceQuotasResult type Usage = original.Usage type UsageName = original.UsageName type UsagesClient = original.UsagesClient @@ -225,6 +252,12 @@ func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIter func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { return original.NewListUsagesResultPage(getNextPage) } +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return original.NewListWorkspaceQuotasIterator(page) +} +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return original.NewListWorkspaceQuotasPage(getNextPage) +} func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { return original.NewMachineLearningComputeClient(subscriptionID) } @@ -243,6 +276,12 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { return original.NewPaginatedComputeResourcesListPage(getNextPage) } +func NewQuotasClient(subscriptionID string) QuotasClient { + return original.NewQuotasClient(subscriptionID) +} +func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -291,12 +330,18 @@ func PossibleNodeStateValues() []NodeState { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleQuotaUnitValues() []QuotaUnit { + return original.PossibleQuotaUnitValues() +} func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { return original.PossibleRemoteLoginPortPublicAccessValues() } func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } +func PossibleStatus1Values() []Status1 { + return original.PossibleStatus1Values() +} func PossibleStatusValues() []Status { return original.PossibleStatusValues() } diff --git a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go index 6eee7c0c701c..c39f8f4a8e59 100644 --- a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -58,6 +58,14 @@ type VirtualMachineSizesClientAPI interface { var _ VirtualMachineSizesClientAPI = (*machinelearningservices.VirtualMachineSizesClient)(nil) +// QuotasClientAPI contains the set of methods on the QuotasClient type. +type QuotasClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.ListWorkspaceQuotasPage, err error) + Update(ctx context.Context, location string, parameters machinelearningservices.QuotaUpdateParameters) (result machinelearningservices.UpdateWorkspaceQuotasResult, err error) +} + +var _ QuotasClientAPI = (*machinelearningservices.QuotasClient)(nil) + // MachineLearningComputeClientAPI contains the set of methods on the MachineLearningComputeClient type. type MachineLearningComputeClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters machinelearningservices.ComputeResource) (result machinelearningservices.MachineLearningComputeCreateOrUpdateFuture, err error) diff --git a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go index 4281ddbfef3b..7086dd2e9dad 100644 --- a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/models.go @@ -181,6 +181,19 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Unknown, Updating} } +// QuotaUnit enumerates the values for quota unit. +type QuotaUnit string + +const ( + // Count ... + Count QuotaUnit = "Count" +) + +// PossibleQuotaUnitValues returns an array of possible values for the QuotaUnit const type. +func PossibleQuotaUnitValues() []QuotaUnit { + return []QuotaUnit{Count} +} + // RemoteLoginPortPublicAccess enumerates the values for remote login port public access. type RemoteLoginPortPublicAccess string @@ -215,15 +228,38 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { type Status string const ( - // StatusDisabled ... - StatusDisabled Status = "Disabled" - // StatusEnabled ... - StatusEnabled Status = "Enabled" + // Failure ... + Failure Status = "Failure" + // InvalidQuotaBelowClusterMinimum ... + InvalidQuotaBelowClusterMinimum Status = "InvalidQuotaBelowClusterMinimum" + // InvalidQuotaExceedsSubscriptionLimit ... + InvalidQuotaExceedsSubscriptionLimit Status = "InvalidQuotaExceedsSubscriptionLimit" + // InvalidVMFamilyName ... + InvalidVMFamilyName Status = "InvalidVMFamilyName" + // Success ... + Success Status = "Success" + // Undefined ... + Undefined Status = "Undefined" ) // PossibleStatusValues returns an array of possible values for the Status const type. func PossibleStatusValues() []Status { - return []Status{StatusDisabled, StatusEnabled} + return []Status{Failure, InvalidQuotaBelowClusterMinimum, InvalidQuotaExceedsSubscriptionLimit, InvalidVMFamilyName, Success, Undefined} +} + +// Status1 enumerates the values for status 1. +type Status1 string + +const ( + // Status1Disabled ... + Status1Disabled Status1 = "Disabled" + // Status1Enabled ... + Status1Enabled Status1 = "Enabled" +) + +// PossibleStatus1Values returns an array of possible values for the Status1 const type. +func PossibleStatus1Values() []Status1 { + return []Status1{Status1Disabled, Status1Enabled} } // UnderlyingResourceAction enumerates the values for underlying resource action. @@ -245,13 +281,13 @@ func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { type UsageUnit string const ( - // Count ... - Count UsageUnit = "Count" + // UsageUnitCount ... + UsageUnitCount UsageUnit = "Count" ) // PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. func PossibleUsageUnitValues() []UsageUnit { - return []UsageUnit{Count} + return []UsageUnit{UsageUnitCount} } // VMPriority enumerates the values for vm priority. @@ -1735,6 +1771,152 @@ type ListWorkspaceKeysResult struct { ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` } +// ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response. +type ListWorkspaceQuotas struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Workspace Quotas by VM Family + Value *[]ResourceQuota `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListWorkspaceQuotasIterator provides access to a complete listing of ResourceQuota values. +type ListWorkspaceQuotasIterator struct { + i int + page ListWorkspaceQuotasPage +} + +// NextWithContext 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 *ListWorkspaceQuotasIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListWorkspaceQuotasIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListWorkspaceQuotasIterator) 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 ListWorkspaceQuotasIterator) Response() ListWorkspaceQuotas { + 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 ListWorkspaceQuotasIterator) Value() ResourceQuota { + if !iter.page.NotDone() { + return ResourceQuota{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListWorkspaceQuotasIterator type. +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return ListWorkspaceQuotasIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lwq ListWorkspaceQuotas) IsEmpty() bool { + return lwq.Value == nil || len(*lwq.Value) == 0 +} + +// listWorkspaceQuotasPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lwq ListWorkspaceQuotas) listWorkspaceQuotasPreparer(ctx context.Context) (*http.Request, error) { + if lwq.NextLink == nil || len(to.String(lwq.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lwq.NextLink))) +} + +// ListWorkspaceQuotasPage contains a page of ResourceQuota values. +type ListWorkspaceQuotasPage struct { + fn func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error) + lwq ListWorkspaceQuotas +} + +// NextWithContext 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 *ListWorkspaceQuotasPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lwq) + if err != nil { + return err + } + page.lwq = next + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ListWorkspaceQuotasPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListWorkspaceQuotasPage) NotDone() bool { + return !page.lwq.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListWorkspaceQuotasPage) Response() ListWorkspaceQuotas { + return page.lwq +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListWorkspaceQuotasPage) Values() []ResourceQuota { + if page.lwq.IsEmpty() { + return nil + } + return *page.lwq.Value +} + +// Creates a new instance of the ListWorkspaceQuotasPage type. +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return ListWorkspaceQuotasPage{fn: getNextPage} +} + // MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type MachineLearningComputeCreateOrUpdateFuture struct { @@ -2014,6 +2196,24 @@ type Password struct { Value *string `json:"value,omitempty"` } +// QuotaBaseProperties the properties for Quota update or retrieval. +type QuotaBaseProperties struct { + // ID - Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - Specifies the resource type. + Type *string `json:"type,omitempty"` + // Limit - The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` +} + +// QuotaUpdateParameters quota update parameters. +type QuotaUpdateParameters struct { + // Value - The list for update quota. + Value *[]QuotaBaseProperties `json:"value,omitempty"` +} + // RegistryListCredentialsResult ... type RegistryListCredentialsResult struct { // Location - READ-ONLY @@ -2057,6 +2257,28 @@ type ResourceID struct { ID *string `json:"id,omitempty"` } +// ResourceName the Resource Name. +type ResourceName struct { + // Value - READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// ResourceQuota the quota assigned to a resource. +type ResourceQuota struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; Name of the resource. + Name *ResourceName `json:"name,omitempty"` + // Limit - READ-ONLY; The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` +} + // ScaleSettings scale settings for AML Compute type ScaleSettings struct { // MaxNodeCount - Max number of nodes to use @@ -2077,8 +2299,8 @@ type ServicePrincipalCredentials struct { // SslConfiguration the ssl configuration for scoring type SslConfiguration struct { - // Status - Enable or disable ssl for scoring. Possible values include: 'StatusDisabled', 'StatusEnabled' - Status Status `json:"status,omitempty"` + // Status - Enable or disable ssl for scoring. Possible values include: 'Status1Disabled', 'Status1Enabled' + Status Status1 `json:"status,omitempty"` // Cert - Cert data Cert *string `json:"cert,omitempty"` // Key - Key data @@ -2097,13 +2319,36 @@ type SystemService struct { Version *string `json:"version,omitempty"` } +// UpdateWorkspaceQuotas the properties for update Quota response. +type UpdateWorkspaceQuotas struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Limit - The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` + // Status - Status of update workspace quota. Possible values include: 'Undefined', 'Success', 'Failure', 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName' + Status Status `json:"status,omitempty"` +} + +// UpdateWorkspaceQuotasResult the result of update workspace quota. +type UpdateWorkspaceQuotasResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of workspace quota update result. + Value *[]UpdateWorkspaceQuotas `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result. + NextLink *string `json:"nextLink,omitempty"` +} + // Usage describes AML Resource Usage. type Usage struct { // ID - READ-ONLY; Specifies the resource ID. ID *string `json:"id,omitempty"` // Type - READ-ONLY; Specifies the resource type. Type *string `json:"type,omitempty"` - // Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'Count' + // Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'UsageUnitCount' Unit UsageUnit `json:"unit,omitempty"` // CurrentValue - READ-ONLY; The current usage of the resource. CurrentValue *int64 `json:"currentValue,omitempty"` diff --git a/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/quotas.go b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/quotas.go new file mode 100644 index 000000000000..72621c6e6c11 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/quotas.go @@ -0,0 +1,245 @@ +package machinelearningservices + +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// QuotasClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type QuotasClient struct { + BaseClient +} + +// NewQuotasClient creates an instance of the QuotasClient client. +func NewQuotasClient(subscriptionID string) QuotasClient { + return NewQuotasClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQuotasClientWithBaseURI creates an instance of the QuotasClient client. +func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return QuotasClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the currently assigned Workspace Quotas based on VMFamily. +// Parameters: +// location - the location for which resource usage is queried. +func (client QuotasClient) List(ctx context.Context, location string) (result ListWorkspaceQuotasPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") + defer func() { + sc := -1 + if result.lwq.Response.Response != nil { + sc = result.lwq.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.QuotasClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lwq.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure sending request") + return + } + + result.lwq, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client QuotasClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client QuotasClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client QuotasClient) ListResponder(resp *http.Response) (result ListWorkspaceQuotas, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client QuotasClient) listNextResults(ctx context.Context, lastResults ListWorkspaceQuotas) (result ListWorkspaceQuotas, err error) { + req, err := lastResults.listWorkspaceQuotasPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client QuotasClient) ListComplete(ctx context.Context, location string) (result ListWorkspaceQuotasIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") + 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.List(ctx, location) + return +} + +// Update update quota for each VM family in workspace. +// Parameters: +// location - the location for update quota is queried. +// parameters - quota update parameters. +func (client QuotasClient) Update(ctx context.Context, location string, parameters QuotaUpdateParameters) (result UpdateWorkspaceQuotasResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.QuotasClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, location, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QuotasClient) UpdatePreparer(ctx context.Context, location string, parameters QuotaUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client QuotasClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client QuotasClient) UpdateResponder(resp *http.Response) (result UpdateWorkspaceQuotasResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}