diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/CHANGELOG.md b/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/CHANGELOG.md deleted file mode 100644 index f1dc2515f62f..000000000000 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -# Change History - -## Additive Changes - -### New Funcs - -1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/_meta.json b/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/_meta.json deleted file mode 100644 index 9e349c3b8cf5..000000000000 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", - "tag": "package-2020-03-15-preview", - "use": "@microsoft.azure/autorest.go@2.1.183", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2020-03-15-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/enums.go b/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/enums.go deleted file mode 100644 index 490c8349fe3f..000000000000 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/enums.go +++ /dev/null @@ -1,72 +0,0 @@ -package storagepool - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// OperationalStatus enumerates the values for operational status. -type OperationalStatus string - -const ( - // Healthy ... - Healthy OperationalStatus = "Healthy" - // Invalid ... - Invalid OperationalStatus = "Invalid" - // Unhealthy ... - Unhealthy OperationalStatus = "Unhealthy" - // Unknown ... - Unknown OperationalStatus = "Unknown" -) - -// PossibleOperationalStatusValues returns an array of possible values for the OperationalStatus const type. -func PossibleOperationalStatusValues() []OperationalStatus { - return []OperationalStatus{Healthy, Invalid, Unhealthy, Unknown} -} - -// ProvisioningStates enumerates the values for provisioning states. -type ProvisioningStates string - -const ( - // ProvisioningStatesCanceled ... - ProvisioningStatesCanceled ProvisioningStates = "Canceled" - // ProvisioningStatesCreating ... - ProvisioningStatesCreating ProvisioningStates = "Creating" - // ProvisioningStatesDeleting ... - ProvisioningStatesDeleting ProvisioningStates = "Deleting" - // ProvisioningStatesFailed ... - ProvisioningStatesFailed ProvisioningStates = "Failed" - // ProvisioningStatesInvalid ... - ProvisioningStatesInvalid ProvisioningStates = "Invalid" - // ProvisioningStatesPending ... - ProvisioningStatesPending ProvisioningStates = "Pending" - // ProvisioningStatesSucceeded ... - ProvisioningStatesSucceeded ProvisioningStates = "Succeeded" - // ProvisioningStatesUpdating ... - ProvisioningStatesUpdating ProvisioningStates = "Updating" -) - -// PossibleProvisioningStatesValues returns an array of possible values for the ProvisioningStates const type. -func PossibleProvisioningStatesValues() []ProvisioningStates { - return []ProvisioningStates{ProvisioningStatesCanceled, ProvisioningStatesCreating, ProvisioningStatesDeleting, ProvisioningStatesFailed, ProvisioningStatesInvalid, ProvisioningStatesPending, ProvisioningStatesSucceeded, ProvisioningStatesUpdating} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Basic ... - Basic SkuTier = "Basic" - // Free ... - Free SkuTier = "Free" - // Premium ... - Premium SkuTier = "Premium" - // Standard ... - Standard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Basic, Free, Premium, Standard} -} diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/models.go b/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/models.go deleted file mode 100644 index ae4ea7014db0..000000000000 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/models.go +++ /dev/null @@ -1,1060 +0,0 @@ -package storagepool - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool" - -// ACL access Control List (ACL) for an iSCSI target lun -type ACL struct { - // InitiatorIqn - iSCSI initiator iqn (iSCSI Qualified Name); example: iqn.2005-03.org.iscsi:client - InitiatorIqn *string `json:"initiatorIqn,omitempty"` - // MappedLuns - Array of lun names mapped to the ACL - MappedLuns *[]string `json:"mappedLuns,omitempty"` - // IscsiTargetCredentials - CHAP credentials for iSCSI target. - *IscsiTargetCredentials `json:"credentials,omitempty"` -} - -// MarshalJSON is the custom marshaler for ACL. -func (a ACL) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.InitiatorIqn != nil { - objectMap["initiatorIqn"] = a.InitiatorIqn - } - if a.MappedLuns != nil { - objectMap["mappedLuns"] = a.MappedLuns - } - if a.IscsiTargetCredentials != nil { - objectMap["credentials"] = a.IscsiTargetCredentials - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ACL struct. -func (a *ACL) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "initiatorIqn": - if v != nil { - var initiatorIqn string - err = json.Unmarshal(*v, &initiatorIqn) - if err != nil { - return err - } - a.InitiatorIqn = &initiatorIqn - } - case "mappedLuns": - if v != nil { - var mappedLuns []string - err = json.Unmarshal(*v, &mappedLuns) - if err != nil { - return err - } - a.MappedLuns = &mappedLuns - } - case "credentials": - if v != nil { - var iscsiTargetCredentials IscsiTargetCredentials - err = json.Unmarshal(*v, &iscsiTargetCredentials) - if err != nil { - return err - } - a.IscsiTargetCredentials = &iscsiTargetCredentials - } - } - } - - return nil -} - -// Attributes attributes of an iSCSI target -type Attributes struct { - // Authentication - Indicates whether or not authentication is enabled on the ACL. - Authentication *bool `json:"authentication,omitempty"` - // ProdModeWriteProtect - Indicates whether or not write protect is enabled on the luns. - ProdModeWriteProtect *bool `json:"prodModeWriteProtect,omitempty"` -} - -// Disk managed disk to attach to the DiskPool. Required. -type Disk struct { - // ID - Unique Azure resource id of the managed disk. Required. - ID *string `json:"id,omitempty"` -} - -// DiskPool request payload for Create or Update Disk Pool requests. -type DiskPool struct { - autorest.Response `json:"-"` - // DiskPoolProperties - RP defined properties for Disk Pool operations. - *DiskPoolProperties `json:"properties,omitempty"` - // Sku - Sku description. - Sku *Sku `json:"sku,omitempty"` - // SystemData - READ-ONLY; Resource metadata required by ARM RPC - SystemData *SystemMetadata `json:"systemData,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskPool. -func (dp DiskPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.DiskPoolProperties != nil { - objectMap["properties"] = dp.DiskPoolProperties - } - if dp.Sku != nil { - objectMap["sku"] = dp.Sku - } - if dp.Tags != nil { - objectMap["tags"] = dp.Tags - } - if dp.Location != nil { - objectMap["location"] = dp.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskPool struct. -func (dp *DiskPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskPoolProperties DiskPoolProperties - err = json.Unmarshal(*v, &diskPoolProperties) - if err != nil { - return err - } - dp.DiskPoolProperties = &diskPoolProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - dp.Sku = &sku - } - case "systemData": - if v != nil { - var systemData SystemMetadata - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - dp.SystemData = &systemData - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dp.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dp.Type = &typeVar - } - } - } - - return nil -} - -// DiskPoolListResult list of Disk Pools -type DiskPoolListResult struct { - autorest.Response `json:"-"` - // Value - An array of Disk Pool objects. - Value *[]DiskPool `json:"value,omitempty"` - // NextLink - READ-ONLY; URI to fetch the next section of the paginated response. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskPoolListResult. -func (dplr DiskPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dplr.Value != nil { - objectMap["value"] = dplr.Value - } - return json.Marshal(objectMap) -} - -// DiskPoolListResultIterator provides access to a complete listing of DiskPool values. -type DiskPoolListResultIterator struct { - i int - page DiskPoolListResultPage -} - -// 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 *DiskPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolListResultIterator.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 *DiskPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskPoolListResultIterator) 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 DiskPoolListResultIterator) Response() DiskPoolListResult { - 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 DiskPoolListResultIterator) Value() DiskPool { - if !iter.page.NotDone() { - return DiskPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskPoolListResultIterator type. -func NewDiskPoolListResultIterator(page DiskPoolListResultPage) DiskPoolListResultIterator { - return DiskPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dplr DiskPoolListResult) IsEmpty() bool { - return dplr.Value == nil || len(*dplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dplr DiskPoolListResult) hasNextLink() bool { - return dplr.NextLink != nil && len(*dplr.NextLink) != 0 -} - -// diskPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dplr DiskPoolListResult) diskPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dplr.NextLink))) -} - -// DiskPoolListResultPage contains a page of DiskPool values. -type DiskPoolListResultPage struct { - fn func(context.Context, DiskPoolListResult) (DiskPoolListResult, error) - dplr DiskPoolListResult -} - -// 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 *DiskPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dplr) - if err != nil { - return err - } - page.dplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *DiskPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskPoolListResultPage) NotDone() bool { - return !page.dplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskPoolListResultPage) Response() DiskPoolListResult { - return page.dplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskPoolListResultPage) Values() []DiskPool { - if page.dplr.IsEmpty() { - return nil - } - return *page.dplr.Value -} - -// Creates a new instance of the DiskPoolListResultPage type. -func NewDiskPoolListResultPage(cur DiskPoolListResult, getNextPage func(context.Context, DiskPoolListResult) (DiskPoolListResult, error)) DiskPoolListResultPage { - return DiskPoolListResultPage{ - fn: getNextPage, - dplr: cur, - } -} - -// DiskPoolProperties properties section of the Disk Pool request payload. -type DiskPoolProperties struct { - // ProvisioningState - READ-ONLY; State of the operation on the resource. Possible values include: 'ProvisioningStatesInvalid', 'ProvisioningStatesSucceeded', 'ProvisioningStatesFailed', 'ProvisioningStatesCanceled', 'ProvisioningStatesPending', 'ProvisioningStatesCreating', 'ProvisioningStatesUpdating', 'ProvisioningStatesDeleting' - ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"` - // AvailabilityZones - Logical zone for DiskPool resource. - AvailabilityZones *[]string `json:"availabilityZones,omitempty"` - // Status - READ-ONLY; Operational status of the Disk pool. Possible values include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy' - Status OperationalStatus `json:"status,omitempty"` - // Disks - List of Azure managed disks to attach to a DiskPool - Disks *[]Disk `json:"disks,omitempty"` - // SubnetID - Azure resource id of the subnet for the DiskPool - SubnetID *string `json:"subnetId,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskPoolProperties. -func (dpp DiskPoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpp.AvailabilityZones != nil { - objectMap["availabilityZones"] = dpp.AvailabilityZones - } - if dpp.Disks != nil { - objectMap["disks"] = dpp.Disks - } - if dpp.SubnetID != nil { - objectMap["subnetId"] = dpp.SubnetID - } - return json.Marshal(objectMap) -} - -// DiskPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DiskPoolsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskPoolsClient) (DiskPool, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskPoolsCreateOrUpdateFuture.Result. -func (future *DiskPoolsCreateOrUpdateFuture) result(client DiskPoolsClient) (dp DiskPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dp.Response.Response, err = future.GetResult(sender); err == nil && dp.Response.Response.StatusCode != http.StatusNoContent { - dp, err = client.CreateOrUpdateResponder(dp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsCreateOrUpdateFuture", "Result", dp.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DiskPoolsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskPoolsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskPoolsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskPoolsDeleteFuture.Result. -func (future *DiskPoolsDeleteFuture) result(client DiskPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// Error the resource management error response. -type Error struct { - // Error - RP error response - Error *ErrorResponse `json:"error,omitempty"` -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. -func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse the resource management error response. -type ErrorResponse struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorResponse `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// IscsiLun lun to expose the ManagedDisk. -type IscsiLun struct { - // Name - Lun name. - Name *string `json:"name,omitempty"` - // ManagedDiskAzureResourceID - Unique Azure resource id of the managed disk. Required. - ManagedDiskAzureResourceID *string `json:"managedDiskAzureResourceId,omitempty"` -} - -// IscsiTarget payload for iSCSI Target Create or Update requests. -type IscsiTarget struct { - autorest.Response `json:"-"` - // IscsiTargetProperties - RP defined properties for iSCSI Target operations. - *IscsiTargetProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IscsiTarget. -func (it IscsiTarget) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if it.IscsiTargetProperties != nil { - objectMap["properties"] = it.IscsiTargetProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IscsiTarget struct. -func (it *IscsiTarget) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var iscsiTargetProperties IscsiTargetProperties - err = json.Unmarshal(*v, &iscsiTargetProperties) - if err != nil { - return err - } - it.IscsiTargetProperties = &iscsiTargetProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - it.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - it.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - it.Type = &typeVar - } - } - } - - return nil -} - -// IscsiTargetCredentials CHAP credentials for an iSCSI target -type IscsiTargetCredentials struct { - // Username - Username for Challenge Handshake Authentication Protocol (CHAP) authentication - Username *string `json:"username,omitempty"` - // Password - Password for Challenge Handshake Authentication Protocol (CHAP) authentication - Password *string `json:"password,omitempty"` -} - -// IscsiTargetList list of iSCSI Targets. -type IscsiTargetList struct { - autorest.Response `json:"-"` - // Value - An array of iSCSI targets within a Disk Pool. - Value *[]IscsiTarget `json:"value,omitempty"` - // NextLink - READ-ONLY; URI to fetch the next section of the paginated response. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for IscsiTargetList. -func (itl IscsiTargetList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itl.Value != nil { - objectMap["value"] = itl.Value - } - return json.Marshal(objectMap) -} - -// IscsiTargetListIterator provides access to a complete listing of IscsiTarget values. -type IscsiTargetListIterator struct { - i int - page IscsiTargetListPage -} - -// 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 *IscsiTargetListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetListIterator.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 *IscsiTargetListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IscsiTargetListIterator) 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 IscsiTargetListIterator) Response() IscsiTargetList { - 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 IscsiTargetListIterator) Value() IscsiTarget { - if !iter.page.NotDone() { - return IscsiTarget{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IscsiTargetListIterator type. -func NewIscsiTargetListIterator(page IscsiTargetListPage) IscsiTargetListIterator { - return IscsiTargetListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (itl IscsiTargetList) IsEmpty() bool { - return itl.Value == nil || len(*itl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (itl IscsiTargetList) hasNextLink() bool { - return itl.NextLink != nil && len(*itl.NextLink) != 0 -} - -// iscsiTargetListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (itl IscsiTargetList) iscsiTargetListPreparer(ctx context.Context) (*http.Request, error) { - if !itl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(itl.NextLink))) -} - -// IscsiTargetListPage contains a page of IscsiTarget values. -type IscsiTargetListPage struct { - fn func(context.Context, IscsiTargetList) (IscsiTargetList, error) - itl IscsiTargetList -} - -// 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 *IscsiTargetListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.itl) - if err != nil { - return err - } - page.itl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *IscsiTargetListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IscsiTargetListPage) NotDone() bool { - return !page.itl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IscsiTargetListPage) Response() IscsiTargetList { - return page.itl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IscsiTargetListPage) Values() []IscsiTarget { - if page.itl.IsEmpty() { - return nil - } - return *page.itl.Value -} - -// Creates a new instance of the IscsiTargetListPage type. -func NewIscsiTargetListPage(cur IscsiTargetList, getNextPage func(context.Context, IscsiTargetList) (IscsiTargetList, error)) IscsiTargetListPage { - return IscsiTargetListPage{ - fn: getNextPage, - itl: cur, - } -} - -// IscsiTargetProperties properties of iSCSI Target request payload. -type IscsiTargetProperties struct { - // ProvisioningState - READ-ONLY; State of the operation on the resource. Possible values include: 'ProvisioningStatesInvalid', 'ProvisioningStatesSucceeded', 'ProvisioningStatesFailed', 'ProvisioningStatesCanceled', 'ProvisioningStatesPending', 'ProvisioningStatesCreating', 'ProvisioningStatesUpdating', 'ProvisioningStatesDeleting' - ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"` - // Status - READ-ONLY; Operational status of the Disk pool. Possible values include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy' - Status OperationalStatus `json:"status,omitempty"` - // Tpgs - list of iSCSI target portal groups - Tpgs *[]TargetPortalGroup `json:"tpgs,omitempty"` - // TargetIqn - iSCSI target iqn (iSCSI Qualified Name); example: iqn.2005-03.org.iscsi:server - TargetIqn *string `json:"targetIqn,omitempty"` -} - -// MarshalJSON is the custom marshaler for IscsiTargetProperties. -func (itp IscsiTargetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itp.Tpgs != nil { - objectMap["tpgs"] = itp.Tpgs - } - if itp.TargetIqn != nil { - objectMap["targetIqn"] = itp.TargetIqn - } - return json.Marshal(objectMap) -} - -// IscsiTargetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type IscsiTargetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IscsiTargetsClient) (IscsiTarget, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IscsiTargetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IscsiTargetsCreateOrUpdateFuture.Result. -func (future *IscsiTargetsCreateOrUpdateFuture) result(client IscsiTargetsClient) (it IscsiTarget, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - it.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("storagepool.IscsiTargetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if it.Response.Response, err = future.GetResult(sender); err == nil && it.Response.Response.StatusCode != http.StatusNoContent { - it, err = client.CreateOrUpdateResponder(it.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsCreateOrUpdateFuture", "Result", it.Response.Response, "Failure responding to request") - } - } - return -} - -// IscsiTargetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IscsiTargetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IscsiTargetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IscsiTargetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IscsiTargetsDeleteFuture.Result. -func (future *IscsiTargetsDeleteFuture) result(client IscsiTargetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("storagepool.IscsiTargetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// OperationDisplay metadata about an operation. -type OperationDisplay struct { - // Provider - Localized friendly form of the resource provider name. - Provider *string `json:"provider,omitempty"` - // Resource - Localized friendly form of the resource type related to this action/operation. - Resource *string `json:"resource,omitempty"` - // Operation - Localized friendly name for the operation, as it should be shown to the user. - Operation *string `json:"operation,omitempty"` - // Description - Localized friendly description for the operation, as it should be shown to the user. - Description *string `json:"description,omitempty"` -} - -// OperationListResult list of operations supported by the RP. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - An array of operations supported by the StoragePool RP. - Value *[]RPOperation `json:"value,omitempty"` - // NextLink - URI to fetch the next section of the paginated response. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than -// required location and tags -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Resource ARM resource model definition. -type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RPOperation description of a StoragePool RP Operation -type RPOperation struct { - // Name - The name of the operation being performed on this particular object - Name *string `json:"name,omitempty"` - // IsDataAction - Indicates whether the operation applies to data-plane. - IsDataAction *bool `json:"isDataAction,omitempty"` - // ActionType - Indicates the action type. - ActionType *string `json:"actionType,omitempty"` - // Display - Additional metadata about RP operation. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. - Origin *string `json:"origin,omitempty"` -} - -// Sku the resource model definition representing SKU -type Sku struct { - // Name - The name of the SKU. Ex - P3. It is typically a letter+number code - Name *string `json:"name,omitempty"` - // Tier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' - Tier SkuTier `json:"tier,omitempty"` - // Size - The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. - Size *string `json:"size,omitempty"` - // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - // Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. - Capacity *int32 `json:"capacity,omitempty"` -} - -// SystemMetadata resource metadata required by ARM RPC -type SystemMetadata struct { - // CreatedBy - A string identifier for the identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - // CreatedByType - The type of identity that created the resource: user, application, managedIdentity - CreatedByType *string `json:"createdByType,omitempty"` - // CreatedAt - The timestamp of resource creation (UTC) - CreatedAt *string `json:"createdAt,omitempty"` - // LastModifiedBy - A string identifier for the identity that last modified the resource - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // LastModifiedByType - The type of identity that last modified the resource: user, application, managedIdentity - LastModifiedByType *string `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The timestamp of resource last modification (UTC) - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` -} - -// TargetPortalGroup iSCSI target portal group -type TargetPortalGroup struct { - // Luns - Lun list to be exposed through the iSCSI target. Required - Luns *[]IscsiLun `json:"luns,omitempty"` - // Acls - Access Control List (ACL) for an iSCSI target lun - Acls *[]ACL `json:"acls,omitempty"` - // Attributes - Attributes of an iSCSI target - Attributes *Attributes `json:"attributes,omitempty"` - // Endpoints - READ-ONLY; list of public ip addresses to connect to the iSCSI target - Endpoints *[]string `json:"endpoints,omitempty"` - // Tag - READ-ONLY; The tag associated with the iSCSI target portal group - Tag *int32 `json:"tag,omitempty"` - // Port - READ-ONLY; The port at which the iSCSI target is available - Port *int32 `json:"port,omitempty"` -} - -// MarshalJSON is the custom marshaler for TargetPortalGroup. -func (tpg TargetPortalGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tpg.Luns != nil { - objectMap["luns"] = tpg.Luns - } - if tpg.Acls != nil { - objectMap["acls"] = tpg.Acls - } - if tpg.Attributes != nil { - objectMap["attributes"] = tpg.Attributes - } - return json.Marshal(objectMap) -} - -// TrackedResource the resource model definition for a ARM tracked top level resource -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} diff --git a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/CHANGELOG.md b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/CHANGELOG.md +++ b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/_meta.json b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/_meta.json index 70e3e4df1a36..ec4dd6e41ec7 100644 --- a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/_meta.json +++ b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/_meta.json @@ -1,10 +1,10 @@ { - "commit": "394395ed0bdc1c5c05cb37a031379ca03bfebbb5", + "commit": "2b451435758d4c1b45e014b15c756c2b75132875", "readme": "/_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", "tag": "package-2021-04-01-preview", - "use": "@microsoft.azure/autorest.go@2.1.183", + "use": "@microsoft.azure/autorest.go@2.1.187", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2021-04-01-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-04-01-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } diff --git a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/diskpools.go b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/diskpools.go index 701ff8feed22..9166c0aa9341 100644 --- a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/diskpools.go +++ b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/diskpools.go @@ -71,7 +71,7 @@ func (client DiskPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -108,6 +108,7 @@ func (client DiskPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DiskPoolsClient) CreateOrUpdateSender(req *http.Request) (future DiskPoolsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -165,7 +166,7 @@ func (client DiskPoolsClient) Deallocate(ctx context.Context, resourceGroupName result, err = client.DeallocateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Deallocate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Deallocate", result.Response(), "Failure sending request") return } @@ -197,6 +198,7 @@ func (client DiskPoolsClient) DeallocatePreparer(ctx context.Context, resourceGr // http.Response Body if it receives an error. func (client DiskPoolsClient) DeallocateSender(req *http.Request) (future DiskPoolsDeallocateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -252,7 +254,7 @@ func (client DiskPoolsClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Delete", result.Response(), "Failure sending request") return } @@ -284,6 +286,7 @@ func (client DiskPoolsClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DiskPoolsClient) DeleteSender(req *http.Request) (future DiskPoolsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -798,7 +801,7 @@ func (client DiskPoolsClient) Start(ctx context.Context, resourceGroupName strin result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Start", result.Response(), "Failure sending request") return } @@ -830,6 +833,7 @@ func (client DiskPoolsClient) StartPreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client DiskPoolsClient) StartSender(req *http.Request) (future DiskPoolsStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -886,7 +890,7 @@ func (client DiskPoolsClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", result.Response(), "Failure sending request") return } @@ -920,6 +924,7 @@ func (client DiskPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DiskPoolsClient) UpdateSender(req *http.Request) (future DiskPoolsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/iscsitargets.go b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/iscsitargets.go index 13498f177fc5..c394f26623e1 100644 --- a/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/iscsitargets.go +++ b/services/preview/storagepool/mgmt/2021-04-01-preview/storagepool/iscsitargets.go @@ -68,7 +68,7 @@ func (client IscsiTargetsClient) CreateOrUpdate(ctx context.Context, resourceGro result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client IscsiTargetsClient) CreateOrUpdatePreparer(ctx context.Context, res // http.Response Body if it receives an error. func (client IscsiTargetsClient) CreateOrUpdateSender(req *http.Request) (future IscsiTargetsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -160,7 +161,7 @@ func (client IscsiTargetsClient) Delete(ctx context.Context, resourceGroupName s result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Delete", result.Response(), "Failure sending request") return } @@ -193,6 +194,7 @@ func (client IscsiTargetsClient) DeletePreparer(ctx context.Context, resourceGro // http.Response Body if it receives an error. func (client IscsiTargetsClient) DeleteSender(req *http.Request) (future IscsiTargetsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -466,7 +468,7 @@ func (client IscsiTargetsClient) Update(ctx context.Context, resourceGroupName s result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Update", result.Response(), "Failure sending request") return } @@ -501,6 +503,7 @@ func (client IscsiTargetsClient) UpdatePreparer(ctx context.Context, resourceGro // http.Response Body if it receives an error. func (client IscsiTargetsClient) UpdateSender(req *http.Request) (future IscsiTargetsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/storagepool/mgmt/2021-08-01/storagepool/CHANGELOG.md b/services/storagepool/mgmt/2021-08-01/storagepool/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/storagepool/mgmt/2021-08-01/storagepool/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/storagepool/mgmt/2021-08-01/storagepool/_meta.json b/services/storagepool/mgmt/2021-08-01/storagepool/_meta.json new file mode 100644 index 000000000000..bdb429fa9b25 --- /dev/null +++ b/services/storagepool/mgmt/2021-08-01/storagepool/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "2b451435758d4c1b45e014b15c756c2b75132875", + "readme": "/_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", + "tag": "package-2021-08-01", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-08-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/storagepool/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/client.go b/services/storagepool/mgmt/2021-08-01/storagepool/client.go similarity index 97% rename from services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/client.go rename to services/storagepool/mgmt/2021-08-01/storagepool/client.go index 1d1a0fbeecec..72832e2ca49b 100644 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/client.go +++ b/services/storagepool/mgmt/2021-08-01/storagepool/client.go @@ -1,4 +1,4 @@ -// Package storagepool implements the Azure ARM Storagepool service API version 2020-03-15-preview. +// Package storagepool implements the Azure ARM Storagepool service API version 2021-08-01. // // package storagepool diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/diskpools.go b/services/storagepool/mgmt/2021-08-01/storagepool/diskpools.go similarity index 54% rename from services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/diskpools.go rename to services/storagepool/mgmt/2021-08-01/storagepool/diskpools.go index f33099ceae1b..e92113897e67 100644 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/diskpools.go +++ b/services/storagepool/mgmt/2021-08-01/storagepool/diskpools.go @@ -31,12 +31,13 @@ func NewDiskPoolsClientWithBaseURI(baseURI string, subscriptionID string) DiskPo return DiskPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create a new Disk Pool. +// CreateOrUpdate create or Update Disk pool. This create or update operation can take 15 minutes to complete. This is +// expected service behavior. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. -// diskPoolPayload - request payload for Disk Pool operations. -func (client DiskPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolPayload DiskPool) (result DiskPoolsCreateOrUpdateFuture, err error) { +// diskPoolCreatePayload - request payload for Disk Pool create operation +func (client DiskPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolCreatePayload DiskPoolCreate) (result DiskPoolsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.CreateOrUpdate") defer func() { @@ -54,21 +55,16 @@ func (client DiskPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: diskPoolPayload, - Constraints: []validation.Constraint{{Target: "diskPoolPayload.DiskPoolProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskPoolPayload.DiskPoolProperties.AvailabilityZones", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "diskPoolPayload.DiskPoolProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "diskPoolPayload.Sku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskPoolPayload.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + {TargetValue: diskPoolCreatePayload, + Constraints: []validation.Constraint{{Target: "diskPoolCreatePayload.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "diskPoolCreatePayload.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "diskPoolCreatePayload.DiskPoolCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "diskPoolCreatePayload.DiskPoolCreateProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "diskPoolCreatePayload.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.DiskPoolsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskPoolName, diskPoolPayload) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskPoolName, diskPoolCreatePayload) if err != nil { err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,7 +72,7 @@ func (client DiskPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -84,25 +80,27 @@ func (client DiskPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupN } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolPayload DiskPool) (*http.Request, error) { +func (client DiskPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolCreatePayload DiskPoolCreate) (*http.Request, error) { pathParameters := map[string]interface{}{ "diskPoolName": autorest.Encode("path", diskPoolName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - diskPoolPayload.SystemData = nil + diskPoolCreatePayload.ID = nil + diskPoolCreatePayload.Name = nil + diskPoolCreatePayload.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}", pathParameters), - autorest.WithJSON(diskPoolPayload), + autorest.WithJSON(diskPoolCreatePayload), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -111,6 +109,7 @@ func (client DiskPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DiskPoolsClient) CreateOrUpdateSender(req *http.Request) (future DiskPoolsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -127,14 +126,104 @@ func (client DiskPoolsClient) CreateOrUpdateSender(req *http.Request) (future Di func (client DiskPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskPool, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete delete a Disk Pool. +// Deallocate shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources +// that this Disk Pool uses. This operation can take 10 minutes to complete. This is expected service behavior. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// diskPoolName - the name of the Disk Pool. +func (client DiskPoolsClient) Deallocate(ctx context.Context, resourceGroupName string, diskPoolName string) (result DiskPoolsDeallocateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.Deallocate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.DiskPoolsClient", "Deallocate", err.Error()) + } + + req, err := client.DeallocatePreparer(ctx, resourceGroupName, diskPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Deallocate", nil, "Failure preparing request") + return + } + + result, err = client.DeallocateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Deallocate", result.Response(), "Failure sending request") + return + } + + return +} + +// DeallocatePreparer prepares the Deallocate request. +func (client DiskPoolsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskPoolName": autorest.Encode("path", diskPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/deallocate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeallocateSender sends the Deallocate request. The method will close the +// http.Response Body if it receives an error. +func (client DiskPoolsClient) DeallocateSender(req *http.Request) (future DiskPoolsDeallocateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeallocateResponder handles the response to the Deallocate request. The method always +// closes the http.Response Body. +func (client DiskPoolsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete delete a Disk pool; attached disks are not affected. This delete operation can take 10 minutes to complete. +// This is expected service behavior. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. @@ -155,11 +244,7 @@ func (client DiskPoolsClient) Delete(ctx context.Context, resourceGroupName stri {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.DiskPoolsClient", "Delete", err.Error()) } @@ -171,7 +256,7 @@ func (client DiskPoolsClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Delete", result.Response(), "Failure sending request") return } @@ -186,7 +271,7 @@ func (client DiskPoolsClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -203,6 +288,7 @@ func (client DiskPoolsClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DiskPoolsClient) DeleteSender(req *http.Request) (future DiskPoolsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -225,7 +311,7 @@ func (client DiskPoolsClient) DeleteResponder(resp *http.Response) (result autor return } -// Get get a Disk Pool. +// Get get a Disk pool. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. @@ -246,11 +332,7 @@ func (client DiskPoolsClient) Get(ctx context.Context, resourceGroupName string, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.DiskPoolsClient", "Get", err.Error()) } @@ -284,7 +366,7 @@ func (client DiskPoolsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +397,7 @@ func (client DiskPoolsClient) GetResponder(resp *http.Response) (result DiskPool return } -// ListByResourceGroup gets a list of DiskPools. +// ListByResourceGroup gets a list of DiskPools in a resource group. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. func (client DiskPoolsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskPoolListResultPage, err error) { @@ -373,7 +455,7 @@ func (client DiskPoolsClient) ListByResourceGroupPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -492,7 +574,7 @@ func (client DiskPoolsClient) ListBySubscriptionPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,18 +642,17 @@ func (client DiskPoolsClient) ListBySubscriptionComplete(ctx context.Context) (r return } -// Update update a Storage Pool. +// ListOutboundNetworkDependenciesEndpoints gets the network endpoints of all outbound dependencies of a Disk Pool // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. -// diskPoolPayload - request payload for Disk Pool operations. -func (client DiskPoolsClient) Update(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolPayload DiskPool) (result DiskPool, err error) { +func (client DiskPoolsClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, diskPoolName string) (result OutboundEnvironmentEndpointListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.ListOutboundNetworkDependenciesEndpoints") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.oeel.Response.Response != nil { + sc = result.oeel.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -582,30 +663,237 @@ func (client DiskPoolsClient) Update(ctx context.Context, resourceGroupName stri {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("storagepool.DiskPoolsClient", "Update", err.Error()) + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.DiskPoolsClient", "ListOutboundNetworkDependenciesEndpoints", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskPoolName, diskPoolPayload) + result.fn = client.listOutboundNetworkDependenciesEndpointsNextResults + req, err := client.ListOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, diskPoolName) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") return } - resp, err := client.UpdateSender(req) + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.oeel.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result.oeel, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + if result.oeel.hasNextLink() && result.oeel.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOutboundNetworkDependenciesEndpointsPreparer prepares the ListOutboundNetworkDependenciesEndpoints request. +func (client DiskPoolsClient) ListOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, diskPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskPoolName": autorest.Encode("path", diskPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOutboundNetworkDependenciesEndpointsSender sends the ListOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client DiskPoolsClient) ListOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOutboundNetworkDependenciesEndpointsResponder handles the response to the ListOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client DiskPoolsClient) ListOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundEnvironmentEndpointList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client DiskPoolsClient) listOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundEnvironmentEndpointList) (result OutboundEnvironmentEndpointList, err error) { + req, err := lastResults.outboundEnvironmentEndpointListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "listOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", resp, "Failure sending request") + return result, autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskPoolsClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, diskPoolName string) (result OutboundEnvironmentEndpointListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.ListOutboundNetworkDependenciesEndpoints") + 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.ListOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, diskPoolName) + return +} + +// Start the operation to start a Disk Pool. This start operation can take 10 minutes to complete. This is expected +// service behavior. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// diskPoolName - the name of the Disk Pool. +func (client DiskPoolsClient) Start(ctx context.Context, resourceGroupName string, diskPoolName string) (result DiskPoolsStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.DiskPoolsClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, diskPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client DiskPoolsClient) StartPreparer(ctx context.Context, resourceGroupName string, diskPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskPoolName": autorest.Encode("path", diskPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client DiskPoolsClient) StartSender(req *http.Request) (future DiskPoolsStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client DiskPoolsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update a Disk pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// diskPoolName - the name of the Disk Pool. +// diskPoolUpdatePayload - request payload for Disk Pool update operation. +func (client DiskPoolsClient) Update(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolUpdatePayload DiskPoolUpdate) (result DiskPoolsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.DiskPoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, diskPoolName, diskPoolUpdatePayload) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", nil, "Failure preparing request") return } - result, err = client.UpdateResponder(resp) + result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Update", result.Response(), "Failure sending request") return } @@ -613,33 +901,42 @@ func (client DiskPoolsClient) Update(ctx context.Context, resourceGroupName stri } // UpdatePreparer prepares the Update request. -func (client DiskPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolPayload DiskPool) (*http.Request, error) { +func (client DiskPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolUpdatePayload DiskPoolUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ "diskPoolName": autorest.Encode("path", diskPoolName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - diskPoolPayload.SystemData = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}", pathParameters), - autorest.WithJSON(diskPoolPayload), + autorest.WithJSON(diskPoolUpdatePayload), 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 DiskPoolsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client DiskPoolsClient) UpdateSender(req *http.Request) (future DiskPoolsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // UpdateResponder handles the response to the Update request. The method always @@ -647,9 +944,98 @@ func (client DiskPoolsClient) UpdateSender(req *http.Request) (*http.Response, e func (client DiskPoolsClient) UpdateResponder(resp *http.Response) (result DiskPool, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } + +// Upgrade upgrade replaces the underlying virtual machine hosts one at a time. This operation can take 10-15 minutes +// to complete. This is expected service behavior. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// diskPoolName - the name of the Disk Pool. +func (client DiskPoolsClient) Upgrade(ctx context.Context, resourceGroupName string, diskPoolName string) (result DiskPoolsUpgradeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolsClient.Upgrade") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.DiskPoolsClient", "Upgrade", err.Error()) + } + + req, err := client.UpgradePreparer(ctx, resourceGroupName, diskPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Upgrade", nil, "Failure preparing request") + return + } + + result, err = client.UpgradeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsClient", "Upgrade", result.Response(), "Failure sending request") + return + } + + return +} + +// UpgradePreparer prepares the Upgrade request. +func (client DiskPoolsClient) UpgradePreparer(ctx context.Context, resourceGroupName string, diskPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskPoolName": autorest.Encode("path", diskPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/upgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpgradeSender sends the Upgrade request. The method will close the +// http.Response Body if it receives an error. +func (client DiskPoolsClient) UpgradeSender(req *http.Request) (future DiskPoolsUpgradeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpgradeResponder handles the response to the Upgrade request. The method always +// closes the http.Response Body. +func (client DiskPoolsClient) UpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/storagepool/mgmt/2021-08-01/storagepool/diskpoolzones.go b/services/storagepool/mgmt/2021-08-01/storagepool/diskpoolzones.go new file mode 100644 index 000000000000..eb0d6d0c85cb --- /dev/null +++ b/services/storagepool/mgmt/2021-08-01/storagepool/diskpoolzones.go @@ -0,0 +1,154 @@ +package storagepool + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" +) + +// DiskPoolZonesClient is the client for the DiskPoolZones methods of the Storagepool service. +type DiskPoolZonesClient struct { + BaseClient +} + +// NewDiskPoolZonesClient creates an instance of the DiskPoolZonesClient client. +func NewDiskPoolZonesClient(subscriptionID string) DiskPoolZonesClient { + return NewDiskPoolZonesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiskPoolZonesClientWithBaseURI creates an instance of the DiskPoolZonesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDiskPoolZonesClientWithBaseURI(baseURI string, subscriptionID string) DiskPoolZonesClient { + return DiskPoolZonesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists available Disk Pool Skus in an Azure location. +// Parameters: +// location - the location of the resource. +func (client DiskPoolZonesClient) List(ctx context.Context, location string) (result DiskPoolZoneListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolZonesClient.List") + defer func() { + sc := -1 + if result.dpzlr.Response.Response != nil { + sc = result.dpzlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.DiskPoolZonesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolZonesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dpzlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolZonesClient", "List", resp, "Failure sending request") + return + } + + result.dpzlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolZonesClient", "List", resp, "Failure responding to request") + return + } + if result.dpzlr.hasNextLink() && result.dpzlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DiskPoolZonesClient) 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 = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/locations/{location}/diskPoolZones", 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 DiskPoolZonesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DiskPoolZonesClient) ListResponder(resp *http.Response) (result DiskPoolZoneListResult, err error) { + err = autorest.Respond( + resp, + 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 DiskPoolZonesClient) listNextResults(ctx context.Context, lastResults DiskPoolZoneListResult) (result DiskPoolZoneListResult, err error) { + req, err := lastResults.diskPoolZoneListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagepool.DiskPoolZonesClient", "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, "storagepool.DiskPoolZonesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolZonesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskPoolZonesClient) ListComplete(ctx context.Context, location string) (result DiskPoolZoneListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolZonesClient.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 +} diff --git a/services/storagepool/mgmt/2021-08-01/storagepool/enums.go b/services/storagepool/mgmt/2021-08-01/storagepool/enums.go new file mode 100644 index 000000000000..1de4658df355 --- /dev/null +++ b/services/storagepool/mgmt/2021-08-01/storagepool/enums.go @@ -0,0 +1,142 @@ +package storagepool + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + +// DiskPoolTier enumerates the values for disk pool tier. +type DiskPoolTier string + +const ( + // Basic ... + Basic DiskPoolTier = "Basic" + // Premium ... + Premium DiskPoolTier = "Premium" + // Standard ... + Standard DiskPoolTier = "Standard" +) + +// PossibleDiskPoolTierValues returns an array of possible values for the DiskPoolTier const type. +func PossibleDiskPoolTierValues() []DiskPoolTier { + return []DiskPoolTier{Basic, Premium, Standard} +} + +// IscsiTargetACLMode enumerates the values for iscsi target acl mode. +type IscsiTargetACLMode string + +const ( + // Dynamic ... + Dynamic IscsiTargetACLMode = "Dynamic" + // Static ... + Static IscsiTargetACLMode = "Static" +) + +// PossibleIscsiTargetACLModeValues returns an array of possible values for the IscsiTargetACLMode const type. +func PossibleIscsiTargetACLModeValues() []IscsiTargetACLMode { + return []IscsiTargetACLMode{Dynamic, Static} +} + +// OperationalStatus enumerates the values for operational status. +type OperationalStatus string + +const ( + // Healthy ... + Healthy OperationalStatus = "Healthy" + // Invalid ... + Invalid OperationalStatus = "Invalid" + // Running ... + Running OperationalStatus = "Running" + // Stopped ... + Stopped OperationalStatus = "Stopped" + // Stoppeddeallocated ... + Stoppeddeallocated OperationalStatus = "Stopped (deallocated)" + // Unhealthy ... + Unhealthy OperationalStatus = "Unhealthy" + // Unknown ... + Unknown OperationalStatus = "Unknown" + // Updating ... + Updating OperationalStatus = "Updating" +) + +// PossibleOperationalStatusValues returns an array of possible values for the OperationalStatus const type. +func PossibleOperationalStatusValues() []OperationalStatus { + return []OperationalStatus{Healthy, Invalid, Running, Stopped, Stoppeddeallocated, Unhealthy, Unknown, Updating} +} + +// ProvisioningStates enumerates the values for provisioning states. +type ProvisioningStates string + +const ( + // ProvisioningStatesCanceled ... + ProvisioningStatesCanceled ProvisioningStates = "Canceled" + // ProvisioningStatesCreating ... + ProvisioningStatesCreating ProvisioningStates = "Creating" + // ProvisioningStatesDeleting ... + ProvisioningStatesDeleting ProvisioningStates = "Deleting" + // ProvisioningStatesFailed ... + ProvisioningStatesFailed ProvisioningStates = "Failed" + // ProvisioningStatesInvalid ... + ProvisioningStatesInvalid ProvisioningStates = "Invalid" + // ProvisioningStatesPending ... + ProvisioningStatesPending ProvisioningStates = "Pending" + // ProvisioningStatesSucceeded ... + ProvisioningStatesSucceeded ProvisioningStates = "Succeeded" + // ProvisioningStatesUpdating ... + ProvisioningStatesUpdating ProvisioningStates = "Updating" +) + +// PossibleProvisioningStatesValues returns an array of possible values for the ProvisioningStates const type. +func PossibleProvisioningStatesValues() []ProvisioningStates { + return []ProvisioningStates{ProvisioningStatesCanceled, ProvisioningStatesCreating, ProvisioningStatesDeleting, ProvisioningStatesFailed, ProvisioningStatesInvalid, ProvisioningStatesPending, ProvisioningStatesSucceeded, ProvisioningStatesUpdating} +} + +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} +} + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // Location ... + Location ResourceSkuRestrictionsType = "Location" + // Zone ... + Zone ResourceSkuRestrictionsType = "Zone" +) + +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{Location, Zone} +} diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/iscsitargets.go b/services/storagepool/mgmt/2021-08-01/storagepool/iscsitargets.go similarity index 75% rename from services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/iscsitargets.go rename to services/storagepool/mgmt/2021-08-01/storagepool/iscsitargets.go index ea188b8cf03c..cbd901a906d5 100644 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/iscsitargets.go +++ b/services/storagepool/mgmt/2021-08-01/storagepool/iscsitargets.go @@ -31,13 +31,13 @@ func NewIscsiTargetsClientWithBaseURI(baseURI string, subscriptionID string) Isc return IscsiTargetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or Update an iSCSI target. +// CreateOrUpdate create or Update an iSCSI Target. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. -// iscsiTargetName - the name of the iSCSI target. -// iscsiTargetPayload - request payload for iSCSI target operations. -func (client IscsiTargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetPayload IscsiTarget) (result IscsiTargetsCreateOrUpdateFuture, err error) { +// iscsiTargetName - the name of the iSCSI Target. +// iscsiTargetCreatePayload - request payload for iSCSI Target create operation. +func (client IscsiTargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetCreatePayload IscsiTargetCreate) (result IscsiTargetsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetsClient.CreateOrUpdate") defer func() { @@ -55,19 +55,12 @@ func (client IscsiTargetsClient) CreateOrUpdate(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: iscsiTargetPayload, - Constraints: []validation.Constraint{{Target: "iscsiTargetPayload.IscsiTargetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iscsiTargetPayload.IscsiTargetProperties.Tpgs", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "iscsiTargetPayload.IscsiTargetProperties.TargetIqn", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { + {TargetValue: iscsiTargetCreatePayload, + Constraints: []validation.Constraint{{Target: "iscsiTargetCreatePayload.IscsiTargetCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.IscsiTargetsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetPayload) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload) if err != nil { err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -75,7 +68,7 @@ func (client IscsiTargetsClient) CreateOrUpdate(ctx context.Context, resourceGro result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -83,7 +76,7 @@ func (client IscsiTargetsClient) CreateOrUpdate(ctx context.Context, resourceGro } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IscsiTargetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetPayload IscsiTarget) (*http.Request, error) { +func (client IscsiTargetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetCreatePayload IscsiTargetCreate) (*http.Request, error) { pathParameters := map[string]interface{}{ "diskPoolName": autorest.Encode("path", diskPoolName), "iscsiTargetName": autorest.Encode("path", iscsiTargetName), @@ -91,7 +84,7 @@ func (client IscsiTargetsClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -101,7 +94,7 @@ func (client IscsiTargetsClient) CreateOrUpdatePreparer(ctx context.Context, res autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}", pathParameters), - autorest.WithJSON(iscsiTargetPayload), + autorest.WithJSON(iscsiTargetCreatePayload), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -110,6 +103,7 @@ func (client IscsiTargetsClient) CreateOrUpdatePreparer(ctx context.Context, res // http.Response Body if it receives an error. func (client IscsiTargetsClient) CreateOrUpdateSender(req *http.Request) (future IscsiTargetsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -126,18 +120,18 @@ func (client IscsiTargetsClient) CreateOrUpdateSender(req *http.Request) (future func (client IscsiTargetsClient) CreateOrUpdateResponder(resp *http.Response) (result IscsiTarget, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete deletes an iSCSI Target +// Delete delete an iSCSI Target. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. -// iscsiTargetName - the name of the iSCSI target. +// iscsiTargetName - the name of the iSCSI Target. func (client IscsiTargetsClient) Delete(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string) (result IscsiTargetsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetsClient.Delete") @@ -155,11 +149,7 @@ func (client IscsiTargetsClient) Delete(ctx context.Context, resourceGroupName s {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.IscsiTargetsClient", "Delete", err.Error()) } @@ -171,7 +161,7 @@ func (client IscsiTargetsClient) Delete(ctx context.Context, resourceGroupName s result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Delete", result.Response(), "Failure sending request") return } @@ -187,7 +177,7 @@ func (client IscsiTargetsClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -204,6 +194,7 @@ func (client IscsiTargetsClient) DeletePreparer(ctx context.Context, resourceGro // http.Response Body if it receives an error. func (client IscsiTargetsClient) DeleteSender(req *http.Request) (future IscsiTargetsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -226,11 +217,11 @@ func (client IscsiTargetsClient) DeleteResponder(resp *http.Response) (result au return } -// Get gets an iSCSI Target. +// Get get an iSCSI Target. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. -// iscsiTargetName - the name of the iSCSI target. +// iscsiTargetName - the name of the iSCSI Target. func (client IscsiTargetsClient) Get(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string) (result IscsiTarget, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetsClient.Get") @@ -248,11 +239,7 @@ func (client IscsiTargetsClient) Get(ctx context.Context, resourceGroupName stri {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.IscsiTargetsClient", "Get", err.Error()) } @@ -287,7 +274,7 @@ func (client IscsiTargetsClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +305,7 @@ func (client IscsiTargetsClient) GetResponder(resp *http.Response) (result Iscsi return } -// ListByDiskPool get iSCSI Targets within a Disk Pool +// ListByDiskPool get iSCSI Targets in a Disk pool. // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // diskPoolName - the name of the Disk Pool. @@ -339,11 +326,7 @@ func (client IscsiTargetsClient) ListByDiskPool(ctx context.Context, resourceGro {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}, - {TargetValue: diskPoolName, - Constraints: []validation.Constraint{{Target: "diskPoolName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "diskPoolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diskPoolName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagepool.IscsiTargetsClient", "ListByDiskPool", err.Error()) } @@ -382,7 +365,7 @@ func (client IscsiTargetsClient) ListByDiskPoolPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -449,3 +432,97 @@ func (client IscsiTargetsClient) ListByDiskPoolComplete(ctx context.Context, res result.page, err = client.ListByDiskPool(ctx, resourceGroupName, diskPoolName) return } + +// Update update an iSCSI Target. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// diskPoolName - the name of the Disk Pool. +// iscsiTargetName - the name of the iSCSI Target. +// iscsiTargetUpdatePayload - request payload for iSCSI Target update operation. +func (client IscsiTargetsClient) Update(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetUpdatePayload IscsiTargetUpdate) (result IscsiTargetsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]*[0-9A-Za-z]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.IscsiTargetsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IscsiTargetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetUpdatePayload IscsiTargetUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskPoolName": autorest.Encode("path", diskPoolName), + "iscsiTargetName": autorest.Encode("path", iscsiTargetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}", pathParameters), + autorest.WithJSON(iscsiTargetUpdatePayload), + 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 IscsiTargetsClient) UpdateSender(req *http.Request) (future IscsiTargetsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IscsiTargetsClient) UpdateResponder(resp *http.Response) (result IscsiTarget, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagepool/mgmt/2021-08-01/storagepool/models.go b/services/storagepool/mgmt/2021-08-01/storagepool/models.go new file mode 100644 index 000000000000..80c515c051fe --- /dev/null +++ b/services/storagepool/mgmt/2021-08-01/storagepool/models.go @@ -0,0 +1,2334 @@ +package storagepool + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagepool/mgmt/2021-08-01/storagepool" + +// ACL access Control List (ACL) for an iSCSI Target; defines LUN masking policy +type ACL struct { + // InitiatorIqn - iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client". + InitiatorIqn *string `json:"initiatorIqn,omitempty"` + // MappedLuns - List of LUN names mapped to the ACL. + MappedLuns *[]string `json:"mappedLuns,omitempty"` +} + +// Disk azure Managed Disk to attach to the Disk Pool. +type Disk struct { + // ID - Unique Azure Resource ID of the Managed Disk. + ID *string `json:"id,omitempty"` +} + +// DiskPool response for Disk Pool request. +type DiskPool struct { + autorest.Response `json:"-"` + // Sku - Determines the SKU of the Disk pool + *Sku `json:"sku,omitempty"` + // DiskPoolProperties - Properties of Disk Pool. + *DiskPoolProperties `json:"properties,omitempty"` + // ManagedBy - READ-ONLY; Azure resource id. Indicates if this resource is managed by another Azure resource. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - READ-ONLY; List of Azure resource ids that manage this resource. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + // SystemData - READ-ONLY; Resource metadata required by ARM RPC + SystemData *SystemMetadata `json:"systemData,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives. + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskPool. +func (dp DiskPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.Sku != nil { + objectMap["sku"] = dp.Sku + } + if dp.DiskPoolProperties != nil { + objectMap["properties"] = dp.DiskPoolProperties + } + if dp.Tags != nil { + objectMap["tags"] = dp.Tags + } + if dp.Location != nil { + objectMap["location"] = dp.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskPool struct. +func (dp *DiskPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + dp.Sku = &sku + } + case "properties": + if v != nil { + var diskPoolProperties DiskPoolProperties + err = json.Unmarshal(*v, &diskPoolProperties) + if err != nil { + return err + } + dp.DiskPoolProperties = &diskPoolProperties + } + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + dp.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + dp.ManagedByExtended = &managedByExtended + } + case "systemData": + if v != nil { + var systemData SystemMetadata + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + dp.SystemData = &systemData + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dp.Type = &typeVar + } + } + } + + return nil +} + +// DiskPoolCreate request payload for create or update Disk Pool request. +type DiskPoolCreate struct { + // Sku - Determines the SKU of the Disk Pool + Sku *Sku `json:"sku,omitempty"` + // DiskPoolCreateProperties - Properties for Disk Pool create request. + *DiskPoolCreateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives. + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` + // ManagedBy - Azure resource id. Indicates if this resource is managed by another Azure resource. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - List of Azure resource ids that manage this resource. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskPoolCreate. +func (dpc DiskPoolCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpc.Sku != nil { + objectMap["sku"] = dpc.Sku + } + if dpc.DiskPoolCreateProperties != nil { + objectMap["properties"] = dpc.DiskPoolCreateProperties + } + if dpc.Tags != nil { + objectMap["tags"] = dpc.Tags + } + if dpc.Location != nil { + objectMap["location"] = dpc.Location + } + if dpc.ManagedBy != nil { + objectMap["managedBy"] = dpc.ManagedBy + } + if dpc.ManagedByExtended != nil { + objectMap["managedByExtended"] = dpc.ManagedByExtended + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskPoolCreate struct. +func (dpc *DiskPoolCreate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + dpc.Sku = &sku + } + case "properties": + if v != nil { + var diskPoolCreateProperties DiskPoolCreateProperties + err = json.Unmarshal(*v, &diskPoolCreateProperties) + if err != nil { + return err + } + dpc.DiskPoolCreateProperties = &diskPoolCreateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dpc.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dpc.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dpc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dpc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dpc.Type = &typeVar + } + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + dpc.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + dpc.ManagedByExtended = &managedByExtended + } + } + } + + return nil +} + +// DiskPoolCreateProperties properties for Disk Pool create or update request. +type DiskPoolCreateProperties struct { + // AvailabilityZones - Logical zone for Disk Pool resource; example: ["1"]. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // Disks - List of Azure Managed Disks to attach to a Disk Pool. + Disks *[]Disk `json:"disks,omitempty"` + // SubnetID - Azure Resource ID of a Subnet for the Disk Pool. + SubnetID *string `json:"subnetId,omitempty"` + // AdditionalCapabilities - List of additional capabilities for a Disk Pool. + AdditionalCapabilities *[]string `json:"additionalCapabilities,omitempty"` +} + +// DiskPoolListResult list of Disk Pools +type DiskPoolListResult struct { + autorest.Response `json:"-"` + // Value - An array of Disk pool objects. + Value *[]DiskPool `json:"value,omitempty"` + // NextLink - READ-ONLY; URI to fetch the next section of the paginated response. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskPoolListResult. +func (dplr DiskPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dplr.Value != nil { + objectMap["value"] = dplr.Value + } + return json.Marshal(objectMap) +} + +// DiskPoolListResultIterator provides access to a complete listing of DiskPool values. +type DiskPoolListResultIterator struct { + i int + page DiskPoolListResultPage +} + +// 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 *DiskPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolListResultIterator.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 *DiskPoolListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskPoolListResultIterator) 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 DiskPoolListResultIterator) Response() DiskPoolListResult { + 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 DiskPoolListResultIterator) Value() DiskPool { + if !iter.page.NotDone() { + return DiskPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskPoolListResultIterator type. +func NewDiskPoolListResultIterator(page DiskPoolListResultPage) DiskPoolListResultIterator { + return DiskPoolListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dplr DiskPoolListResult) IsEmpty() bool { + return dplr.Value == nil || len(*dplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dplr DiskPoolListResult) hasNextLink() bool { + return dplr.NextLink != nil && len(*dplr.NextLink) != 0 +} + +// diskPoolListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dplr DiskPoolListResult) diskPoolListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dplr.NextLink))) +} + +// DiskPoolListResultPage contains a page of DiskPool values. +type DiskPoolListResultPage struct { + fn func(context.Context, DiskPoolListResult) (DiskPoolListResult, error) + dplr DiskPoolListResult +} + +// 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 *DiskPoolListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dplr) + if err != nil { + return err + } + page.dplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *DiskPoolListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskPoolListResultPage) NotDone() bool { + return !page.dplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskPoolListResultPage) Response() DiskPoolListResult { + return page.dplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskPoolListResultPage) Values() []DiskPool { + if page.dplr.IsEmpty() { + return nil + } + return *page.dplr.Value +} + +// Creates a new instance of the DiskPoolListResultPage type. +func NewDiskPoolListResultPage(cur DiskPoolListResult, getNextPage func(context.Context, DiskPoolListResult) (DiskPoolListResult, error)) DiskPoolListResultPage { + return DiskPoolListResultPage{ + fn: getNextPage, + dplr: cur, + } +} + +// DiskPoolProperties disk Pool response properties. +type DiskPoolProperties struct { + // ProvisioningState - State of the operation on the resource. Possible values include: 'ProvisioningStatesInvalid', 'ProvisioningStatesSucceeded', 'ProvisioningStatesFailed', 'ProvisioningStatesCanceled', 'ProvisioningStatesPending', 'ProvisioningStatesCreating', 'ProvisioningStatesUpdating', 'ProvisioningStatesDeleting' + ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"` + // AvailabilityZones - Logical zone for Disk Pool resource; example: ["1"]. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // Status - Operational status of the Disk Pool. Possible values include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy', 'Updating', 'Running', 'Stopped', 'Stoppeddeallocated' + Status OperationalStatus `json:"status,omitempty"` + // Disks - List of Azure Managed Disks to attach to a Disk Pool. + Disks *[]Disk `json:"disks,omitempty"` + // SubnetID - Azure Resource ID of a Subnet for the Disk Pool. + SubnetID *string `json:"subnetId,omitempty"` + // AdditionalCapabilities - List of additional capabilities for Disk Pool. + AdditionalCapabilities *[]string `json:"additionalCapabilities,omitempty"` +} + +// DiskPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskPoolsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskPoolsClient) (DiskPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskPoolsCreateOrUpdateFuture.Result. +func (future *DiskPoolsCreateOrUpdateFuture) result(client DiskPoolsClient) (dp DiskPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dp.Response.Response, err = future.GetResult(sender); err == nil && dp.Response.Response.StatusCode != http.StatusNoContent { + dp, err = client.CreateOrUpdateResponder(dp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsCreateOrUpdateFuture", "Result", dp.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskPoolsDeallocateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskPoolsDeallocateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskPoolsDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskPoolsDeallocateFuture.Result. +func (future *DiskPoolsDeallocateFuture) result(client DiskPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsDeallocateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsDeallocateFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskPoolsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskPoolsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskPoolsDeleteFuture.Result. +func (future *DiskPoolsDeleteFuture) result(client DiskPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskPoolsStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskPoolsStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskPoolsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskPoolsStartFuture.Result. +func (future *DiskPoolsStartFuture) result(client DiskPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskPoolsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskPoolsClient) (DiskPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskPoolsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskPoolsUpdateFuture.Result. +func (future *DiskPoolsUpdateFuture) result(client DiskPoolsClient) (dp DiskPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dp.Response.Response, err = future.GetResult(sender); err == nil && dp.Response.Response.StatusCode != http.StatusNoContent { + dp, err = client.UpdateResponder(dp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsUpdateFuture", "Result", dp.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskPoolsUpgradeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskPoolsUpgradeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskPoolsUpgradeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskPoolsUpgradeFuture.Result. +func (future *DiskPoolsUpgradeFuture) result(client DiskPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.DiskPoolsUpgradeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.DiskPoolsUpgradeFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskPoolUpdate request payload for Update Disk Pool request. +type DiskPoolUpdate struct { + // ManagedBy - Azure resource id. Indicates if this resource is managed by another Azure resource. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - List of Azure resource ids that manage this resource. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + // DiskPoolUpdateProperties - Properties for Disk Pool update request. + *DiskPoolUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DiskPoolUpdate. +func (dpu DiskPoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpu.ManagedBy != nil { + objectMap["managedBy"] = dpu.ManagedBy + } + if dpu.ManagedByExtended != nil { + objectMap["managedByExtended"] = dpu.ManagedByExtended + } + if dpu.DiskPoolUpdateProperties != nil { + objectMap["properties"] = dpu.DiskPoolUpdateProperties + } + if dpu.Tags != nil { + objectMap["tags"] = dpu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskPoolUpdate struct. +func (dpu *DiskPoolUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + dpu.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + dpu.ManagedByExtended = &managedByExtended + } + case "properties": + if v != nil { + var diskPoolUpdateProperties DiskPoolUpdateProperties + err = json.Unmarshal(*v, &diskPoolUpdateProperties) + if err != nil { + return err + } + dpu.DiskPoolUpdateProperties = &diskPoolUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dpu.Tags = tags + } + } + } + + return nil +} + +// DiskPoolUpdateProperties properties for Disk Pool update request. +type DiskPoolUpdateProperties struct { + // Disks - List of Azure Managed Disks to attach to a Disk Pool. + Disks *[]Disk `json:"disks,omitempty"` +} + +// DiskPoolZoneInfo disk Pool SKU Details +type DiskPoolZoneInfo struct { + // AvailabilityZones - READ-ONLY; Logical zone for Disk Pool resource; example: ["1"]. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // AdditionalCapabilities - READ-ONLY; List of additional capabilities for Disk Pool. + AdditionalCapabilities *[]string `json:"additionalCapabilities,omitempty"` + // Sku - READ-ONLY; Determines the SKU of VM deployed for Disk Pool + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskPoolZoneInfo. +func (dpzi DiskPoolZoneInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DiskPoolZoneListResult list Disk Pool skus operation response. +type DiskPoolZoneListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Disk Pool Skus. + Value *[]DiskPoolZoneInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; URI to fetch the next section of the paginated response. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskPoolZoneListResult. +func (dpzlr DiskPoolZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DiskPoolZoneListResultIterator provides access to a complete listing of DiskPoolZoneInfo values. +type DiskPoolZoneListResultIterator struct { + i int + page DiskPoolZoneListResultPage +} + +// 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 *DiskPoolZoneListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolZoneListResultIterator.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 *DiskPoolZoneListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskPoolZoneListResultIterator) 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 DiskPoolZoneListResultIterator) Response() DiskPoolZoneListResult { + 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 DiskPoolZoneListResultIterator) Value() DiskPoolZoneInfo { + if !iter.page.NotDone() { + return DiskPoolZoneInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskPoolZoneListResultIterator type. +func NewDiskPoolZoneListResultIterator(page DiskPoolZoneListResultPage) DiskPoolZoneListResultIterator { + return DiskPoolZoneListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dpzlr DiskPoolZoneListResult) IsEmpty() bool { + return dpzlr.Value == nil || len(*dpzlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dpzlr DiskPoolZoneListResult) hasNextLink() bool { + return dpzlr.NextLink != nil && len(*dpzlr.NextLink) != 0 +} + +// diskPoolZoneListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dpzlr DiskPoolZoneListResult) diskPoolZoneListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dpzlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dpzlr.NextLink))) +} + +// DiskPoolZoneListResultPage contains a page of DiskPoolZoneInfo values. +type DiskPoolZoneListResultPage struct { + fn func(context.Context, DiskPoolZoneListResult) (DiskPoolZoneListResult, error) + dpzlr DiskPoolZoneListResult +} + +// 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 *DiskPoolZoneListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskPoolZoneListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dpzlr) + if err != nil { + return err + } + page.dpzlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *DiskPoolZoneListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskPoolZoneListResultPage) NotDone() bool { + return !page.dpzlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskPoolZoneListResultPage) Response() DiskPoolZoneListResult { + return page.dpzlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskPoolZoneListResultPage) Values() []DiskPoolZoneInfo { + if page.dpzlr.IsEmpty() { + return nil + } + return *page.dpzlr.Value +} + +// Creates a new instance of the DiskPoolZoneListResultPage type. +func NewDiskPoolZoneListResultPage(cur DiskPoolZoneListResult, getNextPage func(context.Context, DiskPoolZoneListResult) (DiskPoolZoneListResult, error)) DiskPoolZoneListResultPage { + return DiskPoolZoneListResultPage{ + fn: getNextPage, + dpzlr: cur, + } +} + +// EndpointDependency a domain name that a service is reached at, including details of the current +// connection status. +type EndpointDependency struct { + // DomainName - The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + // EndpointDetails - The IP Addresses and Ports used when connecting to DomainName. + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} + +// EndpointDetail current TCP connectivity information from the App Service Environment to a single +// endpoint. +type EndpointDetail struct { + // IPAddress - An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + // Port - The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` + // Latency - The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + Latency *float64 `json:"latency,omitempty"` + // IsAccessible - Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + IsAccessible *bool `json:"isAccessible,omitempty"` +} + +// Error the resource management error response. +type Error struct { + // Error - RP error response. + Error *ErrorResponse `json:"error,omitempty"` +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse the resource management error response. +type ErrorResponse struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IscsiLun LUN to expose the Azure Managed Disk. +type IscsiLun struct { + // Name - User defined name for iSCSI LUN; example: "lun0" + Name *string `json:"name,omitempty"` + // ManagedDiskAzureResourceID - Azure Resource ID of the Managed Disk. + ManagedDiskAzureResourceID *string `json:"managedDiskAzureResourceId,omitempty"` + // Lun - READ-ONLY; Specifies the Logical Unit Number of the iSCSI LUN. + Lun *int32 `json:"lun,omitempty"` +} + +// MarshalJSON is the custom marshaler for IscsiLun. +func (il IscsiLun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if il.Name != nil { + objectMap["name"] = il.Name + } + if il.ManagedDiskAzureResourceID != nil { + objectMap["managedDiskAzureResourceId"] = il.ManagedDiskAzureResourceID + } + return json.Marshal(objectMap) +} + +// IscsiTarget response for iSCSI Target requests. +type IscsiTarget struct { + autorest.Response `json:"-"` + // IscsiTargetProperties - Properties for iSCSI Target operations. + *IscsiTargetProperties `json:"properties,omitempty"` + // SystemData - Resource metadata required by ARM RPC + SystemData *SystemMetadata `json:"systemData,omitempty"` + // ManagedBy - READ-ONLY; Azure resource id. Indicates if this resource is managed by another Azure resource. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - READ-ONLY; List of Azure resource ids that manage this resource. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IscsiTarget. +func (it IscsiTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if it.IscsiTargetProperties != nil { + objectMap["properties"] = it.IscsiTargetProperties + } + if it.SystemData != nil { + objectMap["systemData"] = it.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IscsiTarget struct. +func (it *IscsiTarget) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iscsiTargetProperties IscsiTargetProperties + err = json.Unmarshal(*v, &iscsiTargetProperties) + if err != nil { + return err + } + it.IscsiTargetProperties = &iscsiTargetProperties + } + case "systemData": + if v != nil { + var systemData SystemMetadata + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + it.SystemData = &systemData + } + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + it.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + it.ManagedByExtended = &managedByExtended + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + it.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + it.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + it.Type = &typeVar + } + } + } + + return nil +} + +// IscsiTargetCreate payload for iSCSI Target create or update requests. +type IscsiTargetCreate struct { + // IscsiTargetCreateProperties - Properties for iSCSI Target create request. + *IscsiTargetCreateProperties `json:"properties,omitempty"` + // ManagedBy - Azure resource id. Indicates if this resource is managed by another Azure resource. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - List of Azure resource ids that manage this resource. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IscsiTargetCreate. +func (itc IscsiTargetCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itc.IscsiTargetCreateProperties != nil { + objectMap["properties"] = itc.IscsiTargetCreateProperties + } + if itc.ManagedBy != nil { + objectMap["managedBy"] = itc.ManagedBy + } + if itc.ManagedByExtended != nil { + objectMap["managedByExtended"] = itc.ManagedByExtended + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IscsiTargetCreate struct. +func (itc *IscsiTargetCreate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iscsiTargetCreateProperties IscsiTargetCreateProperties + err = json.Unmarshal(*v, &iscsiTargetCreateProperties) + if err != nil { + return err + } + itc.IscsiTargetCreateProperties = &iscsiTargetCreateProperties + } + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + itc.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + itc.ManagedByExtended = &managedByExtended + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itc.Type = &typeVar + } + } + } + + return nil +} + +// IscsiTargetCreateProperties properties for iSCSI Target create or update request. +type IscsiTargetCreateProperties struct { + // ACLMode - Mode for Target connectivity. Possible values include: 'Dynamic', 'Static' + ACLMode IscsiTargetACLMode `json:"aclMode,omitempty"` + // TargetIqn - iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + TargetIqn *string `json:"targetIqn,omitempty"` + // StaticAcls - Access Control List (ACL) for an iSCSI Target; defines LUN masking policy + StaticAcls *[]ACL `json:"staticAcls,omitempty"` + // Luns - List of LUNs to be exposed through iSCSI Target. + Luns *[]IscsiLun `json:"luns,omitempty"` +} + +// IscsiTargetList list of iSCSI Targets. +type IscsiTargetList struct { + autorest.Response `json:"-"` + // Value - An array of iSCSI Targets in a Disk Pool. + Value *[]IscsiTarget `json:"value,omitempty"` + // NextLink - READ-ONLY; URI to fetch the next section of the paginated response. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IscsiTargetList. +func (itl IscsiTargetList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itl.Value != nil { + objectMap["value"] = itl.Value + } + return json.Marshal(objectMap) +} + +// IscsiTargetListIterator provides access to a complete listing of IscsiTarget values. +type IscsiTargetListIterator struct { + i int + page IscsiTargetListPage +} + +// 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 *IscsiTargetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetListIterator.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 *IscsiTargetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IscsiTargetListIterator) 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 IscsiTargetListIterator) Response() IscsiTargetList { + 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 IscsiTargetListIterator) Value() IscsiTarget { + if !iter.page.NotDone() { + return IscsiTarget{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IscsiTargetListIterator type. +func NewIscsiTargetListIterator(page IscsiTargetListPage) IscsiTargetListIterator { + return IscsiTargetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (itl IscsiTargetList) IsEmpty() bool { + return itl.Value == nil || len(*itl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (itl IscsiTargetList) hasNextLink() bool { + return itl.NextLink != nil && len(*itl.NextLink) != 0 +} + +// iscsiTargetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (itl IscsiTargetList) iscsiTargetListPreparer(ctx context.Context) (*http.Request, error) { + if !itl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(itl.NextLink))) +} + +// IscsiTargetListPage contains a page of IscsiTarget values. +type IscsiTargetListPage struct { + fn func(context.Context, IscsiTargetList) (IscsiTargetList, error) + itl IscsiTargetList +} + +// 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 *IscsiTargetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IscsiTargetListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.itl) + if err != nil { + return err + } + page.itl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *IscsiTargetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IscsiTargetListPage) NotDone() bool { + return !page.itl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IscsiTargetListPage) Response() IscsiTargetList { + return page.itl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IscsiTargetListPage) Values() []IscsiTarget { + if page.itl.IsEmpty() { + return nil + } + return *page.itl.Value +} + +// Creates a new instance of the IscsiTargetListPage type. +func NewIscsiTargetListPage(cur IscsiTargetList, getNextPage func(context.Context, IscsiTargetList) (IscsiTargetList, error)) IscsiTargetListPage { + return IscsiTargetListPage{ + fn: getNextPage, + itl: cur, + } +} + +// IscsiTargetProperties response properties for iSCSI Target operations. +type IscsiTargetProperties struct { + // ACLMode - Mode for Target connectivity. Possible values include: 'Dynamic', 'Static' + ACLMode IscsiTargetACLMode `json:"aclMode,omitempty"` + // StaticAcls - Access Control List (ACL) for an iSCSI Target; defines LUN masking policy + StaticAcls *[]ACL `json:"staticAcls,omitempty"` + // Luns - List of LUNs to be exposed through iSCSI Target. + Luns *[]IscsiLun `json:"luns,omitempty"` + // TargetIqn - iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + TargetIqn *string `json:"targetIqn,omitempty"` + // ProvisioningState - State of the operation on the resource. Possible values include: 'ProvisioningStatesInvalid', 'ProvisioningStatesSucceeded', 'ProvisioningStatesFailed', 'ProvisioningStatesCanceled', 'ProvisioningStatesPending', 'ProvisioningStatesCreating', 'ProvisioningStatesUpdating', 'ProvisioningStatesDeleting' + ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"` + // Status - Operational status of the iSCSI Target. Possible values include: 'Invalid', 'Unknown', 'Healthy', 'Unhealthy', 'Updating', 'Running', 'Stopped', 'Stoppeddeallocated' + Status OperationalStatus `json:"status,omitempty"` + // Endpoints - List of private IPv4 addresses to connect to the iSCSI Target. + Endpoints *[]string `json:"endpoints,omitempty"` + // Port - The port used by iSCSI Target portal group. + Port *int32 `json:"port,omitempty"` + // Sessions - READ-ONLY; List of identifiers for active sessions on the iSCSI target + Sessions *[]string `json:"sessions,omitempty"` +} + +// MarshalJSON is the custom marshaler for IscsiTargetProperties. +func (itp IscsiTargetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itp.ACLMode != "" { + objectMap["aclMode"] = itp.ACLMode + } + if itp.StaticAcls != nil { + objectMap["staticAcls"] = itp.StaticAcls + } + if itp.Luns != nil { + objectMap["luns"] = itp.Luns + } + if itp.TargetIqn != nil { + objectMap["targetIqn"] = itp.TargetIqn + } + if itp.ProvisioningState != "" { + objectMap["provisioningState"] = itp.ProvisioningState + } + if itp.Status != "" { + objectMap["status"] = itp.Status + } + if itp.Endpoints != nil { + objectMap["endpoints"] = itp.Endpoints + } + if itp.Port != nil { + objectMap["port"] = itp.Port + } + return json.Marshal(objectMap) +} + +// IscsiTargetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IscsiTargetsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IscsiTargetsClient) (IscsiTarget, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IscsiTargetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IscsiTargetsCreateOrUpdateFuture.Result. +func (future *IscsiTargetsCreateOrUpdateFuture) result(client IscsiTargetsClient) (it IscsiTarget, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + it.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.IscsiTargetsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if it.Response.Response, err = future.GetResult(sender); err == nil && it.Response.Response.StatusCode != http.StatusNoContent { + it, err = client.CreateOrUpdateResponder(it.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsCreateOrUpdateFuture", "Result", it.Response.Response, "Failure responding to request") + } + } + return +} + +// IscsiTargetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IscsiTargetsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IscsiTargetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IscsiTargetsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IscsiTargetsDeleteFuture.Result. +func (future *IscsiTargetsDeleteFuture) result(client IscsiTargetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.IscsiTargetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// IscsiTargetsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IscsiTargetsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IscsiTargetsClient) (IscsiTarget, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IscsiTargetsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IscsiTargetsUpdateFuture.Result. +func (future *IscsiTargetsUpdateFuture) result(client IscsiTargetsClient) (it IscsiTarget, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + it.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagepool.IscsiTargetsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if it.Response.Response, err = future.GetResult(sender); err == nil && it.Response.Response.StatusCode != http.StatusNoContent { + it, err = client.UpdateResponder(it.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.IscsiTargetsUpdateFuture", "Result", it.Response.Response, "Failure responding to request") + } + } + return +} + +// IscsiTargetUpdate payload for iSCSI Target update requests. +type IscsiTargetUpdate struct { + // IscsiTargetUpdateProperties - Properties for iSCSI Target update request. + *IscsiTargetUpdateProperties `json:"properties,omitempty"` + // ManagedBy - Azure resource id. Indicates if this resource is managed by another Azure resource. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - List of Azure resource ids that manage this resource. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IscsiTargetUpdate. +func (itu IscsiTargetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itu.IscsiTargetUpdateProperties != nil { + objectMap["properties"] = itu.IscsiTargetUpdateProperties + } + if itu.ManagedBy != nil { + objectMap["managedBy"] = itu.ManagedBy + } + if itu.ManagedByExtended != nil { + objectMap["managedByExtended"] = itu.ManagedByExtended + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IscsiTargetUpdate struct. +func (itu *IscsiTargetUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iscsiTargetUpdateProperties IscsiTargetUpdateProperties + err = json.Unmarshal(*v, &iscsiTargetUpdateProperties) + if err != nil { + return err + } + itu.IscsiTargetUpdateProperties = &iscsiTargetUpdateProperties + } + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + itu.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + itu.ManagedByExtended = &managedByExtended + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itu.Type = &typeVar + } + } + } + + return nil +} + +// IscsiTargetUpdateProperties properties for iSCSI Target update request. +type IscsiTargetUpdateProperties struct { + // StaticAcls - Access Control List (ACL) for an iSCSI Target; defines LUN masking policy + StaticAcls *[]ACL `json:"staticAcls,omitempty"` + // Luns - List of LUNs to be exposed through iSCSI Target. + Luns *[]IscsiLun `json:"luns,omitempty"` +} + +// OperationDisplay metadata about an operation. +type OperationDisplay struct { + // Provider - Localized friendly form of the resource provider name. + Provider *string `json:"provider,omitempty"` + // Resource - Localized friendly form of the resource type related to this action/operation. + Resource *string `json:"resource,omitempty"` + // Operation - Localized friendly name for the operation, as it should be shown to the user. + Operation *string `json:"operation,omitempty"` + // Description - Localized friendly description for the operation, as it should be shown to the user. + Description *string `json:"description,omitempty"` +} + +// OperationListResult list of operations supported by the RP. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - An array of operations supported by the StoragePool RP. + Value *[]RPOperation `json:"value,omitempty"` + // NextLink - URI to fetch the next section of the paginated response. + NextLink *string `json:"nextLink,omitempty"` +} + +// OutboundEnvironmentEndpoint endpoints accessed for a common purpose that the App Service Environment +// requires outbound network access to. +type OutboundEnvironmentEndpoint struct { + // Category - The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + Category *string `json:"category,omitempty"` + // Endpoints - The endpoints that the App Service Environment reaches the service at. + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` +} + +// OutboundEnvironmentEndpointList collection of Outbound Environment Endpoints +type OutboundEnvironmentEndpointList struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundEnvironmentEndpointList. +func (oeel OutboundEnvironmentEndpointList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oeel.Value != nil { + objectMap["value"] = oeel.Value + } + return json.Marshal(objectMap) +} + +// OutboundEnvironmentEndpointListIterator provides access to a complete listing of +// OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointListIterator struct { + i int + page OutboundEnvironmentEndpointListPage +} + +// 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 *OutboundEnvironmentEndpointListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointListIterator.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 *OutboundEnvironmentEndpointListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundEnvironmentEndpointListIterator) 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 OutboundEnvironmentEndpointListIterator) Response() OutboundEnvironmentEndpointList { + 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 OutboundEnvironmentEndpointListIterator) Value() OutboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return OutboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundEnvironmentEndpointListIterator type. +func NewOutboundEnvironmentEndpointListIterator(page OutboundEnvironmentEndpointListPage) OutboundEnvironmentEndpointListIterator { + return OutboundEnvironmentEndpointListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oeel OutboundEnvironmentEndpointList) IsEmpty() bool { + return oeel.Value == nil || len(*oeel.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (oeel OutboundEnvironmentEndpointList) hasNextLink() bool { + return oeel.NextLink != nil && len(*oeel.NextLink) != 0 +} + +// outboundEnvironmentEndpointListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oeel OutboundEnvironmentEndpointList) outboundEnvironmentEndpointListPreparer(ctx context.Context) (*http.Request, error) { + if !oeel.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oeel.NextLink))) +} + +// OutboundEnvironmentEndpointListPage contains a page of OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointListPage struct { + fn func(context.Context, OutboundEnvironmentEndpointList) (OutboundEnvironmentEndpointList, error) + oeel OutboundEnvironmentEndpointList +} + +// 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 *OutboundEnvironmentEndpointListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.oeel) + if err != nil { + return err + } + page.oeel = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *OutboundEnvironmentEndpointListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundEnvironmentEndpointListPage) NotDone() bool { + return !page.oeel.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundEnvironmentEndpointListPage) Response() OutboundEnvironmentEndpointList { + return page.oeel +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundEnvironmentEndpointListPage) Values() []OutboundEnvironmentEndpoint { + if page.oeel.IsEmpty() { + return nil + } + return *page.oeel.Value +} + +// Creates a new instance of the OutboundEnvironmentEndpointListPage type. +func NewOutboundEnvironmentEndpointListPage(cur OutboundEnvironmentEndpointList, getNextPage func(context.Context, OutboundEnvironmentEndpointList) (OutboundEnvironmentEndpointList, error)) OutboundEnvironmentEndpointListPage { + return OutboundEnvironmentEndpointListPage{ + fn: getNextPage, + oeel: cur, + } +} + +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource ARM resource model definition. +type Resource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuCapability capability a resource SKU has. +type ResourceSkuCapability struct { + // Name - READ-ONLY; Capability name + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; Capability value + Value *string `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuCapability. +func (rsc ResourceSkuCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuInfo resource SKU Details +type ResourceSkuInfo struct { + // APIVersion - READ-ONLY; StoragePool RP API version + APIVersion *string `json:"apiVersion,omitempty"` + // ResourceType - READ-ONLY; StoragePool resource type + ResourceType *string `json:"resourceType,omitempty"` + // Capabilities - READ-ONLY; List of additional capabilities for StoragePool resource. + Capabilities *[]ResourceSkuCapability `json:"capabilities,omitempty"` + // LocationInfo - READ-ONLY; Zones and zone capabilities in those locations where the SKU is available. + LocationInfo *ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + // Name - READ-ONLY; Sku name + Name *string `json:"name,omitempty"` + // Tier - READ-ONLY; Sku tier + Tier *string `json:"tier,omitempty"` + // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuInfo. +func (rsi ResourceSkuInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuListResult list Disk Pool skus operation response. +type ResourceSkuListResult struct { + autorest.Response `json:"-"` + // Value - The list of StoragePool resource skus. + Value *[]ResourceSkuInfo `json:"value,omitempty"` + // NextLink - URI to fetch the next section of the paginated response. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceSkuListResultIterator provides access to a complete listing of ResourceSkuInfo values. +type ResourceSkuListResultIterator struct { + i int + page ResourceSkuListResultPage +} + +// 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 *ResourceSkuListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuListResultIterator.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 *ResourceSkuListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceSkuListResultIterator) 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 ResourceSkuListResultIterator) Response() ResourceSkuListResult { + 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 ResourceSkuListResultIterator) Value() ResourceSkuInfo { + if !iter.page.NotDone() { + return ResourceSkuInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceSkuListResultIterator type. +func NewResourceSkuListResultIterator(page ResourceSkuListResultPage) ResourceSkuListResultIterator { + return ResourceSkuListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rslr ResourceSkuListResult) IsEmpty() bool { + return rslr.Value == nil || len(*rslr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rslr ResourceSkuListResult) hasNextLink() bool { + return rslr.NextLink != nil && len(*rslr.NextLink) != 0 +} + +// resourceSkuListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rslr ResourceSkuListResult) resourceSkuListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rslr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rslr.NextLink))) +} + +// ResourceSkuListResultPage contains a page of ResourceSkuInfo values. +type ResourceSkuListResultPage struct { + fn func(context.Context, ResourceSkuListResult) (ResourceSkuListResult, error) + rslr ResourceSkuListResult +} + +// 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 *ResourceSkuListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rslr) + if err != nil { + return err + } + page.rslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *ResourceSkuListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceSkuListResultPage) NotDone() bool { + return !page.rslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceSkuListResultPage) Response() ResourceSkuListResult { + return page.rslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceSkuListResultPage) Values() []ResourceSkuInfo { + if page.rslr.IsEmpty() { + return nil + } + return *page.rslr.Value +} + +// Creates a new instance of the ResourceSkuListResultPage type. +func NewResourceSkuListResultPage(cur ResourceSkuListResult, getNextPage func(context.Context, ResourceSkuListResult) (ResourceSkuListResult, error)) ResourceSkuListResultPage { + return ResourceSkuListResultPage{ + fn: getNextPage, + rslr: cur, + } +} + +// ResourceSkuLocationInfo zone and capability info for resource sku +type ResourceSkuLocationInfo struct { + // Location - READ-ONLY; Location of the SKU + Location *string `json:"location,omitempty"` + // Zones - READ-ONLY; List of availability zones where the SKU is supported. + Zones *[]string `json:"zones,omitempty"` + // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. + ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. +func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuRestrictionInfo describes an available Compute SKU Restriction Information. +type ResourceSkuRestrictionInfo struct { + // Locations - READ-ONLY; Locations where the SKU is restricted + Locations *[]string `json:"locations,omitempty"` + // Zones - READ-ONLY; List of availability zones where the SKU is restricted. + Zones *[]string `json:"zones,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. +func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuRestrictions describes scaling information of a SKU. +type ResourceSkuRestrictions struct { + // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' + Type ResourceSkuRestrictionsType `json:"type,omitempty"` + // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. + RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` + // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' + ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. +func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. +type ResourceSkuZoneDetails struct { + // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. + Name *[]string `json:"name,omitempty"` + // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. + Capabilities *[]ResourceSkuCapability `json:"capabilities,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. +func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RPOperation description of a StoragePool RP Operation +type RPOperation struct { + // Name - The name of the operation being performed on this particular object + Name *string `json:"name,omitempty"` + // IsDataAction - Indicates whether the operation applies to data-plane. + IsDataAction *bool `json:"isDataAction,omitempty"` + // ActionType - Indicates the action type. + ActionType *string `json:"actionType,omitempty"` + // Display - Additional metadata about RP operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + Origin *string `json:"origin,omitempty"` +} + +// Sku sku for ARM resource +type Sku struct { + // Name - Sku name + Name *string `json:"name,omitempty"` + // Tier - Sku tier + Tier *string `json:"tier,omitempty"` +} + +// SystemMetadata metadata pertaining to creation and last modification of the resource. +type SystemMetadata struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The type of identity that last modified the resource. + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource. +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives. + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/operations.go b/services/storagepool/mgmt/2021-08-01/storagepool/operations.go similarity index 98% rename from services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/operations.go rename to services/storagepool/mgmt/2021-08-01/storagepool/operations.go index 722af2152fa0..2887e0571963 100644 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/operations.go +++ b/services/storagepool/mgmt/2021-08-01/storagepool/operations.go @@ -66,7 +66,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-03-15-preview" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/storagepool/mgmt/2021-08-01/storagepool/resourceskus.go b/services/storagepool/mgmt/2021-08-01/storagepool/resourceskus.go new file mode 100644 index 000000000000..8578563a472b --- /dev/null +++ b/services/storagepool/mgmt/2021-08-01/storagepool/resourceskus.go @@ -0,0 +1,154 @@ +package storagepool + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" +) + +// ResourceSkusClient is the client for the ResourceSkus methods of the Storagepool service. +type ResourceSkusClient struct { + BaseClient +} + +// NewResourceSkusClient creates an instance of the ResourceSkusClient client. +func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { + return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { + return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists available StoragePool resources and skus in an Azure location. +// Parameters: +// location - the location of the resource. +func (client ResourceSkusClient) List(ctx context.Context, location string) (result ResourceSkuListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") + defer func() { + sc := -1 + if result.rslr.Response.Response != nil { + sc = result.rslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagepool.ResourceSkusClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.ResourceSkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagepool.ResourceSkusClient", "List", resp, "Failure sending request") + return + } + + result.rslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.ResourceSkusClient", "List", resp, "Failure responding to request") + return + } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourceSkusClient) 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 = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/locations/{location}/skus", 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 ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkuListResult, err error) { + err = autorest.Respond( + resp, + 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 ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkuListResult) (result ResourceSkuListResult, err error) { + req, err := lastResults.resourceSkuListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagepool.ResourceSkusClient", "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, "storagepool.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagepool.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceSkusClient) ListComplete(ctx context.Context, location string) (result ResourceSkuListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.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 +} diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/storagepoolapi/interfaces.go b/services/storagepool/mgmt/2021-08-01/storagepool/storagepoolapi/interfaces.go similarity index 51% rename from services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/storagepoolapi/interfaces.go rename to services/storagepool/mgmt/2021-08-01/storagepool/storagepoolapi/interfaces.go index 6cb10309680a..b0448c823101 100644 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/storagepoolapi/interfaces.go +++ b/services/storagepool/mgmt/2021-08-01/storagepool/storagepoolapi/interfaces.go @@ -8,7 +8,7 @@ package storagepoolapi import ( "context" - "github.com/Azure/azure-sdk-for-go/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool" + "github.com/Azure/azure-sdk-for-go/services/storagepool/mgmt/2021-08-01/storagepool" ) // OperationsClientAPI contains the set of methods on the OperationsClient type. @@ -20,25 +20,47 @@ var _ OperationsClientAPI = (*storagepool.OperationsClient)(nil) // DiskPoolsClientAPI contains the set of methods on the DiskPoolsClient type. type DiskPoolsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolPayload storagepool.DiskPool) (result storagepool.DiskPoolsCreateOrUpdateFuture, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolCreatePayload storagepool.DiskPoolCreate) (result storagepool.DiskPoolsCreateOrUpdateFuture, err error) + Deallocate(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.DiskPoolsDeallocateFuture, err error) Delete(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.DiskPoolsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.DiskPool, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storagepool.DiskPoolListResultPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result storagepool.DiskPoolListResultIterator, err error) ListBySubscription(ctx context.Context) (result storagepool.DiskPoolListResultPage, err error) ListBySubscriptionComplete(ctx context.Context) (result storagepool.DiskPoolListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolPayload storagepool.DiskPool) (result storagepool.DiskPool, err error) + ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.OutboundEnvironmentEndpointListPage, err error) + ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.OutboundEnvironmentEndpointListIterator, err error) + Start(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.DiskPoolsStartFuture, err error) + Update(ctx context.Context, resourceGroupName string, diskPoolName string, diskPoolUpdatePayload storagepool.DiskPoolUpdate) (result storagepool.DiskPoolsUpdateFuture, err error) + Upgrade(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.DiskPoolsUpgradeFuture, err error) } var _ DiskPoolsClientAPI = (*storagepool.DiskPoolsClient)(nil) +// DiskPoolZonesClientAPI contains the set of methods on the DiskPoolZonesClient type. +type DiskPoolZonesClientAPI interface { + List(ctx context.Context, location string) (result storagepool.DiskPoolZoneListResultPage, err error) + ListComplete(ctx context.Context, location string) (result storagepool.DiskPoolZoneListResultIterator, err error) +} + +var _ DiskPoolZonesClientAPI = (*storagepool.DiskPoolZonesClient)(nil) + +// ResourceSkusClientAPI contains the set of methods on the ResourceSkusClient type. +type ResourceSkusClientAPI interface { + List(ctx context.Context, location string) (result storagepool.ResourceSkuListResultPage, err error) + ListComplete(ctx context.Context, location string) (result storagepool.ResourceSkuListResultIterator, err error) +} + +var _ ResourceSkusClientAPI = (*storagepool.ResourceSkusClient)(nil) + // IscsiTargetsClientAPI contains the set of methods on the IscsiTargetsClient type. type IscsiTargetsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetPayload storagepool.IscsiTarget) (result storagepool.IscsiTargetsCreateOrUpdateFuture, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetCreatePayload storagepool.IscsiTargetCreate) (result storagepool.IscsiTargetsCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string) (result storagepool.IscsiTargetsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string) (result storagepool.IscsiTarget, err error) ListByDiskPool(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.IscsiTargetListPage, err error) ListByDiskPoolComplete(ctx context.Context, resourceGroupName string, diskPoolName string) (result storagepool.IscsiTargetListIterator, err error) + Update(ctx context.Context, resourceGroupName string, diskPoolName string, iscsiTargetName string, iscsiTargetUpdatePayload storagepool.IscsiTargetUpdate) (result storagepool.IscsiTargetsUpdateFuture, err error) } var _ IscsiTargetsClientAPI = (*storagepool.IscsiTargetsClient)(nil) diff --git a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/version.go b/services/storagepool/mgmt/2021-08-01/storagepool/version.go similarity index 88% rename from services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/version.go rename to services/storagepool/mgmt/2021-08-01/storagepool/version.go index f9fbab67c9e6..b59659a1cd98 100644 --- a/services/preview/storagepool/mgmt/2020-03-15-preview/storagepool/version.go +++ b/services/storagepool/mgmt/2021-08-01/storagepool/version.go @@ -10,7 +10,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() + " storagepool/2020-03-15-preview" + return "Azure-SDK-For-Go/" + Version() + " storagepool/2021-08-01" } // Version returns the semantic version (see http://semver.org) of the client.