Update Azure Go SDK to v55.0.0

This commit is contained in:
Pengfei Ni
2021-06-01 01:30:43 +00:00
parent f363322d4a
commit b98824c55d
88 changed files with 2313 additions and 944 deletions

View File

@@ -1,96 +1,43 @@
Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/compute/resource-manager/readme.md tag: `package-2019-12-01`
Code generator @microsoft.azure/autorest.go@2.1.178
# Change History
## Additive Changes
### New Funcs
1. *ContainerServicesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ContainerServicesDeleteFuture.UnmarshalJSON([]byte) error
1. *DedicatedHostsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DedicatedHostsDeleteFuture.UnmarshalJSON([]byte) error
1. *DedicatedHostsUpdateFuture.UnmarshalJSON([]byte) error
1. *DiskEncryptionSetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DiskEncryptionSetsDeleteFuture.UnmarshalJSON([]byte) error
1. *DiskEncryptionSetsUpdateFuture.UnmarshalJSON([]byte) error
1. *DisksCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DisksDeleteFuture.UnmarshalJSON([]byte) error
1. *DisksGrantAccessFuture.UnmarshalJSON([]byte) error
1. *DisksRevokeAccessFuture.UnmarshalJSON([]byte) error
1. *DisksUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleriesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleriesDeleteFuture.UnmarshalJSON([]byte) error
1. *GalleriesUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryApplicationVersionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryApplicationVersionsDeleteFuture.UnmarshalJSON([]byte) error
1. *GalleryApplicationVersionsUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryApplicationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryApplicationsDeleteFuture.UnmarshalJSON([]byte) error
1. *GalleryApplicationsUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryImageVersionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryImageVersionsDeleteFuture.UnmarshalJSON([]byte) error
1. *GalleryImageVersionsUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryImagesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *GalleryImagesDeleteFuture.UnmarshalJSON([]byte) error
1. *GalleryImagesUpdateFuture.UnmarshalJSON([]byte) error
1. *ImagesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ImagesDeleteFuture.UnmarshalJSON([]byte) error
1. *ImagesUpdateFuture.UnmarshalJSON([]byte) error
1. *LogAnalyticsExportRequestRateByIntervalFuture.UnmarshalJSON([]byte) error
1. *LogAnalyticsExportThrottledRequestsFuture.UnmarshalJSON([]byte) error
1. *SnapshotsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *SnapshotsDeleteFuture.UnmarshalJSON([]byte) error
1. *SnapshotsGrantAccessFuture.UnmarshalJSON([]byte) error
1. *SnapshotsRevokeAccessFuture.UnmarshalJSON([]byte) error
1. *SnapshotsUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineExtensionsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineExtensionsUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetExtensionsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetExtensionsUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetRollingUpgradesCancelFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMExtensionsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMExtensionsUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsDeallocateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsPerformMaintenanceFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsPowerOffFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsRedeployFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsReimageAllFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsReimageFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsRestartFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsRunCommandFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsStartFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetVMsUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsDeallocateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsDeleteInstancesFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsPerformMaintenanceFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsPowerOffFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsRedeployFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsReimageAllFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsReimageFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsRestartFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsStartFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachineScaleSetsUpdateInstancesFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesCaptureFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesConvertToManagedDisksFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesDeallocateFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesPerformMaintenanceFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesPowerOffFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesReapplyFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesRedeployFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesReimageFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesRestartFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesRunCommandFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesStartFuture.UnmarshalJSON([]byte) error
1. *VirtualMachinesUpdateFuture.UnmarshalJSON([]byte) error
1. AccessURI.MarshalJSON() ([]byte, error)
1. BootDiagnosticsInstanceView.MarshalJSON() ([]byte, error)
1. DataDiskImage.MarshalJSON() ([]byte, error)
1. GalleryIdentifier.MarshalJSON() ([]byte, error)
1. LogAnalyticsOperationResult.MarshalJSON() ([]byte, error)
1. LogAnalyticsOutput.MarshalJSON() ([]byte, error)
1. OperationListResult.MarshalJSON() ([]byte, error)
1. OperationValueDisplay.MarshalJSON() ([]byte, error)
1. OrchestrationServiceSummary.MarshalJSON() ([]byte, error)
1. RecoveryWalkResponse.MarshalJSON() ([]byte, error)
1. RegionalReplicationStatus.MarshalJSON() ([]byte, error)
1. ReplicationStatus.MarshalJSON() ([]byte, error)
1. ResourceSku.MarshalJSON() ([]byte, error)
1. ResourceSkuCapabilities.MarshalJSON() ([]byte, error)
1. ResourceSkuCapacity.MarshalJSON() ([]byte, error)
1. ResourceSkuCosts.MarshalJSON() ([]byte, error)
1. ResourceSkuLocationInfo.MarshalJSON() ([]byte, error)
1. ResourceSkuRestrictionInfo.MarshalJSON() ([]byte, error)
1. ResourceSkuRestrictions.MarshalJSON() ([]byte, error)
1. ResourceSkuZoneDetails.MarshalJSON() ([]byte, error)
1. RollbackStatusInfo.MarshalJSON() ([]byte, error)
1. RollingUpgradeProgressInfo.MarshalJSON() ([]byte, error)
1. RollingUpgradeRunningStatus.MarshalJSON() ([]byte, error)
1. RollingUpgradeStatusInfoProperties.MarshalJSON() ([]byte, error)
1. ShareInfoElement.MarshalJSON() ([]byte, error)
1. SubResourceReadOnly.MarshalJSON() ([]byte, error)
1. UpgradeOperationHistoricalStatusInfo.MarshalJSON() ([]byte, error)
1. UpgradeOperationHistoricalStatusInfoProperties.MarshalJSON() ([]byte, error)
1. UpgradeOperationHistoryStatus.MarshalJSON() ([]byte, error)
1. VirtualMachineHealthStatus.MarshalJSON() ([]byte, error)
1. VirtualMachineIdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error)
1. VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error)
1. VirtualMachineScaleSetInstanceViewStatusesSummary.MarshalJSON() ([]byte, error)
1. VirtualMachineScaleSetSku.MarshalJSON() ([]byte, error)
1. VirtualMachineScaleSetSkuCapacity.MarshalJSON() ([]byte, error)
1. VirtualMachineScaleSetVMExtensionsSummary.MarshalJSON() ([]byte, error)
1. VirtualMachineStatusCodeCount.MarshalJSON() ([]byte, error)

View File

@@ -0,0 +1,11 @@
{
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
"readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
"tag": "package-2019-12-01",
"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-2019-12-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/compute/resource-manager/readme.md",
"additional_properties": {
"additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION"
}
}

View File

@@ -1,23 +1,9 @@
Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/containerregistry/resource-manager/readme.md tag: `package-2019-05`
Code generator @microsoft.azure/autorest.go@2.1.178
# Change History
## Additive Changes
### New Funcs
1. *RegistriesCreateFuture.UnmarshalJSON([]byte) error
1. *RegistriesDeleteFuture.UnmarshalJSON([]byte) error
1. *RegistriesImportImageFuture.UnmarshalJSON([]byte) error
1. *RegistriesScheduleRunFuture.UnmarshalJSON([]byte) error
1. *RegistriesUpdateFuture.UnmarshalJSON([]byte) error
1. *ReplicationsCreateFuture.UnmarshalJSON([]byte) error
1. *ReplicationsDeleteFuture.UnmarshalJSON([]byte) error
1. *ReplicationsUpdateFuture.UnmarshalJSON([]byte) error
1. *RunsCancelFuture.UnmarshalJSON([]byte) error
1. *RunsUpdateFuture.UnmarshalJSON([]byte) error
1. *TasksCreateFuture.UnmarshalJSON([]byte) error
1. *TasksDeleteFuture.UnmarshalJSON([]byte) error
1. *TasksUpdateFuture.UnmarshalJSON([]byte) error
1. *WebhooksCreateFuture.UnmarshalJSON([]byte) error
1. *WebhooksDeleteFuture.UnmarshalJSON([]byte) error
1. *WebhooksUpdateFuture.UnmarshalJSON([]byte) error
1. ProxyResource.MarshalJSON() ([]byte, error)
1. ReplicationProperties.MarshalJSON() ([]byte, error)
1. Status.MarshalJSON() ([]byte, error)

