use vmss instance view expansion and azure-sdk v33.1.0
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
This commit is contained in:
parent
b7003211d5
commit
4fbdb08f98
4
go.mod
4
go.mod
@ -8,7 +8,7 @@ go 1.12
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690
|
bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690
|
||||||
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible
|
github.com/Azure/azure-sdk-for-go v33.1.0+incompatible
|
||||||
github.com/Azure/go-autorest/autorest v0.9.0
|
github.com/Azure/go-autorest/autorest v0.9.0
|
||||||
github.com/Azure/go-autorest/autorest/adal v0.5.0
|
github.com/Azure/go-autorest/autorest/adal v0.5.0
|
||||||
github.com/Azure/go-autorest/autorest/to v0.2.0
|
github.com/Azure/go-autorest/autorest/to v0.2.0
|
||||||
@ -176,7 +176,7 @@ require (
|
|||||||
replace (
|
replace (
|
||||||
bitbucket.org/bertimus9/systemstat => bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690
|
bitbucket.org/bertimus9/systemstat => bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690
|
||||||
cloud.google.com/go => cloud.google.com/go v0.38.0
|
cloud.google.com/go => cloud.google.com/go v0.38.0
|
||||||
github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v32.5.0+incompatible
|
github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v33.1.0+incompatible
|
||||||
github.com/Azure/go-ansiterm => github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
|
github.com/Azure/go-ansiterm => github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
|
||||||
github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.9.0
|
github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.9.0
|
||||||
github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.5.0
|
github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.5.0
|
||||||
|
4
go.sum
4
go.sum
@ -2,8 +2,8 @@ bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690 h1:N9r8OBS
|
|||||||
bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690/go.mod h1:Ulb78X89vxKYgdL24HMTiXYHlyHEvruOj1ZPlqeNEZM=
|
bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690/go.mod h1:Ulb78X89vxKYgdL24HMTiXYHlyHEvruOj1ZPlqeNEZM=
|
||||||
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
||||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible h1:Hn/DsObfmw0M7dMGS/c0MlVrJuGFzHzOpBWL89acR68=
|
github.com/Azure/azure-sdk-for-go v33.1.0+incompatible h1:OAEdTDI/pJ7ee7W7PtRsd6W5s4mzvxjn0WhBTCN5eZg=
|
||||||
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
github.com/Azure/azure-sdk-for-go v33.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
|
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||||
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
|
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
|
||||||
|
@ -106,8 +106,7 @@ type VirtualMachineScaleSetsClient interface {
|
|||||||
|
|
||||||
// VirtualMachineScaleSetVMsClient defines needed functions for azure compute.VirtualMachineScaleSetVMsClient
|
// VirtualMachineScaleSetVMsClient defines needed functions for azure compute.VirtualMachineScaleSetVMsClient
|
||||||
type VirtualMachineScaleSetVMsClient interface {
|
type VirtualMachineScaleSetVMsClient interface {
|
||||||
Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVM, err error)
|
Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (result compute.VirtualMachineScaleSetVM, err error)
|
||||||
GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMInstanceView, err error)
|
|
||||||
List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result []compute.VirtualMachineScaleSetVM, err error)
|
List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result []compute.VirtualMachineScaleSetVM, err error)
|
||||||
Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM, source string) (resp *http.Response, err error)
|
Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM, source string) (resp *http.Response, err error)
|
||||||
}
|
}
|
||||||
@ -1051,7 +1050,7 @@ func newAzVirtualMachineScaleSetVMsClient(config *azClientConfig) *azVirtualMach
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (az *azVirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVM, err error) {
|
func (az *azVirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (result compute.VirtualMachineScaleSetVM, err error) {
|
||||||
mc := newMetricContext("vmssvm", "get", resourceGroupName, az.client.SubscriptionID, "")
|
mc := newMetricContext("vmssvm", "get", resourceGroupName, az.client.SubscriptionID, "")
|
||||||
if !az.rateLimiterReader.TryAccept() {
|
if !az.rateLimiterReader.TryAccept() {
|
||||||
mc.RateLimitedCount()
|
mc.RateLimitedCount()
|
||||||
@ -1064,25 +1063,7 @@ func (az *azVirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGr
|
|||||||
klog.V(10).Infof("azVirtualMachineScaleSetVMsClient.Get(%q,%q,%q): end", resourceGroupName, VMScaleSetName, instanceID)
|
klog.V(10).Infof("azVirtualMachineScaleSetVMsClient.Get(%q,%q,%q): end", resourceGroupName, VMScaleSetName, instanceID)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
result, err = az.client.Get(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
result, err = az.client.Get(ctx, resourceGroupName, VMScaleSetName, instanceID, expand)
|
||||||
mc.Observe(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (az *azVirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMInstanceView, err error) {
|
|
||||||
mc := newMetricContext("vmssvm", "get_instance_view", resourceGroupName, az.client.SubscriptionID, "")
|
|
||||||
if !az.rateLimiterReader.TryAccept() {
|
|
||||||
mc.RateLimitedCount()
|
|
||||||
err = createRateLimitErr(false, "VMSSGetInstanceView")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
klog.V(10).Infof("azVirtualMachineScaleSetVMsClient.GetInstanceView(%q,%q,%q): start", resourceGroupName, VMScaleSetName, instanceID)
|
|
||||||
defer func() {
|
|
||||||
klog.V(10).Infof("azVirtualMachineScaleSetVMsClient.GetInstanceView(%q,%q,%q): end", resourceGroupName, VMScaleSetName, instanceID)
|
|
||||||
}()
|
|
||||||
|
|
||||||
result, err = az.client.GetInstanceView(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
|
||||||
mc.Observe(err)
|
mc.Observe(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -549,7 +549,7 @@ func (fVMC *fakeVirtualMachineScaleSetVMsClient) List(ctx context.Context, resou
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fVMC *fakeVirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVM, err error) {
|
func (fVMC *fakeVirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (result compute.VirtualMachineScaleSetVM, err error) {
|
||||||
fVMC.mutex.Lock()
|
fVMC.mutex.Lock()
|
||||||
defer fVMC.mutex.Unlock()
|
defer fVMC.mutex.Unlock()
|
||||||
|
|
||||||
@ -566,15 +566,6 @@ func (fVMC *fakeVirtualMachineScaleSetVMsClient) Get(ctx context.Context, resour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fVMC *fakeVirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMInstanceView, err error) {
|
|
||||||
_, err = fVMC.Get(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
|
||||||
if err != nil {
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (fVMC *fakeVirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM, source string) (resp *http.Response, err error) {
|
func (fVMC *fakeVirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM, source string) (resp *http.Response, err error) {
|
||||||
fVMC.mutex.Lock()
|
fVMC.mutex.Lock()
|
||||||
defer fVMC.mutex.Unlock()
|
defer fVMC.mutex.Unlock()
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
@ -189,7 +190,7 @@ func (ss *scaleSet) newVmssVMCache() (*timedCache, error) {
|
|||||||
|
|
||||||
ctx, cancel := getContextWithCancel()
|
ctx, cancel := getContextWithCancel()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
result, err := ss.VirtualMachineScaleSetVMsClient.Get(ctx, resourceGroup, ssName, instanceID)
|
result, err := ss.VirtualMachineScaleSetVMsClient.Get(ctx, resourceGroup, ssName, instanceID, compute.InstanceView)
|
||||||
exists, message, realErr := checkResourceExistsFromError(err)
|
exists, message, realErr := checkResourceExistsFromError(err)
|
||||||
if realErr != nil {
|
if realErr != nil {
|
||||||
return nil, realErr
|
return nil, realErr
|
||||||
@ -200,24 +201,6 @@ func (ss *scaleSet) newVmssVMCache() (*timedCache, error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get instanceView for vmssVM.
|
|
||||||
if result.InstanceView == nil {
|
|
||||||
viewCtx, viewCancel := getContextWithCancel()
|
|
||||||
defer viewCancel()
|
|
||||||
view, err := ss.VirtualMachineScaleSetVMsClient.GetInstanceView(viewCtx, resourceGroup, ssName, instanceID)
|
|
||||||
// It is possible that the vmssVM gets removed just before this call. So check whether the VM exist again.
|
|
||||||
exists, message, realErr = checkResourceExistsFromError(err)
|
|
||||||
if realErr != nil {
|
|
||||||
return nil, realErr
|
|
||||||
}
|
|
||||||
if !exists {
|
|
||||||
klog.V(2).Infof("Virtual machine scale set VM %q not found with message: %q", key, message)
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
result.InstanceView = &view
|
|
||||||
}
|
|
||||||
|
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ go 1.12
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.38.0
|
cloud.google.com/go v0.38.0
|
||||||
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible
|
github.com/Azure/azure-sdk-for-go v33.1.0+incompatible
|
||||||
github.com/Azure/go-autorest/autorest v0.9.0
|
github.com/Azure/go-autorest/autorest v0.9.0
|
||||||
github.com/Azure/go-autorest/autorest/adal v0.5.0
|
github.com/Azure/go-autorest/autorest/adal v0.5.0
|
||||||
github.com/Azure/go-autorest/autorest/to v0.2.0
|
github.com/Azure/go-autorest/autorest/to v0.2.0
|
||||||
|
4
staging/src/k8s.io/legacy-cloud-providers/go.sum
generated
4
staging/src/k8s.io/legacy-cloud-providers/go.sum
generated
@ -3,8 +3,8 @@ cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
|||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
||||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible h1:Hn/DsObfmw0M7dMGS/c0MlVrJuGFzHzOpBWL89acR68=
|
github.com/Azure/azure-sdk-for-go v33.1.0+incompatible h1:OAEdTDI/pJ7ee7W7PtRsd6W5s4mzvxjn0WhBTCN5eZg=
|
||||||
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
github.com/Azure/azure-sdk-for-go v33.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||||
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
|
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
|
||||||
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
|
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
|
||||||
|
@ -10,6 +10,8 @@ go_library(
|
|||||||
"dedicatedhosts.go",
|
"dedicatedhosts.go",
|
||||||
"disks.go",
|
"disks.go",
|
||||||
"galleries.go",
|
"galleries.go",
|
||||||
|
"galleryapplications.go",
|
||||||
|
"galleryapplicationversions.go",
|
||||||
"galleryimages.go",
|
"galleryimages.go",
|
||||||
"galleryimageversions.go",
|
"galleryimageversions.go",
|
||||||
"images.go",
|
"images.go",
|
||||||
|
@ -95,7 +95,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName str
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -341,7 +341,7 @@ func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroup
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -422,7 +422,7 @@ func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, erro
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -535,7 +535,7 @@ func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resou
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -645,7 +645,7 @@ func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGrou
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -724,7 +724,7 @@ func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
|
401
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplications.go
generated
vendored
Normal file
401
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplications.go
generated
vendored
Normal file
@ -0,0 +1,401 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||||
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/Azure/go-autorest/autorest"
|
||||||
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
"github.com/Azure/go-autorest/tracing"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GalleryApplicationsClient is the compute Client
|
||||||
|
type GalleryApplicationsClient struct {
|
||||||
|
BaseClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGalleryApplicationsClient creates an instance of the GalleryApplicationsClient client.
|
||||||
|
func NewGalleryApplicationsClient(subscriptionID string) GalleryApplicationsClient {
|
||||||
|
return NewGalleryApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGalleryApplicationsClientWithBaseURI creates an instance of the GalleryApplicationsClient client.
|
||||||
|
func NewGalleryApplicationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationsClient {
|
||||||
|
return GalleryApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdate create or update a gallery Application Definition.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be
|
||||||
|
// created.
|
||||||
|
// galleryApplicationName - the name of the gallery Application Definition to be created or updated. The
|
||||||
|
// allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The
|
||||||
|
// maximum length is 80 characters.
|
||||||
|
// galleryApplication - parameters supplied to the create or update gallery Application operation.
|
||||||
|
func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (result GalleryApplicationsCreateOrUpdateFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.CreateOrUpdateSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||||
|
func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
|
autorest.AsPut(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters),
|
||||||
|
autorest.WithJSON(galleryApplication),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationsCreateOrUpdateFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete delete a gallery Application.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be
|
||||||
|
// deleted.
|
||||||
|
// galleryApplicationName - the name of the gallery Application Definition to be deleted.
|
||||||
|
func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationsDeleteFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.DeleteSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeletePreparer prepares the Delete request.
|
||||||
|
func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsDelete(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSender sends the Delete request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future GalleryApplicationsDeleteFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteResponder handles the response to the Delete request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves information about a gallery Application Definition.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery from which the Application Definitions are to be
|
||||||
|
// retrieved.
|
||||||
|
// galleryApplicationName - the name of the gallery Application Definition to be retrieved.
|
||||||
|
func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplication, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Get")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.GetResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPreparer prepares the Get request.
|
||||||
|
func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSender sends the Get request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetResponder handles the response to the Get request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGallery list gallery Application Definitions in a gallery.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery from which Application Definitions are to be
|
||||||
|
// listed.
|
||||||
|
func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListPage, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.gal.Response.Response != nil {
|
||||||
|
sc = result.gal.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
result.fn = client.listByGalleryNextResults
|
||||||
|
req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListByGallerySender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.gal.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.gal, err = client.ListByGalleryResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryPreparer prepares the ListByGallery request.
|
||||||
|
func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-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.Compute/galleries/{galleryName}/applications", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGallerySender sends the ListByGallery request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryResponder handles the response to the ListByGallery request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// listByGalleryNextResults retrieves the next set of results, if any.
|
||||||
|
func (client GalleryApplicationsClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryApplicationList) (result GalleryApplicationList, err error) {
|
||||||
|
req, err := lastResults.galleryApplicationListPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", nil, "Failure preparing next results request")
|
||||||
|
}
|
||||||
|
if req == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := client.ListByGallerySender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure sending next results request")
|
||||||
|
}
|
||||||
|
result, err = client.ListByGalleryResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure responding to next results request")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required.
|
||||||
|
func (client GalleryApplicationsClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListIterator, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery")
|
||||||
|
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.ListByGallery(ctx, resourceGroupName, galleryName)
|
||||||
|
return
|
||||||
|
}
|
428
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplicationversions.go
generated
vendored
Normal file
428
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplicationversions.go
generated
vendored
Normal file
@ -0,0 +1,428 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||||
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/Azure/go-autorest/autorest"
|
||||||
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
"github.com/Azure/go-autorest/autorest/validation"
|
||||||
|
"github.com/Azure/go-autorest/tracing"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GalleryApplicationVersionsClient is the compute Client
|
||||||
|
type GalleryApplicationVersionsClient struct {
|
||||||
|
BaseClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client.
|
||||||
|
func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient {
|
||||||
|
return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client.
|
||||||
|
func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient {
|
||||||
|
return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdate create or update a gallery Application Version.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery in which the Application Definition resides.
|
||||||
|
// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is
|
||||||
|
// to be created.
|
||||||
|
// galleryApplicationVersionName - the name of the gallery Application Version to be created. Needs to follow
|
||||||
|
// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range
|
||||||
|
// of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>
|
||||||
|
// galleryApplicationVersion - parameters supplied to the create or update gallery Application Version
|
||||||
|
// operation.
|
||||||
|
func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: galleryApplicationVersion,
|
||||||
|
Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false,
|
||||||
|
Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true,
|
||||||
|
Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true,
|
||||||
|
Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.FileName", Name: validation.Null, Rule: true, Chain: nil},
|
||||||
|
{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil},
|
||||||
|
}},
|
||||||
|
}},
|
||||||
|
}}}}}); err != nil {
|
||||||
|
return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.CreateOrUpdateSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||||
|
func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
|
autorest.AsPut(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters),
|
||||||
|
autorest.WithJSON(galleryApplicationVersion),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete delete a gallery Application Version.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery in which the Application Definition resides.
|
||||||
|
// galleryApplicationName - the name of the gallery Application Definition in which the Application Version
|
||||||
|
// resides.
|
||||||
|
// galleryApplicationVersionName - the name of the gallery Application Version to be deleted.
|
||||||
|
func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.DeleteSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeletePreparer prepares the Delete request.
|
||||||
|
func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsDelete(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSender sends the Delete request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteResponder handles the response to the Delete request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves information about a gallery Application Version.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery in which the Application Definition resides.
|
||||||
|
// galleryApplicationName - the name of the gallery Application Definition in which the Application Version
|
||||||
|
// resides.
|
||||||
|
// galleryApplicationVersionName - the name of the gallery Application Version to be retrieved.
|
||||||
|
// expand - the expand expression to apply on the operation.
|
||||||
|
func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.GetResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPreparer prepares the Get request.
|
||||||
|
func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
if len(string(expand)) > 0 {
|
||||||
|
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSender sends the Get request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetResponder handles the response to the Get request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// galleryName - the name of the Shared Application Gallery in which the Application Definition resides.
|
||||||
|
// galleryApplicationName - the name of the Shared Application Gallery Application Definition from which the
|
||||||
|
// Application Versions are to be listed.
|
||||||
|
func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.gavl.Response.Response != nil {
|
||||||
|
sc = result.gavl.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
result.fn = client.listByGalleryApplicationNextResults
|
||||||
|
req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListByGalleryApplicationSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.gavl.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.gavl, err = client.ListByGalleryApplicationResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request.
|
||||||
|
func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"galleryApplicationName": autorest.Encode("path", galleryApplicationName),
|
||||||
|
"galleryName": autorest.Encode("path", galleryName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-07-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// listByGalleryApplicationNextResults retrieves the next set of results, if any.
|
||||||
|
func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) {
|
||||||
|
req, err := lastResults.galleryApplicationVersionListPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request")
|
||||||
|
}
|
||||||
|
if req == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := client.ListByGalleryApplicationSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request")
|
||||||
|
}
|
||||||
|
result, err = client.ListByGalleryApplicationResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required.
|
||||||
|
func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication")
|
||||||
|
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.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName)
|
||||||
|
return
|
||||||
|
}
|
821
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/models.go
generated
vendored
821
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
@ -94,7 +94,7 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupN
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -337,7 +337,7 @@ func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceG
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -418,7 +418,7 @@ func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request,
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -531,7 +531,7 @@ func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, r
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -640,7 +640,7 @@ func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resource
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
@ -718,7 +718,7 @@ func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupN
|
|||||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
}
|
}
|
||||||
|
|
||||||
const APIVersion = "2018-09-30"
|
const APIVersion = "2019-03-01"
|
||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,8 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons
|
|||||||
// resourceGroupName - the name of the resource group.
|
// resourceGroupName - the name of the resource group.
|
||||||
// VMScaleSetName - the name of the VM scale set.
|
// VMScaleSetName - the name of the VM scale set.
|
||||||
// instanceID - the instance ID of the virtual machine.
|
// instanceID - the instance ID of the virtual machine.
|
||||||
func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) {
|
// expand - the expand expression to apply on the operation.
|
||||||
|
func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (result VirtualMachineScaleSetVM, err error) {
|
||||||
if tracing.IsEnabled() {
|
if tracing.IsEnabled() {
|
||||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get")
|
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get")
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -215,7 +216,7 @@ func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceG
|
|||||||
tracing.EndSpan(ctx, sc, err)
|
tracing.EndSpan(ctx, sc, err)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request")
|
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request")
|
||||||
return
|
return
|
||||||
@ -237,7 +238,7 @@ func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceG
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPreparer prepares the Get request.
|
// GetPreparer prepares the Get request.
|
||||||
func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (*http.Request, error) {
|
||||||
pathParameters := map[string]interface{}{
|
pathParameters := map[string]interface{}{
|
||||||
"instanceId": autorest.Encode("path", instanceID),
|
"instanceId": autorest.Encode("path", instanceID),
|
||||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
@ -249,6 +250,9 @@ func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, r
|
|||||||
queryParameters := map[string]interface{}{
|
queryParameters := map[string]interface{}{
|
||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
|
if len(string(expand)) > 0 {
|
||||||
|
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||||
|
}
|
||||||
|
|
||||||
preparer := autorest.CreatePreparer(
|
preparer := autorest.CreatePreparer(
|
||||||
autorest.AsGet(),
|
autorest.AsGet(),
|
||||||
|
@ -2024,7 +2024,7 @@ type OperationPropertiesDefinition struct {
|
|||||||
ServiceSpecification *OperationServiceSpecificationDefinition `json:"serviceSpecification,omitempty"`
|
ServiceSpecification *OperationServiceSpecificationDefinition `json:"serviceSpecification,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OperationServiceSpecificationDefinition the definition of Azure Monitoring metrics list.
|
// OperationServiceSpecificationDefinition the definition of Azure Monitoring list.
|
||||||
type OperationServiceSpecificationDefinition struct {
|
type OperationServiceSpecificationDefinition struct {
|
||||||
// MetricSpecifications - A list of Azure Monitoring metrics definition.
|
// MetricSpecifications - A list of Azure Monitoring metrics definition.
|
||||||
MetricSpecifications *[]OperationMetricSpecificationDefinition `json:"metricSpecifications,omitempty"`
|
MetricSpecifications *[]OperationMetricSpecificationDefinition `json:"metricSpecifications,omitempty"`
|
||||||
@ -3022,7 +3022,7 @@ func (r Resource) MarshalJSON() ([]byte, error) {
|
|||||||
|
|
||||||
// RetentionPolicy the retention policy for a container registry.
|
// RetentionPolicy the retention policy for a container registry.
|
||||||
type RetentionPolicy struct {
|
type RetentionPolicy struct {
|
||||||
// Days - The number of days to retain manifest before it expires.
|
// Days - The number of days to retain an untagged manifest after which it gets purged.
|
||||||
Days *int32 `json:"days,omitempty"`
|
Days *int32 `json:"days,omitempty"`
|
||||||
// LastUpdatedTime - READ-ONLY; The timestamp when the policy was last updated.
|
// LastUpdatedTime - READ-ONLY; The timestamp when the policy was last updated.
|
||||||
LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
|
LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
|
||||||
|
@ -30,6 +30,8 @@ go_library(
|
|||||||
"expressrouteports.go",
|
"expressrouteports.go",
|
||||||
"expressrouteportslocations.go",
|
"expressrouteportslocations.go",
|
||||||
"expressrouteserviceproviders.go",
|
"expressrouteserviceproviders.go",
|
||||||
|
"firewallpolicies.go",
|
||||||
|
"firewallpolicyrulegroups.go",
|
||||||
"hubvirtualnetworkconnections.go",
|
"hubvirtualnetworkconnections.go",
|
||||||
"inboundnatrules.go",
|
"inboundnatrules.go",
|
||||||
"interfaceipconfigurations.go",
|
"interfaceipconfigurations.go",
|
||||||
|
582
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicies.go
generated
vendored
Normal file
582
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicies.go
generated
vendored
Normal file
@ -0,0 +1,582 @@
|
|||||||
|
package network
|
||||||
|
|
||||||
|
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||||
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/Azure/go-autorest/autorest"
|
||||||
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
"github.com/Azure/go-autorest/tracing"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FirewallPoliciesClient is the network Client
|
||||||
|
type FirewallPoliciesClient struct {
|
||||||
|
BaseClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFirewallPoliciesClient creates an instance of the FirewallPoliciesClient client.
|
||||||
|
func NewFirewallPoliciesClient(subscriptionID string) FirewallPoliciesClient {
|
||||||
|
return NewFirewallPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFirewallPoliciesClientWithBaseURI creates an instance of the FirewallPoliciesClient client.
|
||||||
|
func NewFirewallPoliciesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPoliciesClient {
|
||||||
|
return FirewallPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdate creates or updates the specified Firewall Policy.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
// parameters - parameters supplied to the create or update Firewall Policy operation.
|
||||||
|
func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy) (result FirewallPoliciesCreateOrUpdateFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.CreateOrUpdate")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, parameters)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.CreateOrUpdateSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||||
|
func (client FirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters.Etag = 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.Network/firewallPolicies/{firewallPolicyName}", pathParameters),
|
||||||
|
autorest.WithJSON(parameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (future FirewallPoliciesCreateOrUpdateFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicy, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete deletes the specified Firewall Policy.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
func (client FirewallPoliciesClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPoliciesDeleteFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Delete")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.DeletePreparer(ctx, resourceGroupName, firewallPolicyName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.DeleteSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeletePreparer prepares the Delete request.
|
||||||
|
func (client FirewallPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsDelete(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSender sends the Delete request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPoliciesClient) DeleteSender(req *http.Request) (future FirewallPoliciesDeleteFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteResponder handles the response to the Delete request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get gets the specified Firewall Policy.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
// expand - expands referenced resources.
|
||||||
|
func (client FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, expand string) (result FirewallPolicy, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Get")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName, expand)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.GetResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPreparer prepares the Get request.
|
||||||
|
func (client FirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, expand string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
if len(expand) > 0 {
|
||||||
|
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSender sends the Get request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPoliciesClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetResponder handles the response to the Get request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPoliciesClient) GetResponder(resp *http.Response) (result FirewallPolicy, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List lists all Firewall Policies in a resource group.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
func (client FirewallPoliciesClient) List(ctx context.Context, resourceGroupName string) (result FirewallPolicyListResultPage, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.List")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.fplr.Response.Response != nil {
|
||||||
|
sc = result.fplr.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
result.fn = client.listNextResults
|
||||||
|
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.fplr.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.fplr, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPreparer prepares the List request.
|
||||||
|
func (client FirewallPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies", 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 FirewallPoliciesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListResponder handles the response to the List request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPoliciesClient) ListResponder(resp *http.Response) (result FirewallPolicyListResult, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// listNextResults retrieves the next set of results, if any.
|
||||||
|
func (client FirewallPoliciesClient) listNextResults(ctx context.Context, lastResults FirewallPolicyListResult) (result FirewallPolicyListResult, err error) {
|
||||||
|
req, err := lastResults.firewallPolicyListResultPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "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, "network.FirewallPoliciesClient", "listNextResults", resp, "Failure sending next results request")
|
||||||
|
}
|
||||||
|
result, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", resp, "Failure responding to next results request")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||||
|
func (client FirewallPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result FirewallPolicyListResultIterator, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.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, resourceGroupName)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListAll gets all the Firewall Policies in a subscription.
|
||||||
|
func (client FirewallPoliciesClient) ListAll(ctx context.Context) (result FirewallPolicyListResultPage, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.ListAll")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.fplr.Response.Response != nil {
|
||||||
|
sc = result.fplr.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
result.fn = client.listAllNextResults
|
||||||
|
req, err := client.ListAllPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListAllSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.fplr.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.fplr, err = client.ListAllResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListAllPreparer prepares the ListAll request.
|
||||||
|
func (client FirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListAllSender sends the ListAll request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPoliciesClient) ListAllSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListAllResponder handles the response to the ListAll request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPoliciesClient) ListAllResponder(resp *http.Response) (result FirewallPolicyListResult, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// listAllNextResults retrieves the next set of results, if any.
|
||||||
|
func (client FirewallPoliciesClient) listAllNextResults(ctx context.Context, lastResults FirewallPolicyListResult) (result FirewallPolicyListResult, err error) {
|
||||||
|
req, err := lastResults.firewallPolicyListResultPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", nil, "Failure preparing next results request")
|
||||||
|
}
|
||||||
|
if req == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := client.ListAllSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", resp, "Failure sending next results request")
|
||||||
|
}
|
||||||
|
result, err = client.ListAllResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", resp, "Failure responding to next results request")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListAllComplete enumerates all values, automatically crossing page boundaries as required.
|
||||||
|
func (client FirewallPoliciesClient) ListAllComplete(ctx context.Context) (result FirewallPolicyListResultIterator, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.ListAll")
|
||||||
|
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.ListAll(ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateTags updates a Firewall Policy Tags.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the resource group name of the Firewall Policy.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy being updated.
|
||||||
|
// firewallPolicyParameters - parameters supplied to Update Firewall Policy tags.
|
||||||
|
func (client FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, firewallPolicyName string, firewallPolicyParameters TagsObject) (result FirewallPolicy, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.UpdateTags")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, firewallPolicyName, firewallPolicyParameters)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.UpdateTagsSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.UpdateTagsResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateTagsPreparer prepares the UpdateTags request.
|
||||||
|
func (client FirewallPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, firewallPolicyParameters TagsObject) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
|
autorest.AsPatch(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters),
|
||||||
|
autorest.WithJSON(firewallPolicyParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateTagsResponder handles the response to the UpdateTags request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPoliciesClient) UpdateTagsResponder(resp *http.Response) (result FirewallPolicy, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
409
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicyrulegroups.go
generated
vendored
Normal file
409
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicyrulegroups.go
generated
vendored
Normal file
@ -0,0 +1,409 @@
|
|||||||
|
package network
|
||||||
|
|
||||||
|
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||||
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/Azure/go-autorest/autorest"
|
||||||
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
"github.com/Azure/go-autorest/autorest/validation"
|
||||||
|
"github.com/Azure/go-autorest/tracing"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FirewallPolicyRuleGroupsClient is the network Client
|
||||||
|
type FirewallPolicyRuleGroupsClient struct {
|
||||||
|
BaseClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFirewallPolicyRuleGroupsClient creates an instance of the FirewallPolicyRuleGroupsClient client.
|
||||||
|
func NewFirewallPolicyRuleGroupsClient(subscriptionID string) FirewallPolicyRuleGroupsClient {
|
||||||
|
return NewFirewallPolicyRuleGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFirewallPolicyRuleGroupsClientWithBaseURI creates an instance of the FirewallPolicyRuleGroupsClient client.
|
||||||
|
func NewFirewallPolicyRuleGroupsClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyRuleGroupsClient {
|
||||||
|
return FirewallPolicyRuleGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdate creates or updates the specified FirewallPolicyRuleGroup.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
// ruleGroupName - the name of the FirewallPolicyRuleGroup.
|
||||||
|
// parameters - parameters supplied to the create or update FirewallPolicyRuleGroup operation.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleGroupName string, parameters FirewallPolicyRuleGroup) (result FirewallPolicyRuleGroupsCreateOrUpdateFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.CreateOrUpdate")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: parameters,
|
||||||
|
Constraints: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleGroupProperties", Name: validation.Null, Rule: false,
|
||||||
|
Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleGroupProperties.Priority", Name: validation.Null, Rule: false,
|
||||||
|
Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleGroupProperties.Priority", Name: validation.InclusiveMaximum, Rule: int64(65000), Chain: nil},
|
||||||
|
{Target: "parameters.FirewallPolicyRuleGroupProperties.Priority", Name: validation.InclusiveMinimum, Rule: 100, Chain: nil},
|
||||||
|
}},
|
||||||
|
}}}}}); err != nil {
|
||||||
|
return result, validation.NewError("network.FirewallPolicyRuleGroupsClient", "CreateOrUpdate", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, ruleGroupName, parameters)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.CreateOrUpdateSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleGroupName string, parameters FirewallPolicyRuleGroup) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"ruleGroupName": autorest.Encode("path", ruleGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters.Etag = nil
|
||||||
|
parameters.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.Network/firewallPolicies/{firewallPolicyName}/ruleGroups/{ruleGroupName}", pathParameters),
|
||||||
|
autorest.WithJSON(parameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) CreateOrUpdateSender(req *http.Request) (future FirewallPolicyRuleGroupsCreateOrUpdateFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicyRuleGroup, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete deletes the specified FirewallPolicyRuleGroup.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
// ruleGroupName - the name of the FirewallPolicyRuleGroup.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleGroupName string) (result FirewallPolicyRuleGroupsDeleteFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.Delete")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.DeletePreparer(ctx, resourceGroupName, firewallPolicyName, ruleGroupName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Delete", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.DeleteSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Delete", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeletePreparer prepares the Delete request.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleGroupName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"ruleGroupName": autorest.Encode("path", ruleGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsDelete(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleGroups/{ruleGroupName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSender sends the Delete request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) DeleteSender(req *http.Request) (future FirewallPolicyRuleGroupsDeleteFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteResponder handles the response to the Delete request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get gets the specified FirewallPolicyRuleGroup.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
// ruleGroupName - the name of the FirewallPolicyRuleGroup.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleGroupName string) (result FirewallPolicyRuleGroup, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.Get")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName, ruleGroupName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Get", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Get", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.GetResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Get", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPreparer prepares the Get request.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleGroupName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"ruleGroupName": autorest.Encode("path", ruleGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleGroups/{ruleGroupName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSender sends the Get request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetResponder handles the response to the Get request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) GetResponder(resp *http.Response) (result FirewallPolicyRuleGroup, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// firewallPolicyName - the name of the Firewall Policy.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPolicyRuleGroupListResultPage, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.List")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.fprglr.Response.Response != nil {
|
||||||
|
sc = result.fprglr.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
result.fn = client.listNextResults
|
||||||
|
req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "List", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.fprglr.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "List", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.fprglr, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "List", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPreparer prepares the List request.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"firewallPolicyName": autorest.Encode("path", firewallPolicyName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleGroups", 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 FirewallPolicyRuleGroupsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListResponder handles the response to the List request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) ListResponder(resp *http.Response) (result FirewallPolicyRuleGroupListResult, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// listNextResults retrieves the next set of results, if any.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) listNextResults(ctx context.Context, lastResults FirewallPolicyRuleGroupListResult) (result FirewallPolicyRuleGroupListResult, err error) {
|
||||||
|
req, err := lastResults.firewallPolicyRuleGroupListResultPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return result, autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "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, "network.FirewallPolicyRuleGroupsClient", "listNextResults", resp, "Failure sending next results request")
|
||||||
|
}
|
||||||
|
result, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||||
|
func (client FirewallPolicyRuleGroupsClient) ListComplete(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPolicyRuleGroupListResultIterator, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.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, resourceGroupName, firewallPolicyName)
|
||||||
|
return
|
||||||
|
}
|
1535
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go
generated
vendored
1535
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
@ -1019,6 +1019,8 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer(
|
|||||||
"api-version": APIVersion,
|
"api-version": APIVersion,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parameters.Type = nil
|
||||||
|
parameters.Etag = nil
|
||||||
preparer := autorest.CreatePreparer(
|
preparer := autorest.CreatePreparer(
|
||||||
autorest.AsContentType("application/json; charset=utf-8"),
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
autorest.AsPut(),
|
autorest.AsPut(),
|
||||||
|
@ -42,7 +42,9 @@ func NewServiceTagsClientWithBaseURI(baseURI string, subscriptionID string) Serv
|
|||||||
|
|
||||||
// List gets a list of service tag information resources.
|
// List gets a list of service tag information resources.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// location - the location.
|
// location - the location that will be used as a reference for version (not as a filter based on location, you
|
||||||
|
// will get the list of service tags with prefix details across all regions but limited to the cloud that your
|
||||||
|
// subscription belongs to).
|
||||||
func (client ServiceTagsClient) List(ctx context.Context, location string) (result ServiceTagsListResult, err error) {
|
func (client ServiceTagsClient) List(ctx context.Context, location string) (result ServiceTagsListResult, err error) {
|
||||||
if tracing.IsEnabled() {
|
if tracing.IsEnabled() {
|
||||||
ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagsClient.List")
|
ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagsClient.List")
|
||||||
|
@ -479,3 +479,85 @@ func (client SubnetsClient) PrepareNetworkPoliciesResponder(resp *http.Response)
|
|||||||
result.Response = resp
|
result.Response = resp
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnprepareNetworkPolicies unprepares a subnet by removing network intent policies.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group.
|
||||||
|
// virtualNetworkName - the name of the virtual network.
|
||||||
|
// subnetName - the name of the subnet.
|
||||||
|
// unprepareNetworkPoliciesRequestParameters - parameters supplied to unprepare subnet to remove network intent
|
||||||
|
// policies.
|
||||||
|
func (client SubnetsClient) UnprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest) (result SubnetsUnprepareNetworkPoliciesFuture, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.UnprepareNetworkPolicies")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response() != nil {
|
||||||
|
sc = result.Response().StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
req, err := client.UnprepareNetworkPoliciesPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.UnprepareNetworkPoliciesSender(req)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", result.Response(), "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnprepareNetworkPoliciesPreparer prepares the UnprepareNetworkPolicies request.
|
||||||
|
func (client SubnetsClient) UnprepareNetworkPoliciesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subnetName": autorest.Encode("path", subnetName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-06-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
|
autorest.AsPost(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies", pathParameters),
|
||||||
|
autorest.WithJSON(unprepareNetworkPoliciesRequestParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnprepareNetworkPoliciesSender sends the UnprepareNetworkPolicies request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client SubnetsClient) UnprepareNetworkPoliciesSender(req *http.Request) (future SubnetsUnprepareNetworkPoliciesFuture, err error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
var resp *http.Response
|
||||||
|
resp, err = autorest.SendWithSender(client, req, sd...)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnprepareNetworkPoliciesResponder handles the response to the UnprepareNetworkPolicies request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client SubnetsClient) UnprepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -734,7 +734,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *h
|
|||||||
err = autorest.Respond(
|
err = autorest.Respond(
|
||||||
resp,
|
resp,
|
||||||
client.ByInspecting(),
|
client.ByInspecting(),
|
||||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||||
autorest.ByUnmarshallingJSON(&result),
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
autorest.ByClosing())
|
autorest.ByClosing())
|
||||||
result.Response = autorest.Response{Response: resp}
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
@ -1542,7 +1542,7 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Respon
|
|||||||
err = autorest.Respond(
|
err = autorest.Respond(
|
||||||
resp,
|
resp,
|
||||||
client.ByInspecting(),
|
client.ByInspecting(),
|
||||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||||
autorest.ByUnmarshallingJSON(&result),
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
autorest.ByClosing())
|
autorest.ByClosing())
|
||||||
result.Response = autorest.Response{Response: resp}
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
@ -7,6 +7,8 @@ go_library(
|
|||||||
"blobcontainers.go",
|
"blobcontainers.go",
|
||||||
"blobservices.go",
|
"blobservices.go",
|
||||||
"client.go",
|
"client.go",
|
||||||
|
"fileservices.go",
|
||||||
|
"fileshares.go",
|
||||||
"managementpolicies.go",
|
"managementpolicies.go",
|
||||||
"models.go",
|
"models.go",
|
||||||
"operations.go",
|
"operations.go",
|
||||||
|
@ -135,6 +135,98 @@ func (client BlobServicesClient) GetServicePropertiesResponder(resp *http.Respon
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List list blob services of storage account. It returns a collection of one object named default.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
func (client BlobServicesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BlobServiceItems, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/BlobServicesClient.List")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.BlobServicesClient", "List", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "List", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "List", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "List", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPreparer prepares the List request.
|
||||||
|
func (client BlobServicesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-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.Storage/storageAccounts/{accountName}/blobServices", 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 BlobServicesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListResponder handles the response to the List request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client BlobServicesClient) ListResponder(resp *http.Response) (result BlobServiceItems, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// SetServiceProperties sets the properties of a storage account’s Blob service, including properties for Storage
|
// SetServiceProperties sets the properties of a storage account’s Blob service, including properties for Storage
|
||||||
// Analytics and CORS (Cross-Origin Resource Sharing) rules.
|
// Analytics and CORS (Cross-Origin Resource Sharing) rules.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
|
326
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage/fileservices.go
generated
vendored
Normal file
326
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage/fileservices.go
generated
vendored
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
package storage
|
||||||
|
|
||||||
|
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||||
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/Azure/go-autorest/autorest"
|
||||||
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
"github.com/Azure/go-autorest/autorest/validation"
|
||||||
|
"github.com/Azure/go-autorest/tracing"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FileServicesClient is the the Azure Storage Management API.
|
||||||
|
type FileServicesClient struct {
|
||||||
|
BaseClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFileServicesClient creates an instance of the FileServicesClient client.
|
||||||
|
func NewFileServicesClient(subscriptionID string) FileServicesClient {
|
||||||
|
return NewFileServicesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFileServicesClientWithBaseURI creates an instance of the FileServicesClient client.
|
||||||
|
func NewFileServicesClientWithBaseURI(baseURI string, subscriptionID string) FileServicesClient {
|
||||||
|
return FileServicesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetServiceProperties gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
|
||||||
|
// Sharing) rules.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
func (client FileServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result FileServiceProperties, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileServicesClient.GetServiceProperties")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileServicesClient", "GetServiceProperties", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.GetServicePropertiesPreparer(ctx, resourceGroupName, accountName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "GetServiceProperties", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetServicePropertiesSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "GetServiceProperties", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.GetServicePropertiesResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "GetServiceProperties", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetServicePropertiesPreparer prepares the GetServiceProperties request.
|
||||||
|
func (client FileServicesClient) GetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"FileServicesName": autorest.Encode("path", "default"),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-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.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetServicePropertiesSender sends the GetServiceProperties request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FileServicesClient) GetServicePropertiesSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetServicePropertiesResponder handles the response to the GetServiceProperties request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileServicesClient) GetServicePropertiesResponder(resp *http.Response) (result FileServiceProperties, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List list all file services in storage accounts
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
func (client FileServicesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result FileServiceItems, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileServicesClient.List")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileServicesClient", "List", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "List", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "List", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "List", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPreparer prepares the List request.
|
||||||
|
func (client FileServicesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-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.Storage/storageAccounts/{accountName}/fileServices", 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 FileServicesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListResponder handles the response to the List request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileServicesClient) ListResponder(resp *http.Response) (result FileServiceItems, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetServiceProperties sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
|
||||||
|
// Sharing) rules.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
// parameters - the properties of file services in storage accounts, including CORS (Cross-Origin Resource
|
||||||
|
// Sharing) rules.
|
||||||
|
func (client FileServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties) (result FileServiceProperties, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileServicesClient.SetServiceProperties")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileServicesClient", "SetServiceProperties", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.SetServicePropertiesPreparer(ctx, resourceGroupName, accountName, parameters)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "SetServiceProperties", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.SetServicePropertiesSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "SetServiceProperties", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.SetServicePropertiesResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "SetServiceProperties", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetServicePropertiesPreparer prepares the SetServiceProperties request.
|
||||||
|
func (client FileServicesClient) SetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"FileServicesName": autorest.Encode("path", "default"),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
|
autorest.AsPut(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}", pathParameters),
|
||||||
|
autorest.WithJSON(parameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetServicePropertiesSender sends the SetServiceProperties request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FileServicesClient) SetServicePropertiesSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetServicePropertiesResponder handles the response to the SetServiceProperties request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileServicesClient) SetServicePropertiesResponder(resp *http.Response) (result FileServiceProperties, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
594
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage/fileshares.go
generated
vendored
Normal file
594
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage/fileshares.go
generated
vendored
Normal file
@ -0,0 +1,594 @@
|
|||||||
|
package storage
|
||||||
|
|
||||||
|
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||||
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/Azure/go-autorest/autorest"
|
||||||
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
"github.com/Azure/go-autorest/autorest/validation"
|
||||||
|
"github.com/Azure/go-autorest/tracing"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FileSharesClient is the the Azure Storage Management API.
|
||||||
|
type FileSharesClient struct {
|
||||||
|
BaseClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFileSharesClient creates an instance of the FileSharesClient client.
|
||||||
|
func NewFileSharesClient(subscriptionID string) FileSharesClient {
|
||||||
|
return NewFileSharesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFileSharesClientWithBaseURI creates an instance of the FileSharesClient client.
|
||||||
|
func NewFileSharesClientWithBaseURI(baseURI string, subscriptionID string) FileSharesClient {
|
||||||
|
return FileSharesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create creates a new share under the specified account as described by request body. The share resource includes
|
||||||
|
// metadata and properties for that share. It does not include a list of the files contained by the share.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||||
|
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||||
|
// character must be immediately preceded and followed by a letter or number.
|
||||||
|
// fileShare - properties of the file share to create.
|
||||||
|
func (client FileSharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (result FileShare, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Create")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: shareName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||||
|
{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: fileShare,
|
||||||
|
Constraints: []validation.Constraint{{Target: "fileShare.FileShareProperties", Name: validation.Null, Rule: false,
|
||||||
|
Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.Null, Rule: false,
|
||||||
|
Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMaximum, Rule: int64(5120), Chain: nil},
|
||||||
|
{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
|
||||||
|
}},
|
||||||
|
}}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileSharesClient", "Create", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, fileShare)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.CreateSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.CreateResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreatePreparer prepares the Create request.
|
||||||
|
func (client FileSharesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"shareName": autorest.Encode("path", shareName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsContentType("application/json; charset=utf-8"),
|
||||||
|
autorest.AsPut(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
|
||||||
|
autorest.WithJSON(fileShare),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateSender sends the Create request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FileSharesClient) CreateSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateResponder handles the response to the Create request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileSharesClient) CreateResponder(resp *http.Response) (result FileShare, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete deletes specified share under its account.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||||
|
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||||
|
// character must be immediately preceded and followed by a letter or number.
|
||||||
|
func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result autorest.Response, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Delete")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response != nil {
|
||||||
|
sc = result.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: shareName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||||
|
{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileSharesClient", "Delete", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.DeleteSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = resp
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.DeleteResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeletePreparer prepares the Delete request.
|
||||||
|
func (client FileSharesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"shareName": autorest.Encode("path", shareName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsDelete(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSender sends the Delete request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FileSharesClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteResponder handles the response to the Delete request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileSharesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get gets properties of a specified share.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||||
|
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||||
|
// character must be immediately preceded and followed by a letter or number.
|
||||||
|
func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result FileShare, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Get")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: shareName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||||
|
{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileSharesClient", "Get", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.GetResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPreparer prepares the Get request.
|
||||||
|
func (client FileSharesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"shareName": autorest.Encode("path", shareName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-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.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
|
||||||
|
autorest.WithQueryParameters(queryParameters))
|
||||||
|
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSender sends the Get request. The method will close the
|
||||||
|
// http.Response Body if it receives an error.
|
||||||
|
func (client FileSharesClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetResponder handles the response to the Get request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileSharesClient) GetResponder(resp *http.Response) (result FileShare, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List lists all shares.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
// skipToken - optional. Continuation token for the list operation.
|
||||||
|
// maxpagesize - optional. Specified maximum number of shares that can be included in the list.
|
||||||
|
// filter - optional. When specified, only share names starting with the filter will be listed.
|
||||||
|
func (client FileSharesClient) List(ctx context.Context, resourceGroupName string, accountName string, skipToken string, maxpagesize string, filter string) (result FileShareItemsPage, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.List")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.fsi.Response.Response != nil {
|
||||||
|
sc = result.fsi.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileSharesClient", "List", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
result.fn = client.listNextResults
|
||||||
|
req, err := client.ListPreparer(ctx, resourceGroupName, accountName, skipToken, maxpagesize, filter)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.ListSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.fsi.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.fsi, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPreparer prepares the List request.
|
||||||
|
func (client FileSharesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, skipToken string, maxpagesize string, filter string) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-01"
|
||||||
|
queryParameters := map[string]interface{}{
|
||||||
|
"api-version": APIVersion,
|
||||||
|
}
|
||||||
|
if len(skipToken) > 0 {
|
||||||
|
queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
|
||||||
|
}
|
||||||
|
if len(maxpagesize) > 0 {
|
||||||
|
queryParameters["$maxpagesize"] = autorest.Encode("query", maxpagesize)
|
||||||
|
}
|
||||||
|
if len(filter) > 0 {
|
||||||
|
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||||
|
}
|
||||||
|
|
||||||
|
preparer := autorest.CreatePreparer(
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(client.BaseURI),
|
||||||
|
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares", 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 FileSharesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListResponder handles the response to the List request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileSharesClient) ListResponder(resp *http.Response) (result FileShareItems, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// listNextResults retrieves the next set of results, if any.
|
||||||
|
func (client FileSharesClient) listNextResults(ctx context.Context, lastResults FileShareItems) (result FileShareItems, err error) {
|
||||||
|
req, err := lastResults.fileShareItemsPreparer(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return result, autorest.NewErrorWithError(err, "storage.FileSharesClient", "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, "storage.FileSharesClient", "listNextResults", resp, "Failure sending next results request")
|
||||||
|
}
|
||||||
|
result, err = client.ListResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "listNextResults", resp, "Failure responding to next results request")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||||
|
func (client FileSharesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, skipToken string, maxpagesize string, filter string) (result FileShareItemsIterator, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.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, resourceGroupName, accountName, skipToken, maxpagesize, filter)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update updates share properties as specified in request body. Properties not mentioned in the request will not be
|
||||||
|
// changed. Update fails if the specified share does not already exist.
|
||||||
|
// Parameters:
|
||||||
|
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||||
|
// insensitive.
|
||||||
|
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||||
|
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||||
|
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||||
|
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||||
|
// character must be immediately preceded and followed by a letter or number.
|
||||||
|
// fileShare - properties to update for the file share.
|
||||||
|
func (client FileSharesClient) Update(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (result FileShare, err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Update")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if result.Response.Response != nil {
|
||||||
|
sc = result.Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
if err := validation.Validate([]validation.Validation{
|
||||||
|
{TargetValue: 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\._\(\)]+$`, Chain: nil}}},
|
||||||
|
{TargetValue: accountName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||||
|
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: shareName,
|
||||||
|
Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||||
|
{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||||
|
{TargetValue: client.SubscriptionID,
|
||||||
|
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||||
|
return result, validation.NewError("storage.FileSharesClient", "Update", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, shareName, fileShare)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", nil, "Failure preparing request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.UpdateSender(req)
|
||||||
|
if err != nil {
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", resp, "Failure sending request")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err = client.UpdateResponder(resp)
|
||||||
|
if err != nil {
|
||||||
|
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", resp, "Failure responding to request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdatePreparer prepares the Update request.
|
||||||
|
func (client FileSharesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (*http.Request, error) {
|
||||||
|
pathParameters := map[string]interface{}{
|
||||||
|
"accountName": autorest.Encode("path", accountName),
|
||||||
|
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||||
|
"shareName": autorest.Encode("path", shareName),
|
||||||
|
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||||
|
}
|
||||||
|
|
||||||
|
const APIVersion = "2019-04-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.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
|
||||||
|
autorest.WithJSON(fileShare),
|
||||||
|
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 FileSharesClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||||
|
sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
|
||||||
|
return autorest.SendWithSender(client, req, sd...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateResponder handles the response to the Update request. The method always
|
||||||
|
// closes the http.Response Body.
|
||||||
|
func (client FileSharesClient) UpdateResponder(resp *http.Response) (result FileShare, err error) {
|
||||||
|
err = autorest.Respond(
|
||||||
|
resp,
|
||||||
|
client.ByInspecting(),
|
||||||
|
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||||
|
autorest.ByUnmarshallingJSON(&result),
|
||||||
|
autorest.ByClosing())
|
||||||
|
result.Response = autorest.Response{Response: resp}
|
||||||
|
return
|
||||||
|
}
|
448
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage/models.go
generated
vendored
448
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage/models.go
generated
vendored
@ -878,7 +878,7 @@ type AccountProperties struct {
|
|||||||
type AccountPropertiesCreateParameters struct {
|
type AccountPropertiesCreateParameters struct {
|
||||||
// CustomDomain - User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property.
|
// CustomDomain - User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property.
|
||||||
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
|
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
|
||||||
// Encryption - Provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted.
|
// Encryption - Not applicable. Azure Storage encryption is enabled for all storage accounts and cannot be disabled.
|
||||||
Encryption *Encryption `json:"encryption,omitempty"`
|
Encryption *Encryption `json:"encryption,omitempty"`
|
||||||
// NetworkRuleSet - Network rule set
|
// NetworkRuleSet - Network rule set
|
||||||
NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"`
|
NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"`
|
||||||
@ -1184,6 +1184,13 @@ func (bc *BlobContainer) UnmarshalJSON(body []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BlobServiceItems ...
|
||||||
|
type BlobServiceItems struct {
|
||||||
|
autorest.Response `json:"-"`
|
||||||
|
// Value - READ-ONLY; List of blob services returned.
|
||||||
|
Value *[]BlobServiceProperties `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// BlobServiceProperties the properties of a storage account’s Blob service.
|
// BlobServiceProperties the properties of a storage account’s Blob service.
|
||||||
type BlobServiceProperties struct {
|
type BlobServiceProperties struct {
|
||||||
autorest.Response `json:"-"`
|
autorest.Response `json:"-"`
|
||||||
@ -1419,6 +1426,445 @@ type Endpoints struct {
|
|||||||
Dfs *string `json:"dfs,omitempty"`
|
Dfs *string `json:"dfs,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrorResponse an error response from the Storage service.
|
||||||
|
type ErrorResponse struct {
|
||||||
|
Error *ErrorResponseBody `json:"error,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ErrorResponseBody an error response from the Storage service.
|
||||||
|
type ErrorResponseBody struct {
|
||||||
|
// Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
||||||
|
Code *string `json:"code,omitempty"`
|
||||||
|
// Message - A message describing the error, intended to be suitable for display in a user interface.
|
||||||
|
Message *string `json:"message,omitempty"`
|
||||||
|
// Target - The target of the particular error. For example, the name of the property in error.
|
||||||
|
Target *string `json:"target,omitempty"`
|
||||||
|
// Details - A list of additional details about the error.
|
||||||
|
Details *[]ErrorResponseBody `json:"details,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileServiceItems ...
|
||||||
|
type FileServiceItems struct {
|
||||||
|
autorest.Response `json:"-"`
|
||||||
|
// Value - READ-ONLY; List of file services returned.
|
||||||
|
Value *[]FileServiceProperties `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileServiceProperties the properties of File services in storage account.
|
||||||
|
type FileServiceProperties struct {
|
||||||
|
autorest.Response `json:"-"`
|
||||||
|
// FileServicePropertiesProperties - The properties of File services in storage account.
|
||||||
|
*FileServicePropertiesProperties `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 FileServiceProperties.
|
||||||
|
func (fsp FileServiceProperties) MarshalJSON() ([]byte, error) {
|
||||||
|
objectMap := make(map[string]interface{})
|
||||||
|
if fsp.FileServicePropertiesProperties != nil {
|
||||||
|
objectMap["properties"] = fsp.FileServicePropertiesProperties
|
||||||
|
}
|
||||||
|
return json.Marshal(objectMap)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is the custom unmarshaler for FileServiceProperties struct.
|
||||||
|
func (fsp *FileServiceProperties) 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 fileServiceProperties FileServicePropertiesProperties
|
||||||
|
err = json.Unmarshal(*v, &fileServiceProperties)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsp.FileServicePropertiesProperties = &fileServiceProperties
|
||||||
|
}
|
||||||
|
case "id":
|
||||||
|
if v != nil {
|
||||||
|
var ID string
|
||||||
|
err = json.Unmarshal(*v, &ID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsp.ID = &ID
|
||||||
|
}
|
||||||
|
case "name":
|
||||||
|
if v != nil {
|
||||||
|
var name string
|
||||||
|
err = json.Unmarshal(*v, &name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsp.Name = &name
|
||||||
|
}
|
||||||
|
case "type":
|
||||||
|
if v != nil {
|
||||||
|
var typeVar string
|
||||||
|
err = json.Unmarshal(*v, &typeVar)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsp.Type = &typeVar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileServicePropertiesProperties the properties of File services in storage account.
|
||||||
|
type FileServicePropertiesProperties struct {
|
||||||
|
// Cors - Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service.
|
||||||
|
Cors *CorsRules `json:"cors,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileShare properties of the file share, including Id, resource name, resource type, Etag.
|
||||||
|
type FileShare struct {
|
||||||
|
autorest.Response `json:"-"`
|
||||||
|
// FileShareProperties - Properties of the file share.
|
||||||
|
*FileShareProperties `json:"properties,omitempty"`
|
||||||
|
// Etag - READ-ONLY; Resource Etag.
|
||||||
|
Etag *string `json:"etag,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 FileShare.
|
||||||
|
func (fs FileShare) MarshalJSON() ([]byte, error) {
|
||||||
|
objectMap := make(map[string]interface{})
|
||||||
|
if fs.FileShareProperties != nil {
|
||||||
|
objectMap["properties"] = fs.FileShareProperties
|
||||||
|
}
|
||||||
|
return json.Marshal(objectMap)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is the custom unmarshaler for FileShare struct.
|
||||||
|
func (fs *FileShare) 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 fileShareProperties FileShareProperties
|
||||||
|
err = json.Unmarshal(*v, &fileShareProperties)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fs.FileShareProperties = &fileShareProperties
|
||||||
|
}
|
||||||
|
case "etag":
|
||||||
|
if v != nil {
|
||||||
|
var etag string
|
||||||
|
err = json.Unmarshal(*v, &etag)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fs.Etag = &etag
|
||||||
|
}
|
||||||
|
case "id":
|
||||||
|
if v != nil {
|
||||||
|
var ID string
|
||||||
|
err = json.Unmarshal(*v, &ID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fs.ID = &ID
|
||||||
|
}
|
||||||
|
case "name":
|
||||||
|
if v != nil {
|
||||||
|
var name string
|
||||||
|
err = json.Unmarshal(*v, &name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fs.Name = &name
|
||||||
|
}
|
||||||
|
case "type":
|
||||||
|
if v != nil {
|
||||||
|
var typeVar string
|
||||||
|
err = json.Unmarshal(*v, &typeVar)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fs.Type = &typeVar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileShareItem the file share properties be listed out.
|
||||||
|
type FileShareItem struct {
|
||||||
|
// FileShareProperties - The file share properties be listed out.
|
||||||
|
*FileShareProperties `json:"properties,omitempty"`
|
||||||
|
// Etag - READ-ONLY; Resource Etag.
|
||||||
|
Etag *string `json:"etag,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 FileShareItem.
|
||||||
|
func (fsi FileShareItem) MarshalJSON() ([]byte, error) {
|
||||||
|
objectMap := make(map[string]interface{})
|
||||||
|
if fsi.FileShareProperties != nil {
|
||||||
|
objectMap["properties"] = fsi.FileShareProperties
|
||||||
|
}
|
||||||
|
return json.Marshal(objectMap)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is the custom unmarshaler for FileShareItem struct.
|
||||||
|
func (fsi *FileShareItem) 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 fileShareProperties FileShareProperties
|
||||||
|
err = json.Unmarshal(*v, &fileShareProperties)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsi.FileShareProperties = &fileShareProperties
|
||||||
|
}
|
||||||
|
case "etag":
|
||||||
|
if v != nil {
|
||||||
|
var etag string
|
||||||
|
err = json.Unmarshal(*v, &etag)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsi.Etag = &etag
|
||||||
|
}
|
||||||
|
case "id":
|
||||||
|
if v != nil {
|
||||||
|
var ID string
|
||||||
|
err = json.Unmarshal(*v, &ID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsi.ID = &ID
|
||||||
|
}
|
||||||
|
case "name":
|
||||||
|
if v != nil {
|
||||||
|
var name string
|
||||||
|
err = json.Unmarshal(*v, &name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsi.Name = &name
|
||||||
|
}
|
||||||
|
case "type":
|
||||||
|
if v != nil {
|
||||||
|
var typeVar string
|
||||||
|
err = json.Unmarshal(*v, &typeVar)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fsi.Type = &typeVar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileShareItems response schema. Contains list of shares returned, and if paging is requested or
|
||||||
|
// required, a URL to next page of shares.
|
||||||
|
type FileShareItems struct {
|
||||||
|
autorest.Response `json:"-"`
|
||||||
|
// Value - READ-ONLY; List of file shares returned.
|
||||||
|
Value *[]FileShareItem `json:"value,omitempty"`
|
||||||
|
// NextLink - READ-ONLY; Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum page size.
|
||||||
|
NextLink *string `json:"nextLink,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileShareItemsIterator provides access to a complete listing of FileShareItem values.
|
||||||
|
type FileShareItemsIterator struct {
|
||||||
|
i int
|
||||||
|
page FileShareItemsPage
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 *FileShareItemsIterator) NextWithContext(ctx context.Context) (err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileShareItemsIterator.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 *FileShareItemsIterator) Next() error {
|
||||||
|
return iter.NextWithContext(context.Background())
|
||||||
|
}
|
||||||
|
|
||||||
|
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||||
|
func (iter FileShareItemsIterator) 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 FileShareItemsIterator) Response() FileShareItems {
|
||||||
|
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 FileShareItemsIterator) Value() FileShareItem {
|
||||||
|
if !iter.page.NotDone() {
|
||||||
|
return FileShareItem{}
|
||||||
|
}
|
||||||
|
return iter.page.Values()[iter.i]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Creates a new instance of the FileShareItemsIterator type.
|
||||||
|
func NewFileShareItemsIterator(page FileShareItemsPage) FileShareItemsIterator {
|
||||||
|
return FileShareItemsIterator{page: page}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsEmpty returns true if the ListResult contains no values.
|
||||||
|
func (fsi FileShareItems) IsEmpty() bool {
|
||||||
|
return fsi.Value == nil || len(*fsi.Value) == 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// fileShareItemsPreparer prepares a request to retrieve the next set of results.
|
||||||
|
// It returns nil if no more results exist.
|
||||||
|
func (fsi FileShareItems) fileShareItemsPreparer(ctx context.Context) (*http.Request, error) {
|
||||||
|
if fsi.NextLink == nil || len(to.String(fsi.NextLink)) < 1 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return autorest.Prepare((&http.Request{}).WithContext(ctx),
|
||||||
|
autorest.AsJSON(),
|
||||||
|
autorest.AsGet(),
|
||||||
|
autorest.WithBaseURL(to.String(fsi.NextLink)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileShareItemsPage contains a page of FileShareItem values.
|
||||||
|
type FileShareItemsPage struct {
|
||||||
|
fn func(context.Context, FileShareItems) (FileShareItems, error)
|
||||||
|
fsi FileShareItems
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 *FileShareItemsPage) NextWithContext(ctx context.Context) (err error) {
|
||||||
|
if tracing.IsEnabled() {
|
||||||
|
ctx = tracing.StartSpan(ctx, fqdn+"/FileShareItemsPage.NextWithContext")
|
||||||
|
defer func() {
|
||||||
|
sc := -1
|
||||||
|
if page.Response().Response.Response != nil {
|
||||||
|
sc = page.Response().Response.Response.StatusCode
|
||||||
|
}
|
||||||
|
tracing.EndSpan(ctx, sc, err)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
next, err := page.fn(ctx, page.fsi)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
page.fsi = next
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Next advances to the next page of values. If there was an error making
|
||||||
|
// the request the page does not advance and the error is returned.
|
||||||
|
// Deprecated: Use NextWithContext() instead.
|
||||||
|
func (page *FileShareItemsPage) Next() error {
|
||||||
|
return page.NextWithContext(context.Background())
|
||||||
|
}
|
||||||
|
|
||||||
|
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||||
|
func (page FileShareItemsPage) NotDone() bool {
|
||||||
|
return !page.fsi.IsEmpty()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response returns the raw server response from the last page request.
|
||||||
|
func (page FileShareItemsPage) Response() FileShareItems {
|
||||||
|
return page.fsi
|
||||||
|
}
|
||||||
|
|
||||||
|
// Values returns the slice of values for the current page or nil if there are no values.
|
||||||
|
func (page FileShareItemsPage) Values() []FileShareItem {
|
||||||
|
if page.fsi.IsEmpty() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return *page.fsi.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
// Creates a new instance of the FileShareItemsPage type.
|
||||||
|
func NewFileShareItemsPage(getNextPage func(context.Context, FileShareItems) (FileShareItems, error)) FileShareItemsPage {
|
||||||
|
return FileShareItemsPage{fn: getNextPage}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileShareProperties the properties of the file share.
|
||||||
|
type FileShareProperties struct {
|
||||||
|
// LastModifiedTime - READ-ONLY; Returns the date and time the share was last modified.
|
||||||
|
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
|
||||||
|
// Metadata - A name-value pair to associate with the share as metadata.
|
||||||
|
Metadata map[string]*string `json:"metadata"`
|
||||||
|
// ShareQuota - The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120).
|
||||||
|
ShareQuota *int32 `json:"shareQuota,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON is the custom marshaler for FileShareProperties.
|
||||||
|
func (fsp FileShareProperties) MarshalJSON() ([]byte, error) {
|
||||||
|
objectMap := make(map[string]interface{})
|
||||||
|
if fsp.Metadata != nil {
|
||||||
|
objectMap["metadata"] = fsp.Metadata
|
||||||
|
}
|
||||||
|
if fsp.ShareQuota != nil {
|
||||||
|
objectMap["shareQuota"] = fsp.ShareQuota
|
||||||
|
}
|
||||||
|
return json.Marshal(objectMap)
|
||||||
|
}
|
||||||
|
|
||||||
// GeoReplicationStats statistics related to replication for storage account's Blob, Table, Queue and File
|
// GeoReplicationStats statistics related to replication for storage account's Blob, Table, Queue and File
|
||||||
// services. It is only available when geo-redundant replication is enabled for the storage account.
|
// services. It is only available when geo-redundant replication is enabled for the storage account.
|
||||||
type GeoReplicationStats struct {
|
type GeoReplicationStats struct {
|
||||||
|
2
vendor/github.com/Azure/azure-sdk-for-go/version/version.go
generated
vendored
2
vendor/github.com/Azure/azure-sdk-for-go/version/version.go
generated
vendored
@ -18,4 +18,4 @@ package version
|
|||||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||||
|
|
||||||
// Number contains the semantic version of this SDK.
|
// Number contains the semantic version of this SDK.
|
||||||
const Number = "v32.5.0"
|
const Number = "v33.1.0"
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -2,7 +2,7 @@
|
|||||||
bitbucket.org/bertimus9/systemstat
|
bitbucket.org/bertimus9/systemstat
|
||||||
# cloud.google.com/go v0.38.0 => cloud.google.com/go v0.38.0
|
# cloud.google.com/go v0.38.0 => cloud.google.com/go v0.38.0
|
||||||
cloud.google.com/go/compute/metadata
|
cloud.google.com/go/compute/metadata
|
||||||
# github.com/Azure/azure-sdk-for-go v32.5.0+incompatible => github.com/Azure/azure-sdk-for-go v32.5.0+incompatible
|
# github.com/Azure/azure-sdk-for-go v33.1.0+incompatible => github.com/Azure/azure-sdk-for-go v33.1.0+incompatible
|
||||||
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute
|
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute
|
||||||
github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry
|
github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry
|
||||||
github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network
|
github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network
|
||||||
|
Loading…
Reference in New Issue
Block a user