View File

@@ -0,0 +1,11 @@
{
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
"readme": "/_/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md",
"tag": "package-2019-05",
"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-2019-05 --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/containerregistry/resource-manager/readme.md",
"additional_properties": {
"additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION"
}
}

View File

@@ -1580,6 +1580,12 @@ type ProxyResource struct {
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)
}
// QuarantinePolicy the quarantine policy for a container registry.
type QuarantinePolicy struct {
// Status - The value that indicates whether the policy is enabled or not. Possible values include: 'Enabled', 'Disabled'
@@ -1621,6 +1627,7 @@ func (future *RegistriesCreateFuture) result(client RegistriesClient) (r Registr
return
}
if !done {
r.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture")
return
}
@@ -1663,6 +1670,7 @@ func (future *RegistriesDeleteFuture) result(client RegistriesClient) (ar autore
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture")
return
}
@@ -1699,6 +1707,7 @@ func (future *RegistriesImportImageFuture) result(client RegistriesClient) (ar a
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesImportImageFuture")
return
}
@@ -1735,6 +1744,7 @@ func (future *RegistriesScheduleRunFuture) result(client RegistriesClient) (r Ru
return
}
if !done {
r.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesScheduleRunFuture")
return
}
@@ -1777,6 +1787,7 @@ func (future *RegistriesUpdateFuture) result(client RegistriesClient) (r Registr
return
}
if !done {
r.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture")
return
}
@@ -2502,6 +2513,12 @@ type ReplicationProperties struct {
Status *Status `json:"status,omitempty"`
}
// MarshalJSON is the custom marshaler for ReplicationProperties.
func (rp ReplicationProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type ReplicationsCreateFuture struct {
@@ -2531,6 +2548,7 @@ func (future *ReplicationsCreateFuture) result(client ReplicationsClient) (r Rep
return
}
if !done {
r.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture")
return
}
@@ -2573,6 +2591,7 @@ func (future *ReplicationsDeleteFuture) result(client ReplicationsClient) (ar au
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture")
return
}
@@ -2609,6 +2628,7 @@ func (future *ReplicationsUpdateFuture) result(client ReplicationsClient) (r Rep
return
}
if !done {
r.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture")
return
}
@@ -3198,6 +3218,7 @@ func (future *RunsCancelFuture) result(client RunsClient) (ar autorest.Response,
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RunsCancelFuture")
return
}
@@ -3233,6 +3254,7 @@ func (future *RunsUpdateFuture) result(client RunsClient) (r Run, err error) {
return
}
if !done {
r.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.RunsUpdateFuture")
return
}
@@ -3394,6 +3416,12 @@ type Status struct {
Timestamp *date.Time `json:"timestamp,omitempty"`
}
// MarshalJSON is the custom marshaler for Status.
func (s Status) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// StorageAccountProperties the properties of a storage account for a container registry. Only applicable
// to Classic SKU.
type StorageAccountProperties struct {
@@ -4024,6 +4052,7 @@ func (future *TasksCreateFuture) result(client TasksClient) (t Task, err error)
return
}
if !done {
t.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.TasksCreateFuture")
return
}
@@ -4065,6 +4094,7 @@ func (future *TasksDeleteFuture) result(client TasksClient) (ar autorest.Respons
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.TasksDeleteFuture")
return
}
@@ -4310,6 +4340,7 @@ func (future *TasksUpdateFuture) result(client TasksClient) (t Task, err error)
return
}
if !done {
t.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.TasksUpdateFuture")
return
}
@@ -4915,6 +4946,7 @@ func (future *WebhooksCreateFuture) result(client WebhooksClient) (w Webhook, er
return
}
if !done {
w.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture")
return
}
@@ -4957,6 +4989,7 @@ func (future *WebhooksDeleteFuture) result(client WebhooksClient) (ar autorest.R
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture")
return
}
@@ -4993,6 +5026,7 @@ func (future *WebhooksUpdateFuture) result(client WebhooksClient) (w Webhook, er
return
}
if !done {
w.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture")
return
}

View File

@@ -1,20 +1,11 @@
Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/containerservice/resource-manager/readme.md tag: `package-2020-04`
Code generator @microsoft.azure/autorest.go@2.1.178
# Change History
## Additive Changes
### New Funcs
1. *AgentPoolsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *AgentPoolsDeleteFuture.UnmarshalJSON([]byte) error
1. *ContainerServicesCreateOrUpdateFutureType.UnmarshalJSON([]byte) error
1. *ContainerServicesDeleteFutureType.UnmarshalJSON([]byte) error
1. *ManagedClustersCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ManagedClustersDeleteFuture.UnmarshalJSON([]byte) error
1. *ManagedClustersResetAADProfileFuture.UnmarshalJSON([]byte) error
1. *ManagedClustersResetServicePrincipalProfileFuture.UnmarshalJSON([]byte) error
1. *ManagedClustersRotateClusterCertificatesFuture.UnmarshalJSON([]byte) error
1. *ManagedClustersUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *OpenShiftManagedClustersCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *OpenShiftManagedClustersDeleteFuture.UnmarshalJSON([]byte) error
1. *OpenShiftManagedClustersUpdateTagsFuture.UnmarshalJSON([]byte) error
1. CredentialResult.MarshalJSON() ([]byte, error)
1. CredentialResults.MarshalJSON() ([]byte, error)
1. OperationListResult.MarshalJSON() ([]byte, error)
1. OperationValueDisplay.MarshalJSON() ([]byte, error)
1. SubResource.MarshalJSON() ([]byte, error)

View File

@@ -0,0 +1,11 @@
{
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
"readme": "/_/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md",
"tag": "package-2020-04",
"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-04 --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/containerservice/resource-manager/readme.md",
"additional_properties": {
"additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION"
}
}

View File

@@ -441,6 +441,7 @@ func (future *AgentPoolsCreateOrUpdateFuture) result(client AgentPoolsClient) (a
return
}
if !done {
ap.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture")
return
}
@@ -483,6 +484,7 @@ func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autore
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture")
return
}
@@ -737,6 +739,7 @@ func (future *ContainerServicesCreateOrUpdateFutureType) result(client Container
return
}
if !done {
cs.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType")
return
}
@@ -779,6 +782,7 @@ func (future *ContainerServicesDeleteFutureType) result(client ContainerServices
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType")
return
}
@@ -794,6 +798,12 @@ type CredentialResult struct {
Value *[]byte `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for CredentialResult.
func (cr CredentialResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CredentialResults the list of credential result response.
type CredentialResults struct {
autorest.Response `json:"-"`
@@ -801,6 +811,12 @@ type CredentialResults struct {
Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"`
}
// MarshalJSON is the custom marshaler for CredentialResults.
func (cr CredentialResults) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CustomProfile properties to configure a custom container service cluster.
type CustomProfile struct {
// Orchestrator - The name of the custom orchestrator to use.
@@ -1929,6 +1945,7 @@ func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClusters
return
}
if !done {
mc.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture")
return
}
@@ -1971,6 +1988,7 @@ func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient)
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture")
return
}
@@ -2024,6 +2042,7 @@ func (future *ManagedClustersResetAADProfileFuture) result(client ManagedCluster
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture")
return
}
@@ -2060,6 +2079,7 @@ func (future *ManagedClustersResetServicePrincipalProfileFuture) result(client M
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture")
return
}
@@ -2096,6 +2116,7 @@ func (future *ManagedClustersRotateClusterCertificatesFuture) result(client Mana
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture")
return
}
@@ -2132,6 +2153,7 @@ func (future *ManagedClustersUpdateTagsFuture) result(client ManagedClustersClie
return
}
if !done {
mc.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture")
return
}
@@ -2880,6 +2902,7 @@ func (future *OpenShiftManagedClustersCreateOrUpdateFuture) result(client OpenSh
return
}
if !done {
osmc.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersCreateOrUpdateFuture")
return
}
@@ -2922,6 +2945,7 @@ func (future *OpenShiftManagedClustersDeleteFuture) result(client OpenShiftManag
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersDeleteFuture")
return
}
@@ -2958,6 +2982,7 @@ func (future *OpenShiftManagedClustersUpdateTagsFuture) result(client OpenShiftM
return
}
if !done {
osmc.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersUpdateTagsFuture")
return
}
@@ -2997,6 +3022,12 @@ type OperationListResult struct {
Value *[]OperationValue `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationListResult.
func (olr OperationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// OperationValue describes the properties of a Compute Operation value.
type OperationValue struct {
// Origin - READ-ONLY; The origin of the compute operation.
@@ -3070,6 +3101,12 @@ type OperationValueDisplay struct {
Provider *string `json:"provider,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationValueDisplay.
func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// OrchestratorProfile contains information about orchestrator.
type OrchestratorProfile struct {
// OrchestratorType - Orchestrator type.
@@ -3310,6 +3347,12 @@ type SubResource struct {
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for SubResource.
func (sr SubResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// TagsObject tags object for patch operations.
type TagsObject struct {
// Tags - Resource tags.

View File

@@ -1,186 +1,28 @@
Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/network/resource-manager/readme.md tag: `package-2019-06`
Code generator @microsoft.azure/autorest.go@2.1.178
# Change History
## Additive Changes
### New Funcs
1. *ApplicationGatewaysBackendHealthFuture.UnmarshalJSON([]byte) error
1. *ApplicationGatewaysBackendHealthOnDemandFuture.UnmarshalJSON([]byte) error
1. *ApplicationGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ApplicationGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *ApplicationGatewaysStartFuture.UnmarshalJSON([]byte) error
1. *ApplicationGatewaysStopFuture.UnmarshalJSON([]byte) error
1. *ApplicationGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *ApplicationSecurityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ApplicationSecurityGroupsDeleteFuture.UnmarshalJSON([]byte) error
1. *ApplicationSecurityGroupsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *AzureFirewallsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *AzureFirewallsDeleteFuture.UnmarshalJSON([]byte) error
1. *BastionHostsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *BastionHostsDeleteFuture.UnmarshalJSON([]byte) error
1. *BastionHostsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *ConnectionMonitorsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ConnectionMonitorsDeleteFuture.UnmarshalJSON([]byte) error
1. *ConnectionMonitorsQueryFuture.UnmarshalJSON([]byte) error
1. *ConnectionMonitorsStartFuture.UnmarshalJSON([]byte) error
1. *ConnectionMonitorsStopFuture.UnmarshalJSON([]byte) error
1. *DdosCustomPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DdosCustomPoliciesDeleteFuture.UnmarshalJSON([]byte) error
1. *DdosCustomPoliciesUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *DdosProtectionPlansCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DdosProtectionPlansDeleteFuture.UnmarshalJSON([]byte) error
1. *DdosProtectionPlansUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitAuthorizationsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitConnectionsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitPeeringsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitsListArpTableFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitsListRoutesTableFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitsListRoutesTableSummaryFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCircuitsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteConnectionsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionPeeringsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionsListArpTableFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionsListRoutesTableFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteCrossConnectionsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRouteGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRoutePortsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ExpressRoutePortsDeleteFuture.UnmarshalJSON([]byte) error
1. *ExpressRoutePortsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *FirewallPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *FirewallPoliciesDeleteFuture.UnmarshalJSON([]byte) error
1. *FirewallPolicyRuleGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *FirewallPolicyRuleGroupsDeleteFuture.UnmarshalJSON([]byte) error
1. *InboundNatRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *InboundNatRulesDeleteFuture.UnmarshalJSON([]byte) error
1. *InterfaceTapConfigurationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *InterfaceTapConfigurationsDeleteFuture.UnmarshalJSON([]byte) error
1. *InterfacesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *InterfacesDeleteFuture.UnmarshalJSON([]byte) error
1. *InterfacesGetEffectiveRouteTableFuture.UnmarshalJSON([]byte) error
1. *InterfacesListEffectiveNetworkSecurityGroupsFuture.UnmarshalJSON([]byte) error
1. *InterfacesUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *LoadBalancersCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *LoadBalancersDeleteFuture.UnmarshalJSON([]byte) error
1. *LoadBalancersUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *LocalNetworkGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *LocalNetworkGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *LocalNetworkGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *NatGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *NatGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *P2sVpnGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *P2sVpnGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *P2sVpnGatewaysGenerateVpnProfileFuture.UnmarshalJSON([]byte) error
1. *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture.UnmarshalJSON([]byte) error
1. *P2sVpnGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *P2sVpnServerConfigurationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *P2sVpnServerConfigurationsDeleteFuture.UnmarshalJSON([]byte) error
1. *PacketCapturesCreateFuture.UnmarshalJSON([]byte) error
1. *PacketCapturesDeleteFuture.UnmarshalJSON([]byte) error
1. *PacketCapturesGetStatusFuture.UnmarshalJSON([]byte) error
1. *PacketCapturesStopFuture.UnmarshalJSON([]byte) error
1. *PrivateEndpointsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *PrivateEndpointsDeleteFuture.UnmarshalJSON([]byte) error
1. *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture.UnmarshalJSON([]byte) error
1. *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture.UnmarshalJSON([]byte) error
1. *PrivateLinkServicesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *PrivateLinkServicesDeleteFuture.UnmarshalJSON([]byte) error
1. *PrivateLinkServicesDeletePrivateEndpointConnectionFuture.UnmarshalJSON([]byte) error
1. *ProfilesDeleteFuture.UnmarshalJSON([]byte) error
1. *PublicIPAddressesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *PublicIPAddressesDeleteFuture.UnmarshalJSON([]byte) error
1. *PublicIPAddressesUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *PublicIPPrefixesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *PublicIPPrefixesDeleteFuture.UnmarshalJSON([]byte) error
1. *PublicIPPrefixesUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *RouteFilterRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *RouteFilterRulesDeleteFuture.UnmarshalJSON([]byte) error
1. *RouteFilterRulesUpdateFuture.UnmarshalJSON([]byte) error
1. *RouteFiltersCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *RouteFiltersDeleteFuture.UnmarshalJSON([]byte) error
1. *RouteFiltersUpdateFuture.UnmarshalJSON([]byte) error
1. *RouteTablesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *RouteTablesDeleteFuture.UnmarshalJSON([]byte) error
1. *RouteTablesUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *RoutesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *RoutesDeleteFuture.UnmarshalJSON([]byte) error
1. *SecurityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *SecurityGroupsDeleteFuture.UnmarshalJSON([]byte) error
1. *SecurityGroupsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *SecurityRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *SecurityRulesDeleteFuture.UnmarshalJSON([]byte) error
1. *ServiceEndpointPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ServiceEndpointPoliciesDeleteFuture.UnmarshalJSON([]byte) error
1. *ServiceEndpointPoliciesUpdateFuture.UnmarshalJSON([]byte) error
1. *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *ServiceEndpointPolicyDefinitionsDeleteFuture.UnmarshalJSON([]byte) error
1. *SubnetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *SubnetsDeleteFuture.UnmarshalJSON([]byte) error
1. *SubnetsPrepareNetworkPoliciesFuture.UnmarshalJSON([]byte) error
1. *SubnetsUnprepareNetworkPoliciesFuture.UnmarshalJSON([]byte) error
1. *VirtualHubsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualHubsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualHubsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewayConnectionsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewayConnectionsResetSharedKeyFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewayConnectionsSetSharedKeyFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewayConnectionsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGenerateVpnProfileFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGeneratevpnclientpackageFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGetAdvertisedRoutesFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGetBgpPeerStatusFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGetLearnedRoutesFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysResetFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkPeeringsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkTapsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkTapsDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworkTapsUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworksCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworksDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualNetworksUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VirtualWansCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VirtualWansDeleteFuture.UnmarshalJSON([]byte) error
1. *VirtualWansUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VpnConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VpnConnectionsDeleteFuture.UnmarshalJSON([]byte) error
1. *VpnGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VpnGatewaysDeleteFuture.UnmarshalJSON([]byte) error
1. *VpnGatewaysResetFuture.UnmarshalJSON([]byte) error
1. *VpnGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *VpnSitesConfigurationDownloadFuture.UnmarshalJSON([]byte) error
1. *VpnSitesCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *VpnSitesDeleteFuture.UnmarshalJSON([]byte) error
1. *VpnSitesUpdateTagsFuture.UnmarshalJSON([]byte) error
1. *WatchersCheckConnectivityFuture.UnmarshalJSON([]byte) error
1. *WatchersDeleteFuture.UnmarshalJSON([]byte) error
1. *WatchersGetAzureReachabilityReportFuture.UnmarshalJSON([]byte) error
1. *WatchersGetFlowLogStatusFuture.UnmarshalJSON([]byte) error
1. *WatchersGetNetworkConfigurationDiagnosticFuture.UnmarshalJSON([]byte) error
1. *WatchersGetNextHopFuture.UnmarshalJSON([]byte) error
1. *WatchersGetTroubleshootingFuture.UnmarshalJSON([]byte) error
1. *WatchersGetTroubleshootingResultFuture.UnmarshalJSON([]byte) error
1. *WatchersGetVMSecurityRulesFuture.UnmarshalJSON([]byte) error
1. *WatchersListAvailableProvidersFuture.UnmarshalJSON([]byte) error
1. *WatchersSetFlowLogConfigurationFuture.UnmarshalJSON([]byte) error
1. *WatchersVerifyIPFlowFuture.UnmarshalJSON([]byte) error
1. *WebApplicationFirewallPoliciesDeleteFuture.UnmarshalJSON([]byte) error
1. ApplicationSecurityGroupPropertiesFormat.MarshalJSON() ([]byte, error)
1. AzureFirewallFqdnTagPropertiesFormat.MarshalJSON() ([]byte, error)
1. BgpPeerStatus.MarshalJSON() ([]byte, error)
1. ConfigurationDiagnosticResponse.MarshalJSON() ([]byte, error)
1. ConnectivityHop.MarshalJSON() ([]byte, error)
1. ConnectivityInformation.MarshalJSON() ([]byte, error)
1. ConnectivityIssue.MarshalJSON() ([]byte, error)
1. ContainerNetworkInterfaceIPConfigurationPropertiesFormat.MarshalJSON() ([]byte, error)
1. DdosProtectionPlanPropertiesFormat.MarshalJSON() ([]byte, error)
1. ExpressRouteConnectionID.MarshalJSON() ([]byte, error)
1. ExpressRoutePortsLocationBandwidths.MarshalJSON() ([]byte, error)
1. GatewayRoute.MarshalJSON() ([]byte, error)
1. ManagedServiceIdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error)
1. ServiceTagInformation.MarshalJSON() ([]byte, error)
1. ServiceTagInformationPropertiesFormat.MarshalJSON() ([]byte, error)
1. ServiceTagsListResult.MarshalJSON() ([]byte, error)
1. TunnelConnectionHealth.MarshalJSON() ([]byte, error)
1. VirtualNetworkUsage.MarshalJSON() ([]byte, error)
1. VirtualNetworkUsageName.MarshalJSON() ([]byte, error)
1. VpnClientConnectionHealthDetail.MarshalJSON() ([]byte, error)
1. VpnSiteID.MarshalJSON() ([]byte, error)
1. WebApplicationFirewallPolicyListResult.MarshalJSON() ([]byte, error)

View File

@@ -0,0 +1,11 @@
{
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
"readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md",
"tag": "package-2019-06",
"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-2019-06 --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/network/resource-manager/readme.md",
"additional_properties": {
"additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION"
}
}

View File

@@ -1,18 +1,11 @@
Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/resources/resource-manager/readme.md tag: `package-resources-2017-05`
Code generator @microsoft.azure/autorest.go@2.1.178
# Change History
## Additive Changes
### New Funcs
1. *CreateOrUpdateByIDFuture.UnmarshalJSON([]byte) error
1. *CreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DeleteByIDFuture.UnmarshalJSON([]byte) error
1. *DeleteFuture.UnmarshalJSON([]byte) error
1. *DeploymentsCreateOrUpdateFuture.UnmarshalJSON([]byte) error
1. *DeploymentsDeleteFuture.UnmarshalJSON([]byte) error
1. *GroupsDeleteFuture.UnmarshalJSON([]byte) error
1. *MoveResourcesFuture.UnmarshalJSON([]byte) error
1. *UpdateByIDFuture.UnmarshalJSON([]byte) error
1. *UpdateFuture.UnmarshalJSON([]byte) error
1. *ValidateMoveResourcesFuture.UnmarshalJSON([]byte) error
1. DeploymentOperationProperties.MarshalJSON() ([]byte, error)
1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error)
1. ErrorResponse.MarshalJSON() ([]byte, error)
1. GroupProperties.MarshalJSON() ([]byte, error)
1. ManagementErrorWithDetails.MarshalJSON() ([]byte, error)

View File

@@ -0,0 +1,11 @@
{
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
"readme": "/_/azure-rest-api-specs/specification/resources/resource-manager/readme.md",
"tag": "package-resources-2017-05",
"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-resources-2017-05 --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/resources/resource-manager/readme.md",
"additional_properties": {
"additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION"
}
}

View File

@@ -80,6 +80,7 @@ func (future *CreateOrUpdateByIDFuture) result(client Client) (gr GenericResourc
return
}
if !done {
gr.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture")
return
}
@@ -122,6 +123,7 @@ func (future *CreateOrUpdateFuture) result(client Client) (gr GenericResource, e
return
}
if !done {
gr.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture")
return
}
@@ -169,6 +171,7 @@ func (future *DeleteByIDFuture) result(client Client) (ar autorest.Response, err
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture")
return
}
@@ -204,6 +207,7 @@ func (future *DeleteFuture) result(client Client) (ar autorest.Response, err err
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.DeleteFuture")
return
}
@@ -473,6 +477,12 @@ type DeploymentOperationProperties struct {
Response *HTTPMessage `json:"response,omitempty"`
}
// MarshalJSON is the custom marshaler for DeploymentOperationProperties.
func (dop DeploymentOperationProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DeploymentOperationsListResult list of deployment operations.
type DeploymentOperationsListResult struct {
autorest.Response `json:"-"`
@@ -748,6 +758,7 @@ func (future *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient)
return
}
if !done {
de.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture")
return
}
@@ -790,6 +801,7 @@ func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar auto
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture")
return
}
@@ -814,6 +826,12 @@ type ErrorAdditionalInfo struct {
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 common error response for all Azure Resource Manager APIs to return error details for
// failed operations. (This also follows the OData error response format.)
type ErrorResponse struct {
@@ -829,6 +847,12 @@ type ErrorResponse struct {
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)
}
// ExportTemplateRequest export resource group template request parameters.
type ExportTemplateRequest struct {
// ResourcesProperty - The IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'.
@@ -1223,6 +1247,12 @@ type GroupProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// MarshalJSON is the custom marshaler for GroupProperties.
func (gp GroupProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type GroupsDeleteFuture struct {
azure.FutureAPI
@@ -1251,6 +1281,7 @@ func (future *GroupsDeleteFuture) result(client GroupsClient) (ar autorest.Respo
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture")
return
}
@@ -1463,6 +1494,12 @@ type ManagementErrorWithDetails struct {
Details *[]ManagementErrorWithDetails `json:"details,omitempty"`
}
// MarshalJSON is the custom marshaler for ManagementErrorWithDetails.
func (mewd ManagementErrorWithDetails) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// MoveInfo parameters of move resources.
type MoveInfo struct {
// ResourcesProperty - The IDs of the resources.
@@ -1500,6 +1537,7 @@ func (future *MoveResourcesFuture) result(client Client) (ar autorest.Response,
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture")
return
}
@@ -2099,6 +2137,7 @@ func (future *UpdateByIDFuture) result(client Client) (gr GenericResource, err e
return
}
if !done {
gr.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture")
return
}
@@ -2140,6 +2179,7 @@ func (future *UpdateFuture) result(client Client) (gr GenericResource, err error
return
}
if !done {
gr.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.UpdateFuture")
return
}
@@ -2182,6 +2222,7 @@ func (future *ValidateMoveResourcesFuture) result(client Client) (ar autorest.Re
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture")
return
}

View File

@@ -1,10 +1,36 @@
Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/storage/resource-manager/readme.md tag: `package-2019-06`
Code generator @microsoft.azure/autorest.go@2.1.178
# Change History
## Additive Changes
### New Funcs
1. *AccountsCreateFuture.UnmarshalJSON([]byte) error
1. *AccountsFailoverFuture.UnmarshalJSON([]byte) error
1. *AccountsRestoreBlobRangesFuture.UnmarshalJSON([]byte) error
1. AccountInternetEndpoints.MarshalJSON() ([]byte, error)
1. AccountKey.MarshalJSON() ([]byte, error)
1. AccountListKeysResult.MarshalJSON() ([]byte, error)
1. AccountListResult.MarshalJSON() ([]byte, error)
1. AccountMicrosoftEndpoints.MarshalJSON() ([]byte, error)
1. AzureEntityResource.MarshalJSON() ([]byte, error)
1. BlobRestoreStatus.MarshalJSON() ([]byte, error)
1. BlobServiceItems.MarshalJSON() ([]byte, error)
1. CheckNameAvailabilityResult.MarshalJSON() ([]byte, error)
1. EncryptionScopeListResult.MarshalJSON() ([]byte, error)
1. FileServiceItems.MarshalJSON() ([]byte, error)
1. FileShareItems.MarshalJSON() ([]byte, error)
1. GeoReplicationStats.MarshalJSON() ([]byte, error)
1. ListAccountSasResponse.MarshalJSON() ([]byte, error)
1. ListContainerItems.MarshalJSON() ([]byte, error)
1. ListQueueResource.MarshalJSON() ([]byte, error)
1. ListQueueServices.MarshalJSON() ([]byte, error)
1. ListServiceSasResponse.MarshalJSON() ([]byte, error)
1. ListTableResource.MarshalJSON() ([]byte, error)
1. ListTableServices.MarshalJSON() ([]byte, error)
1. PrivateEndpoint.MarshalJSON() ([]byte, error)
1. ProxyResource.MarshalJSON() ([]byte, error)
1. Resource.MarshalJSON() ([]byte, error)
1. SKUCapability.MarshalJSON() ([]byte, error)
1. SkuListResult.MarshalJSON() ([]byte, error)
1. TableProperties.MarshalJSON() ([]byte, error)
1. TagProperty.MarshalJSON() ([]byte, error)
1. UpdateHistoryProperty.MarshalJSON() ([]byte, error)
1. Usage.MarshalJSON() ([]byte, error)
1. UsageName.MarshalJSON() ([]byte, error)

View File

@@ -0,0 +1,11 @@
{
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
"readme": "/_/azure-rest-api-specs/specification/storage/resource-manager/readme.md",
"tag": "package-2019-06",
"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-2019-06 --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/storage/resource-manager/readme.md",
"additional_properties": {
"additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION"
}
}

View File

@@ -288,6 +288,12 @@ type AccountInternetEndpoints struct {
Dfs *string `json:"dfs,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountInternetEndpoints.
func (aie AccountInternetEndpoints) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AccountKey an access key for the storage account.
type AccountKey struct {
// KeyName - READ-ONLY; Name of the key.
@@ -298,6 +304,12 @@ type AccountKey struct {
Permissions KeyPermission `json:"permissions,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountKey.
func (ak AccountKey) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AccountListKeysResult the response from the ListKeys operation.
type AccountListKeysResult struct {
autorest.Response `json:"-"`
@@ -305,6 +317,12 @@ type AccountListKeysResult struct {
Keys *[]AccountKey `json:"keys,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountListKeysResult.
func (alkr AccountListKeysResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AccountListResult the response from the List Storage Accounts operation.
type AccountListResult struct {
autorest.Response `json:"-"`
@@ -314,6 +332,12 @@ type AccountListResult struct {
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountListResult.
func (alr AccountListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AccountListResultIterator provides access to a complete listing of Account values.
type AccountListResultIterator struct {
i int
@@ -481,6 +505,12 @@ type AccountMicrosoftEndpoints struct {
Dfs *string `json:"dfs,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountMicrosoftEndpoints.
func (ame AccountMicrosoftEndpoints) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AccountProperties properties of the storage account.
type AccountProperties struct {
// ProvisioningState - READ-ONLY; Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'
@@ -665,6 +695,7 @@ func (future *AccountsCreateFuture) result(client AccountsClient) (a Account, er
return
}
if !done {
a.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture")
return
}
@@ -707,6 +738,7 @@ func (future *AccountsFailoverFuture) result(client AccountsClient) (ar autorest
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storage.AccountsFailoverFuture")
return
}
@@ -743,6 +775,7 @@ func (future *AccountsRestoreBlobRangesFuture) result(client AccountsClient) (br
return
}
if !done {
brs.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storage.AccountsRestoreBlobRangesFuture")
return
}
@@ -880,6 +913,12 @@ type AzureEntityResource struct {
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for AzureEntityResource.
func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AzureFilesIdentityBasedAuthentication settings for Azure Files identity based authentication.
type AzureFilesIdentityBasedAuthentication struct {
// DirectoryServiceOptions - Indicates the directory service used. Possible values include: 'DirectoryServiceOptionsNone', 'DirectoryServiceOptionsAADDS', 'DirectoryServiceOptionsAD'
@@ -1001,6 +1040,12 @@ type BlobRestoreStatus struct {
Parameters *BlobRestoreParameters `json:"parameters,omitempty"`
}
// MarshalJSON is the custom marshaler for BlobRestoreStatus.
func (brs BlobRestoreStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BlobServiceItems ...
type BlobServiceItems struct {
autorest.Response `json:"-"`
@@ -1008,6 +1053,12 @@ type BlobServiceItems struct {
Value *[]BlobServiceProperties `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for BlobServiceItems.
func (bsi BlobServiceItems) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BlobServiceProperties the properties of a storage accounts Blob service.
type BlobServiceProperties struct {
autorest.Response `json:"-"`
@@ -1129,6 +1180,12 @@ type CheckNameAvailabilityResult struct {
Message *string `json:"message,omitempty"`
}
// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult.
func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CloudError an error response from the Storage service.
type CloudError struct {
Error *CloudErrorBody `json:"error,omitempty"`
@@ -1366,6 +1423,12 @@ type EncryptionScopeListResult struct {
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for EncryptionScopeListResult.
func (eslr EncryptionScopeListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// EncryptionScopeListResultIterator provides access to a complete listing of EncryptionScope values.
type EncryptionScopeListResultIterator struct {
i int
@@ -1627,6 +1690,12 @@ type FileServiceItems struct {
Value *[]FileServiceProperties `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for FileServiceItems.
func (fsi FileServiceItems) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// FileServiceProperties the properties of File services in storage account.
type FileServiceProperties struct {
autorest.Response `json:"-"`
@@ -1896,6 +1965,12 @@ type FileShareItems struct {
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for FileShareItems.
func (fsi FileShareItems) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// FileShareItemsIterator provides access to a complete listing of FileShareItem values.
type FileShareItemsIterator struct {
i int
@@ -2108,6 +2183,12 @@ type GeoReplicationStats struct {
CanFailover *bool `json:"canFailover,omitempty"`
}
// MarshalJSON is the custom marshaler for GeoReplicationStats.
func (grs GeoReplicationStats) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Identity identity for the resource.
type Identity struct {
// PrincipalID - READ-ONLY; The principal ID of resource identity.
@@ -2397,6 +2478,12 @@ type ListAccountSasResponse struct {
AccountSasToken *string `json:"accountSasToken,omitempty"`
}
// MarshalJSON is the custom marshaler for ListAccountSasResponse.
func (lasr ListAccountSasResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListContainerItem the blob container properties be listed out.
type ListContainerItem struct {
// ContainerProperties - The blob container properties be listed out.
@@ -2490,6 +2577,12 @@ type ListContainerItems struct {
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for ListContainerItems.
func (lci ListContainerItems) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListContainerItemsIterator provides access to a complete listing of ListContainerItem values.
type ListContainerItemsIterator struct {
i int
@@ -2736,6 +2829,12 @@ type ListQueueResource struct {
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for ListQueueResource.
func (lqr ListQueueResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListQueueResourceIterator provides access to a complete listing of ListQueue values.
type ListQueueResourceIterator struct {
i int
@@ -2893,6 +2992,12 @@ type ListQueueServices struct {
Value *[]QueueServiceProperties `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for ListQueueServices.
func (lqs ListQueueServices) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListServiceSasResponse the List service SAS credentials operation response.
type ListServiceSasResponse struct {
autorest.Response `json:"-"`
@@ -2900,6 +3005,12 @@ type ListServiceSasResponse struct {
ServiceSasToken *string `json:"serviceSasToken,omitempty"`
}
// MarshalJSON is the custom marshaler for ListServiceSasResponse.
func (lssr ListServiceSasResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListTableResource response schema. Contains list of tables returned
type ListTableResource struct {
autorest.Response `json:"-"`
@@ -2909,6 +3020,12 @@ type ListTableResource struct {
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for ListTableResource.
func (ltr ListTableResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListTableResourceIterator provides access to a complete listing of Table values.
type ListTableResourceIterator struct {
i int
@@ -3066,6 +3183,12 @@ type ListTableServices struct {
Value *[]TableServiceProperties `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for ListTableServices.
func (lts ListTableServices) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ManagementPolicy the Get Storage Account ManagementPolicies operation response.
type ManagementPolicy struct {
autorest.Response `json:"-"`
@@ -3498,6 +3621,12 @@ type PrivateEndpoint struct {
ID *string `json:"id,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpoint.
func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PrivateEndpointConnection the Private Endpoint Connection resource.
type PrivateEndpointConnection struct {
autorest.Response `json:"-"`
@@ -3709,6 +3838,12 @@ type ProxyResource struct {
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)
}
// Queue ...
type Queue struct {
autorest.Response `json:"-"`
@@ -3888,6 +4023,12 @@ type Resource struct {
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)
}
// RestorePolicyProperties the blob service properties for blob restore policy
type RestorePolicyProperties struct {
// Enabled - Blob restore is enabled if set to true.
@@ -4005,6 +4146,12 @@ type SKUCapability struct {
Value *string `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for SKUCapability.
func (sc SKUCapability) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// SkuInformation storage SKU and its properties
type SkuInformation struct {
// Name - Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS', 'PremiumZRS', 'StandardGZRS', 'StandardRAGZRS'
@@ -4045,6 +4192,12 @@ type SkuListResult struct {
Value *[]SkuInformation `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for SkuListResult.
func (slr SkuListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Table properties of the table, including Id, resource name, resource type.
type Table struct {
autorest.Response `json:"-"`
@@ -4124,6 +4277,12 @@ type TableProperties struct {
TableName *string `json:"tableName,omitempty"`
}
// MarshalJSON is the custom marshaler for TableProperties.
func (tp TableProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// TableServiceProperties the properties of a storage accounts Table service.
type TableServiceProperties struct {
autorest.Response `json:"-"`
@@ -4227,6 +4386,12 @@ type TagProperty struct {
Upn *string `json:"upn,omitempty"`
}
// MarshalJSON is the custom marshaler for TagProperty.
func (tp TagProperty) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
// which has 'tags' and a 'location'
type TrackedResource struct {
@@ -4270,6 +4435,12 @@ type UpdateHistoryProperty struct {
Upn *string `json:"upn,omitempty"`
}
// MarshalJSON is the custom marshaler for UpdateHistoryProperty.
func (uhp UpdateHistoryProperty) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Usage describes Storage Resource Usage.
type Usage struct {
// Unit - READ-ONLY; Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'
@@ -4282,6 +4453,12 @@ type Usage struct {
Name *UsageName `json:"name,omitempty"`
}
// MarshalJSON is the custom marshaler for Usage.
func (u Usage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// UsageListResult the response from the List Usages operation.
type UsageListResult struct {
autorest.Response `json:"-"`
@@ -4297,6 +4474,12 @@ type UsageName struct {
LocalizedValue *string `json:"localizedValue,omitempty"`
}
// MarshalJSON is the custom marshaler for UsageName.
func (un UsageName) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// VirtualNetworkRule virtual Network rule.
type VirtualNetworkRule struct {
// VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.

View File

@@ -107,7 +107,7 @@ func (ds *DefaultSender) Send(c *Client, req *http.Request) (resp *http.Response
return resp, err
}
resp, err = c.HTTPClient.Do(rr.Request())
if err != nil || !autorest.ResponseHasStatusCode(resp, ds.ValidStatusCodes...) {
if err == nil && !autorest.ResponseHasStatusCode(resp, ds.ValidStatusCodes...) {
return resp, err
}
drainRespBody(resp)
@@ -953,8 +953,10 @@ func readAndCloseBody(body io.ReadCloser) ([]byte, error) {
// reads the response body then closes it
func drainRespBody(resp *http.Response) {
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
if resp != nil {
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
}
}
func serviceErrFromXML(body []byte, storageErr *AzureStorageServiceError) error {

View File

@@ -1,21 +1,7 @@
package version
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Number contains the semantic version of this SDK.
const Number = "v53.1.0"
const Number = "v55.0.0"

View File

@@ -6,6 +6,7 @@ require (
github.com/Azure/go-autorest v14.2.0+incompatible
github.com/Azure/go-autorest/autorest/date v0.3.0
github.com/Azure/go-autorest/autorest/mocks v0.4.1
github.com/Azure/go-autorest/logger v0.2.1
github.com/Azure/go-autorest/tracing v0.6.0
github.com/form3tech-oss/jwt-go v3.2.2+incompatible
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0

View File

@@ -4,6 +4,8 @@ github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8K
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=

View File

@@ -28,6 +28,7 @@ const (
mimeTypeFormPost = "application/x-www-form-urlencoded"
)
// DO NOT ACCESS THIS DIRECTLY. go through sender()
var defaultSender Sender
var defaultSenderInit = &sync.Once{}

View File

@@ -36,6 +36,7 @@ import (
"time"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/logger"
"github.com/form3tech-oss/jwt-go"
)
@@ -70,13 +71,13 @@ const (
defaultMaxMSIRefreshAttempts = 5
// asMSIEndpointEnv is the environment variable used to store the endpoint on App Service and Functions
asMSIEndpointEnv = "MSI_ENDPOINT"
msiEndpointEnv = "MSI_ENDPOINT"
// asMSISecretEnv is the environment variable used to store the request secret on App Service and Functions
asMSISecretEnv = "MSI_SECRET"
msiSecretEnv = "MSI_SECRET"
// the API version to use for the App Service MSI endpoint
appServiceAPIVersion = "2017-09-01"
// the API version to use for the legacy App Service MSI endpoint
appServiceAPIVersion2017 = "2017-09-01"
// secret header used when authenticating against app service MSI endpoint
secretHeader = "Secret"
@@ -292,6 +293,8 @@ func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) {
// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension.
type ServicePrincipalMSISecret struct {
msiType msiType
clientResourceID string
}
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
@@ -662,96 +665,173 @@ func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clie
)
}
type msiType int
const (
msiTypeUnavailable msiType = iota
msiTypeAppServiceV20170901
msiTypeCloudShell
msiTypeIMDS
)
func (m msiType) String() string {
switch m {
case msiTypeUnavailable:
return "unavailable"
case msiTypeAppServiceV20170901:
return "AppServiceV20170901"
case msiTypeCloudShell:
return "CloudShell"
case msiTypeIMDS:
return "IMDS"
default:
return fmt.Sprintf("unhandled MSI type %d", m)
}
}
// returns the MSI type and endpoint, or an error
func getMSIType() (msiType, string, error) {
if endpointEnvVar := os.Getenv(msiEndpointEnv); endpointEnvVar != "" {
// if the env var MSI_ENDPOINT is set
if secretEnvVar := os.Getenv(msiSecretEnv); secretEnvVar != "" {
// if BOTH the env vars MSI_ENDPOINT and MSI_SECRET are set the msiType is AppService
return msiTypeAppServiceV20170901, endpointEnvVar, nil
}
// if ONLY the env var MSI_ENDPOINT is set the msiType is CloudShell
return msiTypeCloudShell, endpointEnvVar, nil
} else if msiAvailableHook(context.Background(), sender()) {
// if MSI_ENDPOINT is NOT set AND the IMDS endpoint is available the msiType is IMDS. This will timeout after 500 milliseconds
return msiTypeIMDS, msiEndpoint, nil
} else {
// if MSI_ENDPOINT is NOT set and IMDS endpoint is not available Managed Identity is not available
return msiTypeUnavailable, "", errors.New("MSI not available")
}
}
// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines.
// NOTE: this always returns the IMDS endpoint, it does not work for app services or cloud shell.
// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint.
func GetMSIVMEndpoint() (string, error) {
return msiEndpoint, nil
}
// NOTE: this only indicates if the ASE environment credentials have been set
// which does not necessarily mean that the caller is authenticating via ASE!
func isAppService() bool {
_, asMSIEndpointEnvExists := os.LookupEnv(asMSIEndpointEnv)
_, asMSISecretEnvExists := os.LookupEnv(asMSISecretEnv)
return asMSIEndpointEnvExists && asMSISecretEnvExists
}
// GetMSIAppServiceEndpoint get the MSI endpoint for App Service and Functions
// GetMSIAppServiceEndpoint get the MSI endpoint for App Service and Functions.
// It will return an error when not running in an app service/functions environment.
// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint.
func GetMSIAppServiceEndpoint() (string, error) {
asMSIEndpoint, asMSIEndpointEnvExists := os.LookupEnv(asMSIEndpointEnv)
if asMSIEndpointEnvExists {
return asMSIEndpoint, nil
msiType, endpoint, err := getMSIType()
if err != nil {
return "", err
}
switch msiType {
case msiTypeAppServiceV20170901:
return endpoint, nil
default:
return "", fmt.Errorf("%s is not app service environment", msiType)
}
return "", errors.New("MSI endpoint not found")
}
// GetMSIEndpoint get the appropriate MSI endpoint depending on the runtime environment
// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint.
func GetMSIEndpoint() (string, error) {
if isAppService() {
return GetMSIAppServiceEndpoint()
}
return GetMSIVMEndpoint()
_, endpoint, err := getMSIType()
return endpoint, err
}
// NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension.
// It will use the system assigned identity when creating the token.
// msiEndpoint - empty string, or pass a non-empty string to override the default value.
// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead.
func NewServicePrincipalTokenFromMSI(msiEndpoint, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
return newServicePrincipalTokenFromMSI(msiEndpoint, resource, nil, nil, callbacks...)
return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", "", callbacks...)
}
// NewServicePrincipalTokenFromMSIWithUserAssignedID creates a ServicePrincipalToken via the MSI VM Extension.
// It will use the clientID of specified user assigned identity when creating the token.
// msiEndpoint - empty string, or pass a non-empty string to override the default value.
// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead.
func NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, resource string, userAssignedID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
return newServicePrincipalTokenFromMSI(msiEndpoint, resource, &userAssignedID, nil, callbacks...)
if err := validateStringParam(userAssignedID, "userAssignedID"); err != nil {
return nil, err
}
return newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, "", callbacks...)
}
// NewServicePrincipalTokenFromMSIWithIdentityResourceID creates a ServicePrincipalToken via the MSI VM Extension.
// It will use the azure resource id of user assigned identity when creating the token.
// msiEndpoint - empty string, or pass a non-empty string to override the default value.
// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead.
func NewServicePrincipalTokenFromMSIWithIdentityResourceID(msiEndpoint, resource string, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
return newServicePrincipalTokenFromMSI(msiEndpoint, resource, nil, &identityResourceID, callbacks...)
}
func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedID *string, identityResourceID *string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
if err := validateStringParam(msiEndpoint, "msiEndpoint"); err != nil {
if err := validateStringParam(identityResourceID, "identityResourceID"); err != nil {
return nil, err
}
return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", identityResourceID, callbacks...)
}
// ManagedIdentityOptions contains optional values for configuring managed identity authentication.
type ManagedIdentityOptions struct {
// ClientID is the user-assigned identity to use during authentication.
// It is mutually exclusive with IdentityResourceID.
ClientID string
// IdentityResourceID is the resource ID of the user-assigned identity to use during authentication.
// It is mutually exclusive with ClientID.
IdentityResourceID string
}
// NewServicePrincipalTokenFromManagedIdentity creates a ServicePrincipalToken using a managed identity.
// It supports the following managed identity environments.
// - App Service Environment (API version 2017-09-01 only)
// - Cloud shell
// - IMDS with a system or user assigned identity
func NewServicePrincipalTokenFromManagedIdentity(resource string, options *ManagedIdentityOptions, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
if options == nil {
options = &ManagedIdentityOptions{}
}
return newServicePrincipalTokenFromMSI("", resource, options.ClientID, options.IdentityResourceID, callbacks...)
}
func newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
if err := validateStringParam(resource, "resource"); err != nil {
return nil, err
}
if userAssignedID != nil {
if err := validateStringParam(*userAssignedID, "userAssignedID"); err != nil {
return nil, err
}
if userAssignedID != "" && identityResourceID != "" {
return nil, errors.New("cannot specify userAssignedID and identityResourceID")
}
if identityResourceID != nil {
if err := validateStringParam(*identityResourceID, "identityResourceID"); err != nil {
return nil, err
}
msiType, endpoint, err := getMSIType()
if err != nil {
logger.Instance.Writef(logger.LogError, "Error determining managed identity environment: %v", err)
return nil, err
}
// We set the oauth config token endpoint to be MSI's endpoint
msiEndpointURL, err := url.Parse(msiEndpoint)
logger.Instance.Writef(logger.LogInfo, "Managed identity environment is %s, endpoint is %s", msiType, endpoint)
if msiEndpoint != "" {
endpoint = msiEndpoint
logger.Instance.Writef(logger.LogInfo, "Managed identity custom endpoint is %s", endpoint)
}
msiEndpointURL, err := url.Parse(endpoint)
if err != nil {
return nil, err
}
v := url.Values{}
v.Set("resource", resource)
// we only support token API version 2017-09-01 for app services
clientIDParam := "client_id"
if isASEEndpoint(*msiEndpointURL) {
v.Set("api-version", appServiceAPIVersion)
clientIDParam = "clientid"
} else {
v.Set("api-version", msiAPIVersion)
// cloud shell sends its data in the request body
if msiType != msiTypeCloudShell {
v := url.Values{}
v.Set("resource", resource)
clientIDParam := "client_id"
switch msiType {
case msiTypeAppServiceV20170901:
clientIDParam = "clientid"
v.Set("api-version", appServiceAPIVersion2017)
break
case msiTypeIMDS:
v.Set("api-version", msiAPIVersion)
}
if userAssignedID != "" {
v.Set(clientIDParam, userAssignedID)
} else if identityResourceID != "" {
v.Set("mi_res_id", identityResourceID)
}
msiEndpointURL.RawQuery = v.Encode()
}
if userAssignedID != nil {
v.Set(clientIDParam, *userAssignedID)
}
if identityResourceID != nil {
v.Set("mi_res_id", *identityResourceID)
}
msiEndpointURL.RawQuery = v.Encode()
spt := &ServicePrincipalToken{
inner: servicePrincipalToken{
@@ -759,10 +839,14 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI
OauthConfig: OAuthConfig{
TokenEndpoint: *msiEndpointURL,
},
Secret: &ServicePrincipalMSISecret{},
Secret: &ServicePrincipalMSISecret{
msiType: msiType,
clientResourceID: identityResourceID,
},
Resource: resource,
AutoRefresh: true,
RefreshWithin: defaultRefresh,
ClientID: userAssignedID,
},
refreshLock: &sync.RWMutex{},
sender: sender(),
@@ -770,10 +854,6 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI
MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts,
}
if userAssignedID != nil {
spt.inner.ClientID = *userAssignedID
}
return spt, nil
}
@@ -870,31 +950,6 @@ func (spt *ServicePrincipalToken) getGrantType() string {
}
}
func isIMDS(u url.URL) bool {
return isMSIEndpoint(u) == true || isASEEndpoint(u) == true
}
func isMSIEndpoint(endpoint url.URL) bool {
msi, err := url.Parse(msiEndpoint)
if err != nil {
return false
}
return endpoint.Host == msi.Host && endpoint.Path == msi.Path
}
func isASEEndpoint(endpoint url.URL) bool {
aseEndpoint, err := GetMSIAppServiceEndpoint()
if err != nil {
// app service environment isn't enabled
return false
}
ase, err := url.Parse(aseEndpoint)
if err != nil {
return false
}
return endpoint.Host == ase.Host && endpoint.Path == ase.Path
}
func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error {
if spt.customRefreshFunc != nil {
token, err := spt.customRefreshFunc(ctx, resource)
@@ -909,13 +964,40 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource
return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err)
}
req.Header.Add("User-Agent", UserAgent())
// Add header when runtime is on App Service or Functions
if isASEEndpoint(spt.inner.OauthConfig.TokenEndpoint) {
asMSISecret, _ := os.LookupEnv(asMSISecretEnv)
req.Header.Add(secretHeader, asMSISecret)
}
req = req.WithContext(ctx)
if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
var resp *http.Response
authBodyFilter := func(b []byte) []byte {
if logger.Level() != logger.LogAuth {
return []byte("**REDACTED** authentication body")
}
return b
}
if msiSecret, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok {
switch msiSecret.msiType {
case msiTypeAppServiceV20170901:
req.Method = http.MethodGet
req.Header.Set("secret", os.Getenv(msiSecretEnv))
break
case msiTypeCloudShell:
req.Header.Set("Metadata", "true")
data := url.Values{}
data.Set("resource", spt.inner.Resource)
if spt.inner.ClientID != "" {
data.Set("client_id", spt.inner.ClientID)
} else if msiSecret.clientResourceID != "" {
data.Set("msi_res_id", msiSecret.clientResourceID)
}
req.Body = ioutil.NopCloser(strings.NewReader(data.Encode()))
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
break
case msiTypeIMDS:
req.Method = http.MethodGet
req.Header.Set("Metadata", "true")
break
}
logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter})
resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts)
} else {
v := url.Values{}
v.Set("client_id", spt.inner.ClientID)
v.Set("resource", resource)
@@ -944,35 +1026,18 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource
req.ContentLength = int64(len(s))
req.Header.Set(contentType, mimeTypeFormPost)
req.Body = body
}
if _, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok {
req.Method = http.MethodGet
// the metadata header isn't applicable for ASE
if !isASEEndpoint(spt.inner.OauthConfig.TokenEndpoint) {
req.Header.Set(metadataHeader, "true")
}
}
var resp *http.Response
if isMSIEndpoint(spt.inner.OauthConfig.TokenEndpoint) {
resp, err = getMSIEndpoint(ctx, spt.sender)
if err != nil {
// return a TokenRefreshError here so that we don't keep retrying
return newTokenRefreshError(fmt.Sprintf("the MSI endpoint is not available. Failed HTTP request to MSI endpoint: %v", err), nil)
}
resp.Body.Close()
}
if isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts)
} else {
logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter})
resp, err = spt.sender.Do(req)
}
// don't return a TokenRefreshError here; this will allow retry logic to apply
if err != nil {
// don't return a TokenRefreshError here; this will allow retry logic to apply
return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err)
} else if resp == nil {
return fmt.Errorf("adal: received nil response and error")
}
logger.Instance.WriteResponse(resp, logger.Filter{Body: authBodyFilter})
defer resp.Body.Close()
rb, err := ioutil.ReadAll(resp.Body)
@@ -1264,3 +1329,8 @@ func MSIAvailable(ctx context.Context, sender Sender) bool {
}
return err == nil
}
// used for testing purposes
var msiAvailableHook = func(ctx context.Context, sender Sender) bool {
return MSIAvailable(ctx, sender)
}

View File

@@ -24,8 +24,6 @@ import (
)
func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) {
// this cannot fail, the return sig is due to legacy reasons
msiEndpoint, _ := GetMSIVMEndpoint()
tempCtx, cancel := context.WithTimeout(ctx, 500*time.Millisecond)
defer cancel()
// http.NewRequestWithContext() was added in Go 1.13

View File

@@ -23,8 +23,6 @@ import (
)
func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) {
// this cannot fail, the return sig is due to legacy reasons
msiEndpoint, _ := GetMSIVMEndpoint()
tempCtx, cancel := context.WithTimeout(ctx, 500*time.Millisecond)
defer cancel()
req, _ := http.NewRequest(http.MethodGet, msiEndpoint, nil)

View File

@@ -17,6 +17,7 @@ package autorest
import (
"bytes"
"crypto/tls"
"errors"
"fmt"
"io"
"io/ioutil"
@@ -260,6 +261,9 @@ func (c Client) Do(r *http.Request) (*http.Response, error) {
},
})
resp, err := SendWithSender(c.sender(tls.RenegotiateNever), r)
if resp == nil && err == nil {
err = errors.New("autorest: received nil response and error")
}
logger.Instance.WriteResponse(resp, logger.Filter{})
Respond(resp, c.ByInspecting())
return resp, err

View File

@@ -4,9 +4,9 @@ go 1.12
require (
github.com/Azure/go-autorest v14.2.0+incompatible
github.com/Azure/go-autorest/autorest/adal v0.9.5
github.com/Azure/go-autorest/autorest/adal v0.9.13
github.com/Azure/go-autorest/autorest/mocks v0.4.1
github.com/Azure/go-autorest/logger v0.2.0
github.com/Azure/go-autorest/logger v0.2.1
github.com/Azure/go-autorest/tracing v0.6.0
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
)

View File

@@ -1,13 +1,13 @@
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0=
github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A=
github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q=
github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE=
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=

View File

@@ -1,3 +1,5 @@
module github.com/Azure/go-autorest/autorest/to
go 1.12
require github.com/Azure/go-autorest v14.2.0+incompatible

View File

@@ -0,0 +1,2 @@
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=

View File

@@ -0,0 +1,24 @@
// +build modhack
package to
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file, and the github.com/Azure/go-autorest import, won't actually become part of
// the resultant binary.
// Necessary for safely adding multi-module repo.
// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
import _ "github.com/Azure/go-autorest"

View File

@@ -55,6 +55,10 @@ const (
// LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
LogDebug
// LogAuth is a special case of LogDebug, it tells a logger to also log the body of an authentication request and response.
// NOTE: this can disclose sensitive information, use with care.
LogAuth
)
const (
@@ -65,6 +69,7 @@ const (
logWarning = "WARNING"
logInfo = "INFO"
logDebug = "DEBUG"
logAuth = "AUTH"
logUnknown = "UNKNOWN"
)
@@ -83,6 +88,8 @@ func ParseLevel(s string) (lt LevelType, err error) {
lt = LogInfo
case logDebug:
lt = LogDebug
case logAuth:
lt = LogAuth
default:
err = fmt.Errorf("bad log level '%s'", s)
}
@@ -106,6 +113,8 @@ func (lt LevelType) String() string {
return logInfo
case LogDebug:
return logDebug
case LogAuth:
return logAuth
default:
return logUnknown
}