From d9e06532257a4c59f9c916233d4365c026e5226a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 13 Feb 2019 10:05:12 -0800 Subject: [PATCH 1/5] Generated from 78c04a3ce7558d35b5434b50edda25a575254841 (#3988) Add the 2018-02-01 certificates files back --- profiles/latest/web/mgmt/web/models.go | 15 + profiles/preview/web/mgmt/web/models.go | 15 + services/web/mgmt/2018-02-01/web/client.go | 85 +++ services/web/mgmt/2018-02-01/web/models.go | 73 ++- .../mgmt/2018-02-01/web/recommendations.go | 620 ++++++++++++++++++ .../mgmt/2018-02-01/web/webapi/interfaces.go | 7 + 6 files changed, 811 insertions(+), 4 deletions(-) diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index 8887df73b59e..f0e47dfad48c 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -472,6 +472,16 @@ const ( WebDeploy PublishingProfileFormat = original.WebDeploy ) +type RedundancyMode = original.RedundancyMode + +const ( + RedundancyModeActiveActive RedundancyMode = original.RedundancyModeActiveActive + RedundancyModeFailover RedundancyMode = original.RedundancyModeFailover + RedundancyModeGeoRedundant RedundancyMode = original.RedundancyModeGeoRedundant + RedundancyModeManual RedundancyMode = original.RedundancyModeManual + RedundancyModeNone RedundancyMode = original.RedundancyModeNone +) + type RenderingType = original.RenderingType const ( @@ -864,6 +874,7 @@ type FunctionEnvelopeCollectionPage = original.FunctionEnvelopeCollectionPage type FunctionEnvelopeProperties = original.FunctionEnvelopeProperties type FunctionSecrets = original.FunctionSecrets type FunctionSecretsProperties = original.FunctionSecretsProperties +type GeoDistribution = original.GeoDistribution type GeoRegion = original.GeoRegion type GeoRegionCollection = original.GeoRegionCollection type GeoRegionCollectionIterator = original.GeoRegionCollectionIterator @@ -1140,6 +1151,7 @@ type UsageCollectionPage = original.UsageCollectionPage type UsageProperties = original.UsageProperties type User = original.User type UserProperties = original.UserProperties +type ValidateContainerSettingsRequest = original.ValidateContainerSettingsRequest type ValidateProperties = original.ValidateProperties type ValidateRequest = original.ValidateRequest type ValidateResponse = original.ValidateResponse @@ -1712,6 +1724,9 @@ func PossiblePublicCertificateLocationValues() []PublicCertificateLocation { func PossiblePublishingProfileFormatValues() []PublishingProfileFormat { return original.PossiblePublishingProfileFormatValues() } +func PossibleRedundancyModeValues() []RedundancyMode { + return original.PossibleRedundancyModeValues() +} func PossibleRenderingTypeValues() []RenderingType { return original.PossibleRenderingTypeValues() } diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 8294918430b5..6af38f210a64 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -472,6 +472,16 @@ const ( WebDeploy PublishingProfileFormat = original.WebDeploy ) +type RedundancyMode = original.RedundancyMode + +const ( + RedundancyModeActiveActive RedundancyMode = original.RedundancyModeActiveActive + RedundancyModeFailover RedundancyMode = original.RedundancyModeFailover + RedundancyModeGeoRedundant RedundancyMode = original.RedundancyModeGeoRedundant + RedundancyModeManual RedundancyMode = original.RedundancyModeManual + RedundancyModeNone RedundancyMode = original.RedundancyModeNone +) + type RenderingType = original.RenderingType const ( @@ -864,6 +874,7 @@ type FunctionEnvelopeCollectionPage = original.FunctionEnvelopeCollectionPage type FunctionEnvelopeProperties = original.FunctionEnvelopeProperties type FunctionSecrets = original.FunctionSecrets type FunctionSecretsProperties = original.FunctionSecretsProperties +type GeoDistribution = original.GeoDistribution type GeoRegion = original.GeoRegion type GeoRegionCollection = original.GeoRegionCollection type GeoRegionCollectionIterator = original.GeoRegionCollectionIterator @@ -1140,6 +1151,7 @@ type UsageCollectionPage = original.UsageCollectionPage type UsageProperties = original.UsageProperties type User = original.User type UserProperties = original.UserProperties +type ValidateContainerSettingsRequest = original.ValidateContainerSettingsRequest type ValidateProperties = original.ValidateProperties type ValidateRequest = original.ValidateRequest type ValidateResponse = original.ValidateResponse @@ -1712,6 +1724,9 @@ func PossiblePublicCertificateLocationValues() []PublicCertificateLocation { func PossiblePublishingProfileFormatValues() []PublishingProfileFormat { return original.PossiblePublishingProfileFormatValues() } +func PossibleRedundancyModeValues() []RedundancyMode { + return original.PossibleRedundancyModeValues() +} func PossibleRenderingTypeValues() []RenderingType { return original.PossibleRenderingTypeValues() } diff --git a/services/web/mgmt/2018-02-01/web/client.go b/services/web/mgmt/2018-02-01/web/client.go index 339b94008541..cb5a4e9a0c3e 100644 --- a/services/web/mgmt/2018-02-01/web/client.go +++ b/services/web/mgmt/2018-02-01/web/client.go @@ -1342,6 +1342,91 @@ func (client BaseClient) ValidateResponder(resp *http.Response) (result Validate return } +// ValidateContainerSettings validate if the container settings are correct. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client BaseClient) ValidateContainerSettings(ctx context.Context, validateContainerSettingsRequest ValidateContainerSettingsRequest, resourceGroupName string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ValidateContainerSettings") + 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}}}}); err != nil { + return result, validation.NewError("web.BaseClient", "ValidateContainerSettings", err.Error()) + } + + req, err := client.ValidateContainerSettingsPreparer(ctx, validateContainerSettingsRequest, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateContainerSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateContainerSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateContainerSettings", resp, "Failure sending request") + return + } + + result, err = client.ValidateContainerSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateContainerSettings", resp, "Failure responding to request") + } + + return +} + +// ValidateContainerSettingsPreparer prepares the ValidateContainerSettings request. +func (client BaseClient) ValidateContainerSettingsPreparer(ctx context.Context, validateContainerSettingsRequest ValidateContainerSettingsRequest, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-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.Web/validateContainerSettings", pathParameters), + autorest.WithJSON(validateContainerSettingsRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateContainerSettingsSender sends the ValidateContainerSettings request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ValidateContainerSettingsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateContainerSettingsResponder handles the response to the ValidateContainerSettings request. The method always +// closes the http.Response Body. +func (client BaseClient) ValidateContainerSettingsResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ValidateMove validate whether a resource can be moved. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. diff --git a/services/web/mgmt/2018-02-01/web/models.go b/services/web/mgmt/2018-02-01/web/models.go index 5641daaffd90..d5af9ab4b30d 100644 --- a/services/web/mgmt/2018-02-01/web/models.go +++ b/services/web/mgmt/2018-02-01/web/models.go @@ -965,6 +965,27 @@ func PossiblePublishingProfileFormatValues() []PublishingProfileFormat { return []PublishingProfileFormat{FileZilla3, Ftp, WebDeploy} } +// RedundancyMode enumerates the values for redundancy mode. +type RedundancyMode string + +const ( + // RedundancyModeActiveActive ... + RedundancyModeActiveActive RedundancyMode = "ActiveActive" + // RedundancyModeFailover ... + RedundancyModeFailover RedundancyMode = "Failover" + // RedundancyModeGeoRedundant ... + RedundancyModeGeoRedundant RedundancyMode = "GeoRedundant" + // RedundancyModeManual ... + RedundancyModeManual RedundancyMode = "Manual" + // RedundancyModeNone ... + RedundancyModeNone RedundancyMode = "None" +) + +// PossibleRedundancyModeValues returns an array of possible values for the RedundancyMode const type. +func PossibleRedundancyModeValues() []RedundancyMode { + return []RedundancyMode{RedundancyModeActiveActive, RedundancyModeFailover, RedundancyModeGeoRedundant, RedundancyModeManual, RedundancyModeNone} +} + // RenderingType enumerates the values for rendering type. type RenderingType string @@ -4342,8 +4363,6 @@ type AppServicePlanPatchResourceProperties struct { Status StatusOptions `json:"status,omitempty"` // Subscription - App Service plan subscription. Subscription *string `json:"subscription,omitempty"` - // AdminSiteName - App Service plan administration site. - AdminSiteName *string `json:"adminSiteName,omitempty"` // HostingEnvironmentProfile - Specification for the App Service Environment to use for the App Service plan. HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` // MaximumNumberOfWorkers - Maximum number of instances that can be assigned to this App Service plan. @@ -4387,8 +4406,6 @@ type AppServicePlanProperties struct { Status StatusOptions `json:"status,omitempty"` // Subscription - App Service plan subscription. Subscription *string `json:"subscription,omitempty"` - // AdminSiteName - App Service plan administration site. - AdminSiteName *string `json:"adminSiteName,omitempty"` // HostingEnvironmentProfile - Specification for the App Service Environment to use for the App Service plan. HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` // MaximumNumberOfWorkers - Maximum number of instances that can be assigned to this App Service plan. @@ -10516,6 +10533,14 @@ type FunctionSecretsProperties struct { TriggerURL *string `json:"trigger_url,omitempty"` } +// GeoDistribution a global distribution definition. +type GeoDistribution struct { + // Location - Location. + Location *string `json:"location,omitempty"` + // NumberOfWorkers - NumberOfWorkers. + NumberOfWorkers *int32 `json:"numberOfWorkers,omitempty"` +} + // GeoRegion geographical region. type GeoRegion struct { // GeoRegionProperties - GeoRegion resource specific properties @@ -11857,6 +11882,12 @@ type IPSecurityRestriction struct { IPAddress *string `json:"ipAddress,omitempty"` // SubnetMask - Subnet mask for the range of IP addresses the restriction is valid for. SubnetMask *string `json:"subnetMask,omitempty"` + // VnetSubnetResourceID - Virtual network resource id + VnetSubnetResourceID *string `json:"vnetSubnetResourceId,omitempty"` + // VnetTrafficTag - (internal) Vnet traffic tag + VnetTrafficTag *int32 `json:"vnetTrafficTag,omitempty"` + // SubnetTrafficTag - (internal) Subnet traffic tag + SubnetTrafficTag *int32 `json:"subnetTrafficTag,omitempty"` // Action - Allow or Deny access for this IP range. Action *string `json:"action,omitempty"` // Tag - Defines what this IP filter will be used for. This is to support IP filtering on proxies. Possible values include: 'Default', 'XffProxy' @@ -19068,6 +19099,8 @@ type SitePatchResourceProperties struct { ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"` // ClientCertEnabled - true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` + // ClientCertExclusionPaths - client certificate authentication comma-separated exclusion paths + ClientCertExclusionPaths *string `json:"clientCertExclusionPaths,omitempty"` // HostNamesDisabled - true to disable the public hostnames of the app; otherwise, false. // If true, the app is only accessible via API management process. HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` @@ -19097,6 +19130,12 @@ type SitePatchResourceProperties struct { // HTTPSOnly - HttpsOnly: configures a web site to accept only https requests. Issues redirect for // http requests HTTPSOnly *bool `json:"httpsOnly,omitempty"` + // RedundancyMode - Site redundancy mode. Possible values include: 'RedundancyModeNone', 'RedundancyModeManual', 'RedundancyModeFailover', 'RedundancyModeActiveActive', 'RedundancyModeGeoRedundant' + RedundancyMode RedundancyMode `json:"redundancyMode,omitempty"` + // InProgressOperationID - Specifies an operation id if this site has a pending operation. + InProgressOperationID *uuid.UUID `json:"inProgressOperationId,omitempty"` + // GeoDistributions - GeoDistributions for this site + GeoDistributions *[]GeoDistribution `json:"geoDistributions,omitempty"` } // SitePhpErrorLogFlag used for getting PHP error logging flag. @@ -19250,6 +19289,8 @@ type SiteProperties struct { ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"` // ClientCertEnabled - true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` + // ClientCertExclusionPaths - client certificate authentication comma-separated exclusion paths + ClientCertExclusionPaths *string `json:"clientCertExclusionPaths,omitempty"` // HostNamesDisabled - true to disable the public hostnames of the app; otherwise, false. // If true, the app is only accessible via API management process. HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` @@ -19279,6 +19320,12 @@ type SiteProperties struct { // HTTPSOnly - HttpsOnly: configures a web site to accept only https requests. Issues redirect for // http requests HTTPSOnly *bool `json:"httpsOnly,omitempty"` + // RedundancyMode - Site redundancy mode. Possible values include: 'RedundancyModeNone', 'RedundancyModeManual', 'RedundancyModeFailover', 'RedundancyModeActiveActive', 'RedundancyModeGeoRedundant' + RedundancyMode RedundancyMode `json:"redundancyMode,omitempty"` + // InProgressOperationID - Specifies an operation id if this site has a pending operation. + InProgressOperationID *uuid.UUID `json:"inProgressOperationId,omitempty"` + // GeoDistributions - GeoDistributions for this site + GeoDistributions *[]GeoDistribution `json:"geoDistributions,omitempty"` } // SiteSeal site seal @@ -20655,6 +20702,8 @@ type StackMinorVersion struct { RuntimeVersion *string `json:"runtimeVersion,omitempty"` // IsDefault - true if this is the default minor version; otherwise, false. IsDefault *bool `json:"isDefault,omitempty"` + // IsRemoteDebuggingEnabled - true if this supports Remote Debugging, otherwise false. + IsRemoteDebuggingEnabled *bool `json:"isRemoteDebuggingEnabled,omitempty"` } // StampCapacity stamp capacity information. @@ -22660,6 +22709,22 @@ type UserProperties struct { ScmURI *string `json:"scmUri,omitempty"` } +// ValidateContainerSettingsRequest container settings validation request context +type ValidateContainerSettingsRequest struct { + // BaseURL - Base URL of the container registry + BaseURL *string `json:"baseUrl,omitempty"` + // Username - Username for to access the container registry + Username *string `json:"username,omitempty"` + // Password - Password for to access the container registry + Password *string `json:"password,omitempty"` + // Repository - Repository name (image name) + Repository *string `json:"repository,omitempty"` + // Tag - Image tag + Tag *string `json:"tag,omitempty"` + // Platform - Platform (windows or linux) + Platform *string `json:"platform,omitempty"` +} + // ValidateProperties app properties used for validation. type ValidateProperties struct { // ServerFarmID - ARM resource ID of an App Service plan that would host the app. diff --git a/services/web/mgmt/2018-02-01/web/recommendations.go b/services/web/mgmt/2018-02-01/web/recommendations.go index 068cb07ff52b..61da186219f0 100644 --- a/services/web/mgmt/2018-02-01/web/recommendations.go +++ b/services/web/mgmt/2018-02-01/web/recommendations.go @@ -41,6 +41,91 @@ func NewRecommendationsClientWithBaseURI(baseURI string, subscriptionID string) return RecommendationsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// DisableAllForHostingEnvironment disable all recommendations for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// environmentName - name of the app. +func (client RecommendationsClient) DisableAllForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableAllForHostingEnvironment") + 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}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "DisableAllForHostingEnvironment", err.Error()) + } + + req, err := client.DisableAllForHostingEnvironmentPreparer(ctx, resourceGroupName, environmentName, hostingEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.DisableAllForHostingEnvironmentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.DisableAllForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForHostingEnvironment", resp, "Failure responding to request") + } + + return +} + +// DisableAllForHostingEnvironmentPreparer prepares the DisableAllForHostingEnvironment request. +func (client RecommendationsClient) DisableAllForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "environmentName": autorest.Encode("query", environmentName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableAllForHostingEnvironmentSender sends the DisableAllForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableAllForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DisableAllForHostingEnvironmentResponder handles the response to the DisableAllForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableAllForHostingEnvironmentResponder(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 +} + // DisableAllForWebApp disable all recommendations for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -125,6 +210,93 @@ func (client RecommendationsClient) DisableAllForWebAppResponder(resp *http.Resp return } +// DisableRecommendationForHostingEnvironment disables the specific rule for a web site permanently. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// environmentName - site name +// name - rule name +func (client RecommendationsClient) DisableRecommendationForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableRecommendationForHostingEnvironment") + 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}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", err.Error()) + } + + req, err := client.DisableRecommendationForHostingEnvironmentPreparer(ctx, resourceGroupName, environmentName, name, hostingEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.DisableRecommendationForHostingEnvironmentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.DisableRecommendationForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", resp, "Failure responding to request") + } + + return +} + +// DisableRecommendationForHostingEnvironmentPreparer prepares the DisableRecommendationForHostingEnvironment request. +func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "environmentName": autorest.Encode("query", environmentName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableRecommendationForHostingEnvironmentSender sends the DisableRecommendationForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DisableRecommendationForHostingEnvironmentResponder handles the response to the DisableRecommendationForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + // DisableRecommendationForSite disables the specific rule for a web site permanently. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -286,6 +458,102 @@ func (client RecommendationsClient) DisableRecommendationForSubscriptionResponde return } +// GetRuleDetailsByHostingEnvironment get a recommendation rule for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// hostingEnvironmentName - name of the hosting environment. +// name - name of the recommendation. +// updateSeen - specify true to update the last-seen timestamp of the recommendation object. +// recommendationID - the GUID of the recommendation object if you query an expired one. You don't need to +// specify it to query an active entry. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, updateSeen *bool, recommendationID string) (result RecommendationRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.GetRuleDetailsByHostingEnvironment") + 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}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", err.Error()) + } + + req, err := client.GetRuleDetailsByHostingEnvironmentPreparer(ctx, resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.GetRuleDetailsByHostingEnvironmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.GetRuleDetailsByHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", resp, "Failure responding to request") + } + + return +} + +// GetRuleDetailsByHostingEnvironmentPreparer prepares the GetRuleDetailsByHostingEnvironment request. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, updateSeen *bool, recommendationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if updateSeen != nil { + queryParameters["updateSeen"] = autorest.Encode("query", *updateSeen) + } + if len(recommendationID) > 0 { + queryParameters["recommendationId"] = autorest.Encode("query", recommendationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRuleDetailsByHostingEnvironmentSender sends the GetRuleDetailsByHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetRuleDetailsByHostingEnvironmentResponder handles the response to the GetRuleDetailsByHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentResponder(resp *http.Response) (result RecommendationRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetRuleDetailsByWebApp get a recommendation rule for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -504,6 +772,140 @@ func (client RecommendationsClient) ListComplete(ctx context.Context, featured * return } +// ListHistoryForHostingEnvironment get past recommendations for an app, optionally specified by the time range. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// hostingEnvironmentName - name of the hosting environment. +// expiredOnly - specify false to return all recommendations. The default is true, +// which returns only expired recommendations. +// filter - filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq +// 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq +// duration'[PT1H|PT1M|P1D] +func (client RecommendationsClient) ListHistoryForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListHistoryForHostingEnvironment") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.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}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ListHistoryForHostingEnvironment", err.Error()) + } + + result.fn = client.listHistoryForHostingEnvironmentNextResults + req, err := client.ListHistoryForHostingEnvironmentPreparer(ctx, resourceGroupName, hostingEnvironmentName, expiredOnly, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.ListHistoryForHostingEnvironmentSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForHostingEnvironment", resp, "Failure sending request") + return + } + + result.rc, err = client.ListHistoryForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForHostingEnvironment", resp, "Failure responding to request") + } + + return +} + +// ListHistoryForHostingEnvironmentPreparer prepares the ListHistoryForHostingEnvironment request. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if expiredOnly != nil { + queryParameters["expiredOnly"] = autorest.Encode("query", *expiredOnly) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHistoryForHostingEnvironmentSender sends the ListHistoryForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListHistoryForHostingEnvironmentResponder handles the response to the ListHistoryForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHistoryForHostingEnvironmentNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listHistoryForHostingEnvironmentNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForHostingEnvironmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHistoryForHostingEnvironmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForHostingEnvironmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHistoryForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForHostingEnvironmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHistoryForHostingEnvironmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentComplete(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListHistoryForHostingEnvironment") + 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.ListHistoryForHostingEnvironment(ctx, resourceGroupName, hostingEnvironmentName, expiredOnly, filter) + return +} + // ListHistoryForWebApp get past recommendations for an app, optionally specified by the time range. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -638,6 +1040,139 @@ func (client RecommendationsClient) ListHistoryForWebAppComplete(ctx context.Con return } +// ListRecommendedRulesForHostingEnvironment get all recommendations for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// hostingEnvironmentName - name of the app. +// featured - specify true to return only the most critical recommendations. The default is +// false, which returns all recommendations. +// filter - return only channels specified in the filter. Filter is specified by using OData syntax. Example: +// $filter=channel eq 'Api' or channel eq 'Notification' +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListRecommendedRulesForHostingEnvironment") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.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}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", err.Error()) + } + + result.fn = client.listRecommendedRulesForHostingEnvironmentNextResults + req, err := client.ListRecommendedRulesForHostingEnvironmentPreparer(ctx, resourceGroupName, hostingEnvironmentName, featured, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.ListRecommendedRulesForHostingEnvironmentSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", resp, "Failure sending request") + return + } + + result.rc, err = client.ListRecommendedRulesForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", resp, "Failure responding to request") + } + + return +} + +// ListRecommendedRulesForHostingEnvironmentPreparer prepares the ListRecommendedRulesForHostingEnvironment request. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if featured != nil { + queryParameters["featured"] = autorest.Encode("query", *featured) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRecommendedRulesForHostingEnvironmentSender sends the ListRecommendedRulesForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListRecommendedRulesForHostingEnvironmentResponder handles the response to the ListRecommendedRulesForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listRecommendedRulesForHostingEnvironmentNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listRecommendedRulesForHostingEnvironmentNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForHostingEnvironmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListRecommendedRulesForHostingEnvironmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForHostingEnvironmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListRecommendedRulesForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForHostingEnvironmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListRecommendedRulesForHostingEnvironmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentComplete(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListRecommendedRulesForHostingEnvironment") + 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.ListRecommendedRulesForHostingEnvironment(ctx, resourceGroupName, hostingEnvironmentName, featured, filter) + return +} + // ListRecommendedRulesForWebApp get all recommendations for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -842,6 +1377,91 @@ func (client RecommendationsClient) ResetAllFiltersResponder(resp *http.Response return } +// ResetAllFiltersForHostingEnvironment reset all recommendation opt-out settings for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// environmentName - name of the app. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ResetAllFiltersForHostingEnvironment") + 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}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", err.Error()) + } + + req, err := client.ResetAllFiltersForHostingEnvironmentPreparer(ctx, resourceGroupName, environmentName, hostingEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.ResetAllFiltersForHostingEnvironmentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.ResetAllFiltersForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", resp, "Failure responding to request") + } + + return +} + +// ResetAllFiltersForHostingEnvironmentPreparer prepares the ResetAllFiltersForHostingEnvironment request. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "environmentName": autorest.Encode("query", environmentName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAllFiltersForHostingEnvironmentSender sends the ResetAllFiltersForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ResetAllFiltersForHostingEnvironmentResponder handles the response to the ResetAllFiltersForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentResponder(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 +} + // ResetAllFiltersForWebApp reset all recommendation opt-out settings for an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. diff --git a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go index e86242ca72b6..1ea8e600b2d2 100644 --- a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go @@ -40,6 +40,7 @@ type BaseClientAPI interface { UpdatePublishingUser(ctx context.Context, userDetails web.User) (result web.User, err error) UpdateSourceControl(ctx context.Context, sourceControlType string, requestMessage web.SourceControl) (result web.SourceControl, err error) Validate(ctx context.Context, resourceGroupName string, validateRequest web.ValidateRequest) (result web.ValidateResponse, err error) + ValidateContainerSettings(ctx context.Context, validateContainerSettingsRequest web.ValidateContainerSettingsRequest, resourceGroupName string) (result web.SetObject, err error) ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope web.CsmMoveResourceEnvelope) (result autorest.Response, err error) VerifyHostingEnvironmentVnet(ctx context.Context, parameters web.VnetParameters) (result web.VnetValidationFailureDetails, err error) } @@ -174,14 +175,20 @@ var _ ProviderClientAPI = (*web.ProviderClient)(nil) // RecommendationsClientAPI contains the set of methods on the RecommendationsClient type. type RecommendationsClientAPI interface { + DisableAllForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) DisableAllForWebApp(ctx context.Context, resourceGroupName string, siteName string) (result autorest.Response, err error) + DisableRecommendationForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string) (result autorest.Response, err error) DisableRecommendationForSite(ctx context.Context, resourceGroupName string, siteName string, name string) (result autorest.Response, err error) DisableRecommendationForSubscription(ctx context.Context, name string) (result autorest.Response, err error) + GetRuleDetailsByHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, updateSeen *bool, recommendationID string) (result web.RecommendationRule, err error) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (result web.RecommendationRule, err error) List(ctx context.Context, featured *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListHistoryForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result web.RecommendationCollectionPage, err error) ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, expiredOnly *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListRecommendedRulesForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result web.RecommendationCollectionPage, err error) ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result web.RecommendationCollectionPage, err error) ResetAllFilters(ctx context.Context) (result autorest.Response, err error) + ResetAllFiltersForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) ResetAllFiltersForWebApp(ctx context.Context, resourceGroupName string, siteName string) (result autorest.Response, err error) } From 089ae0f2e4130c0d4ae6c81a1474d6cb936b4eef Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 26 Feb 2019 11:58:43 -0800 Subject: [PATCH 2/5] Generated from b358cc2d9448ec292d6d67de69f587080731c85e (#4154) Add examples of 201 response to AppServicePlans_CreateOrUpdate. --- services/web/mgmt/2016-09-01/web/appserviceplans.go | 2 +- services/web/mgmt/2018-02-01/web/appserviceplans.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/mgmt/2016-09-01/web/appserviceplans.go b/services/web/mgmt/2016-09-01/web/appserviceplans.go index 5dd5c435ebb0..c6744beb28b8 100644 --- a/services/web/mgmt/2016-09-01/web/appserviceplans.go +++ b/services/web/mgmt/2016-09-01/web/appserviceplans.go @@ -125,7 +125,7 @@ func (client AppServicePlansClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/web/mgmt/2018-02-01/web/appserviceplans.go b/services/web/mgmt/2018-02-01/web/appserviceplans.go index 9da24c8b858d..b75e4c6bfdaf 100644 --- a/services/web/mgmt/2018-02-01/web/appserviceplans.go +++ b/services/web/mgmt/2018-02-01/web/appserviceplans.go @@ -122,7 +122,7 @@ func (client AppServicePlansClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} From ab43d760b54222b65fb223ae7b94bd9ede92cf26 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 4 Mar 2019 08:15:17 -0800 Subject: [PATCH 3/5] Generated from 28eed48f854b2f1ebe692a3d316788a6dff3758d (#4196) fix linterdiff tool --- profiles/latest/web/mgmt/web/models.go | 1 + profiles/preview/web/mgmt/web/models.go | 1 + services/web/mgmt/2018-02-01/web/models.go | 30 ++++++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index f0e47dfad48c..0120488714d2 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -931,6 +931,7 @@ type MSDeployLogProperties = original.MSDeployLogProperties type MSDeployStatus = original.MSDeployStatus type MSDeployStatusProperties = original.MSDeployStatusProperties type ManagedServiceIdentity = original.ManagedServiceIdentity +type ManagedServiceIdentityUserAssignedIdentitiesValue = original.ManagedServiceIdentityUserAssignedIdentitiesValue type MetricAvailabilily = original.MetricAvailabilily type MetricAvailability = original.MetricAvailability type MetricDefinition = original.MetricDefinition diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 6af38f210a64..84ac2b431522 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -931,6 +931,7 @@ type MSDeployLogProperties = original.MSDeployLogProperties type MSDeployStatus = original.MSDeployStatus type MSDeployStatusProperties = original.MSDeployStatusProperties type ManagedServiceIdentity = original.ManagedServiceIdentity +type ManagedServiceIdentityUserAssignedIdentitiesValue = original.ManagedServiceIdentityUserAssignedIdentitiesValue type MetricAvailabilily = original.MetricAvailabilily type MetricAvailability = original.MetricAvailability type MetricDefinition = original.MetricDefinition diff --git a/services/web/mgmt/2018-02-01/web/models.go b/services/web/mgmt/2018-02-01/web/models.go index d5af9ab4b30d..bdca052f48d4 100644 --- a/services/web/mgmt/2018-02-01/web/models.go +++ b/services/web/mgmt/2018-02-01/web/models.go @@ -12258,8 +12258,34 @@ type ManagedServiceIdentity struct { TenantID *string `json:"tenantId,omitempty"` // PrincipalID - Principal Id of managed service identity. PrincipalID *string `json:"principalId,omitempty"` - // IdentityIds - Array of UserAssigned managed service identities. - IdentityIds *[]string `json:"identityIds,omitempty"` + // UserAssignedIdentities - The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentity. +func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if msi.Type != "" { + objectMap["type"] = msi.Type + } + if msi.TenantID != nil { + objectMap["tenantId"] = msi.TenantID + } + if msi.PrincipalID != nil { + objectMap["principalId"] = msi.PrincipalID + } + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ManagedServiceIdentityUserAssignedIdentitiesValue ... +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - Principal Id of user assigned identity + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - Client Id of user assigned identity + ClientID *string `json:"clientId,omitempty"` } // MetricAvailabilily metric availability and retention. From 9a8b87d97d507c996068b71e24f97727c7bb4af5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 4 Mar 2019 14:31:23 -0800 Subject: [PATCH 4/5] [AutoPR web/resource-manager] [Hub Generated] Review request for Microsoft.Web to add version 2018-02-01 (#3999) * Generated from 1bf88782fb8748bb8bad35ccd046b7a7fb16ff3c Add Hosting Environment network dependencies * Generated from b772c09b4e8132be83594f0a834cf7b363445a3c Address PR description feedback * Generated from 61d39f048374e3c8dd07112e7d9e8554e8664ea5 Fix casing * Generated from 66114e58530dd7027b63182defcf1c8f73d1d502 Remove incorrect pagination from examples. --- profiles/latest/web/mgmt/web/models.go | 6 + profiles/preview/web/mgmt/web/models.go | 6 + .../2018-02-01/web/appserviceenvironments.go | 172 ++++++++++++++++++ services/web/mgmt/2018-02-01/web/models.go | 54 ++++++ .../mgmt/2018-02-01/web/webapi/interfaces.go | 2 + 5 files changed, 240 insertions(+) diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index 0120488714d2..a7221988266a 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -863,6 +863,8 @@ type DomainRegistrationProviderClient = original.DomainRegistrationProviderClien type DomainsClient = original.DomainsClient type DomainsCreateOrUpdateFuture = original.DomainsCreateOrUpdateFuture type EnabledConfig = original.EnabledConfig +type EndpointDependency = original.EndpointDependency +type EndpointDetail = original.EndpointDetail type ErrorEntity = original.ErrorEntity type Experiments = original.Experiments type FileSystemApplicationLogsConfig = original.FileSystemApplicationLogsConfig @@ -908,6 +910,7 @@ type IdentifierCollection = original.IdentifierCollection type IdentifierCollectionIterator = original.IdentifierCollectionIterator type IdentifierCollectionPage = original.IdentifierCollectionPage type IdentifierProperties = original.IdentifierProperties +type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -917,8 +920,10 @@ type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction type ListHostingEnvironmentDiagnostics = original.ListHostingEnvironmentDiagnostics +type ListInboundEnvironmentEndpoint = original.ListInboundEnvironmentEndpoint type ListNetworkTrace = original.ListNetworkTrace type ListOperation = original.ListOperation +type ListOutboundEnvironmentEndpoint = original.ListOutboundEnvironmentEndpoint type ListVnetInfo = original.ListVnetInfo type ListVnetRoute = original.ListVnetRoute type LocalizableString = original.LocalizableString @@ -951,6 +956,7 @@ type NetworkFeatures = original.NetworkFeatures type NetworkFeaturesProperties = original.NetworkFeaturesProperties type NetworkTrace = original.NetworkTrace type Operation = original.Operation +type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint type PerfMonCounterCollection = original.PerfMonCounterCollection type PerfMonCounterCollectionIterator = original.PerfMonCounterCollectionIterator type PerfMonCounterCollectionPage = original.PerfMonCounterCollectionPage diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 84ac2b431522..8b9574d16897 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -863,6 +863,8 @@ type DomainRegistrationProviderClient = original.DomainRegistrationProviderClien type DomainsClient = original.DomainsClient type DomainsCreateOrUpdateFuture = original.DomainsCreateOrUpdateFuture type EnabledConfig = original.EnabledConfig +type EndpointDependency = original.EndpointDependency +type EndpointDetail = original.EndpointDetail type ErrorEntity = original.ErrorEntity type Experiments = original.Experiments type FileSystemApplicationLogsConfig = original.FileSystemApplicationLogsConfig @@ -908,6 +910,7 @@ type IdentifierCollection = original.IdentifierCollection type IdentifierCollectionIterator = original.IdentifierCollectionIterator type IdentifierCollectionPage = original.IdentifierCollectionPage type IdentifierProperties = original.IdentifierProperties +type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -917,8 +920,10 @@ type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction type ListHostingEnvironmentDiagnostics = original.ListHostingEnvironmentDiagnostics +type ListInboundEnvironmentEndpoint = original.ListInboundEnvironmentEndpoint type ListNetworkTrace = original.ListNetworkTrace type ListOperation = original.ListOperation +type ListOutboundEnvironmentEndpoint = original.ListOutboundEnvironmentEndpoint type ListVnetInfo = original.ListVnetInfo type ListVnetRoute = original.ListVnetRoute type LocalizableString = original.LocalizableString @@ -951,6 +956,7 @@ type NetworkFeatures = original.NetworkFeatures type NetworkFeaturesProperties = original.NetworkFeaturesProperties type NetworkTrace = original.NetworkTrace type Operation = original.Operation +type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint type PerfMonCounterCollection = original.PerfMonCounterCollection type PerfMonCounterCollectionIterator = original.PerfMonCounterCollectionIterator type PerfMonCounterCollectionPage = original.PerfMonCounterCollectionPage diff --git a/services/web/mgmt/2018-02-01/web/appserviceenvironments.go b/services/web/mgmt/2018-02-01/web/appserviceenvironments.go index a954295efb90..bd876c788a0b 100644 --- a/services/web/mgmt/2018-02-01/web/appserviceenvironments.go +++ b/services/web/mgmt/2018-02-01/web/appserviceenvironments.go @@ -705,6 +705,92 @@ func (client AppServiceEnvironmentsClient) GetDiagnosticsItemResponder(resp *htt return } +// GetInboundNetworkDependenciesEndpoints get the network endpoints of all inbound dependencies of an App Service +// Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result ListInboundEnvironmentEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") + 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}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", err.Error()) + } + + req, err := client.GetInboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + } + + return +} + +// GetInboundNetworkDependenciesEndpointsPreparer prepares the GetInboundNetworkDependenciesEndpoints request. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-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.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInboundNetworkDependenciesEndpointsSender sends the GetInboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetInboundNetworkDependenciesEndpointsResponder handles the response to the GetInboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListInboundEnvironmentEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetMultiRolePool get properties of a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -790,6 +876,92 @@ func (client AppServiceEnvironmentsClient) GetMultiRolePoolResponder(resp *http. return } +// GetOutboundNetworkDependenciesEndpoints get the network endpoints of all outbound dependencies of an App Service +// Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result ListOutboundEnvironmentEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") + 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}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", err.Error()) + } + + req, err := client.GetOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + } + + return +} + +// GetOutboundNetworkDependenciesEndpointsPreparer prepares the GetOutboundNetworkDependenciesEndpoints request. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-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.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutboundNetworkDependenciesEndpointsSender sends the GetOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetOutboundNetworkDependenciesEndpointsResponder handles the response to the GetOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListOutboundEnvironmentEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetWorkerPool get properties of a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. diff --git a/services/web/mgmt/2018-02-01/web/models.go b/services/web/mgmt/2018-02-01/web/models.go index bdca052f48d4..419c43da1364 100644 --- a/services/web/mgmt/2018-02-01/web/models.go +++ b/services/web/mgmt/2018-02-01/web/models.go @@ -10090,6 +10090,28 @@ type EnabledConfig struct { Enabled *bool `json:"enabled,omitempty"` } +// EndpointDependency a domain name that a service is reached at, including details of the current +// connection status. +type EndpointDependency struct { + // DomainName - The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + // EndpointDetails - The IP Addresses and Ports used when connecting to DomainName. + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} + +// EndpointDetail current TCP connectivity information from the App Service Environment to a single +// endpoint. +type EndpointDetail struct { + // IPAddress - An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + // Port - The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` + // Latency - The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + Latency *float64 `json:"latency,omitempty"` + // IsAccessable - Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + IsAccessable *bool `json:"isAccessable,omitempty"` +} + // ErrorEntity body of the error response returned from the API. type ErrorEntity struct { // ExtendedCode - Type of error. @@ -11873,6 +11895,17 @@ type IdentifierProperties struct { ID *string `json:"id,omitempty"` } +// InboundEnvironmentEndpoint the IP Addresses and Ports that require inbound network access to and within +// the subnet of the App Service Environment. +type InboundEnvironmentEndpoint struct { + // Description - Short text describing the purpose of the network traffic. + Description *string `json:"description,omitempty"` + // Endpoints - The IP addresses that network traffic will originate from in cidr notation. + Endpoints *[]string `json:"endpoints,omitempty"` + // Ports - The ports that network traffic will arrive to the App Service Environment at. + Ports *[]string `json:"ports,omitempty"` +} + // IPSecurityRestriction IP security restriction on an app. type IPSecurityRestriction struct { // IPAddress - IP address the security restriction is valid for. @@ -12211,6 +12244,12 @@ type ListHostingEnvironmentDiagnostics struct { Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"` } +// ListInboundEnvironmentEndpoint ... +type ListInboundEnvironmentEndpoint struct { + autorest.Response `json:"-"` + Value *[]InboundEnvironmentEndpoint `json:"value,omitempty"` +} + // ListNetworkTrace ... type ListNetworkTrace struct { autorest.Response `json:"-"` @@ -12223,6 +12262,12 @@ type ListOperation struct { Value *[]Operation `json:"value,omitempty"` } +// ListOutboundEnvironmentEndpoint ... +type ListOutboundEnvironmentEndpoint struct { + autorest.Response `json:"-"` + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` +} + // ListVnetInfo ... type ListVnetInfo struct { autorest.Response `json:"-"` @@ -13316,6 +13361,15 @@ type Operation struct { GeoMasterOperationID *uuid.UUID `json:"geoMasterOperationId,omitempty"` } +// OutboundEnvironmentEndpoint endpoints accessed for a common purpose that the App Service Environment +// requires outbound network access to. +type OutboundEnvironmentEndpoint struct { + // Category - The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + Category *string `json:"category,omitempty"` + // Endpoints - The endpoints that the App Service Environment reaches the service at. + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` +} + // PerfMonCounterCollection collection of performance monitor counters. type PerfMonCounterCollection struct { autorest.Response `json:"-"` diff --git a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go index 1ea8e600b2d2..4286cbad75ec 100644 --- a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go @@ -558,7 +558,9 @@ type AppServiceEnvironmentsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, name string, forceDelete *bool) (result web.AppServiceEnvironmentsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentResource, err error) GetDiagnosticsItem(ctx context.Context, resourceGroupName string, name string, diagnosticsName string) (result web.HostingEnvironmentDiagnostics, err error) + GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.ListInboundEnvironmentEndpoint, err error) GetMultiRolePool(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolResource, err error) + GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.ListOutboundEnvironmentEndpoint, err error) GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.WorkerPoolResource, err error) List(ctx context.Context) (result web.AppServiceEnvironmentCollectionPage, err error) ListAppServicePlans(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlanCollectionPage, err error) From a78182dd4d588c92d141c99a898d30654667cce6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 5 Mar 2019 11:14:37 -0800 Subject: [PATCH 5/5] Generated from 13b235cccbe934e60dba491a2a49edcae9c7f275 (#4216) Fix Hosting Environment Network Dependencies pagination --- profiles/latest/web/mgmt/web/models.go | 20 +- profiles/preview/web/mgmt/web/models.go | 20 +- .../2018-02-01/web/appserviceenvironments.go | 104 +++++- services/web/mgmt/2018-02-01/web/models.go | 306 +++++++++++++++++- .../mgmt/2018-02-01/web/webapi/interfaces.go | 4 +- 5 files changed, 422 insertions(+), 32 deletions(-) diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index a7221988266a..1b6a79758ade 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -911,6 +911,9 @@ type IdentifierCollectionIterator = original.IdentifierCollectionIterator type IdentifierCollectionPage = original.IdentifierCollectionPage type IdentifierProperties = original.IdentifierProperties type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint +type InboundEnvironmentEndpointCollection = original.InboundEnvironmentEndpointCollection +type InboundEnvironmentEndpointCollectionIterator = original.InboundEnvironmentEndpointCollectionIterator +type InboundEnvironmentEndpointCollectionPage = original.InboundEnvironmentEndpointCollectionPage type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -920,10 +923,8 @@ type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction type ListHostingEnvironmentDiagnostics = original.ListHostingEnvironmentDiagnostics -type ListInboundEnvironmentEndpoint = original.ListInboundEnvironmentEndpoint type ListNetworkTrace = original.ListNetworkTrace type ListOperation = original.ListOperation -type ListOutboundEnvironmentEndpoint = original.ListOutboundEnvironmentEndpoint type ListVnetInfo = original.ListVnetInfo type ListVnetRoute = original.ListVnetRoute type LocalizableString = original.LocalizableString @@ -957,6 +958,9 @@ type NetworkFeaturesProperties = original.NetworkFeaturesProperties type NetworkTrace = original.NetworkTrace type Operation = original.Operation type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection = original.OutboundEnvironmentEndpointCollection +type OutboundEnvironmentEndpointCollectionIterator = original.OutboundEnvironmentEndpointCollectionIterator +type OutboundEnvironmentEndpointCollectionPage = original.OutboundEnvironmentEndpointCollectionPage type PerfMonCounterCollection = original.PerfMonCounterCollection type PerfMonCounterCollectionIterator = original.PerfMonCounterCollectionIterator type PerfMonCounterCollectionPage = original.PerfMonCounterCollectionPage @@ -1404,6 +1408,12 @@ func NewIdentifierCollectionIterator(page IdentifierCollectionPage) IdentifierCo func NewIdentifierCollectionPage(getNextPage func(context.Context, IdentifierCollection) (IdentifierCollection, error)) IdentifierCollectionPage { return original.NewIdentifierCollectionPage(getNextPage) } +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return original.NewInboundEnvironmentEndpointCollectionIterator(page) +} +func NewInboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return original.NewInboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { return original.NewJobCollectionIterator(page) } @@ -1416,6 +1426,12 @@ func NewNameIdentifierCollectionIterator(page NameIdentifierCollectionPage) Name func NewNameIdentifierCollectionPage(getNextPage func(context.Context, NameIdentifierCollection) (NameIdentifierCollection, error)) NameIdentifierCollectionPage { return original.NewNameIdentifierCollectionPage(getNextPage) } +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return original.NewOutboundEnvironmentEndpointCollectionIterator(page) +} +func NewOutboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return original.NewOutboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewPerfMonCounterCollectionIterator(page PerfMonCounterCollectionPage) PerfMonCounterCollectionIterator { return original.NewPerfMonCounterCollectionIterator(page) } diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 8b9574d16897..71b0388bc04e 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -911,6 +911,9 @@ type IdentifierCollectionIterator = original.IdentifierCollectionIterator type IdentifierCollectionPage = original.IdentifierCollectionPage type IdentifierProperties = original.IdentifierProperties type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint +type InboundEnvironmentEndpointCollection = original.InboundEnvironmentEndpointCollection +type InboundEnvironmentEndpointCollectionIterator = original.InboundEnvironmentEndpointCollectionIterator +type InboundEnvironmentEndpointCollectionPage = original.InboundEnvironmentEndpointCollectionPage type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -920,10 +923,8 @@ type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction type ListHostingEnvironmentDiagnostics = original.ListHostingEnvironmentDiagnostics -type ListInboundEnvironmentEndpoint = original.ListInboundEnvironmentEndpoint type ListNetworkTrace = original.ListNetworkTrace type ListOperation = original.ListOperation -type ListOutboundEnvironmentEndpoint = original.ListOutboundEnvironmentEndpoint type ListVnetInfo = original.ListVnetInfo type ListVnetRoute = original.ListVnetRoute type LocalizableString = original.LocalizableString @@ -957,6 +958,9 @@ type NetworkFeaturesProperties = original.NetworkFeaturesProperties type NetworkTrace = original.NetworkTrace type Operation = original.Operation type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection = original.OutboundEnvironmentEndpointCollection +type OutboundEnvironmentEndpointCollectionIterator = original.OutboundEnvironmentEndpointCollectionIterator +type OutboundEnvironmentEndpointCollectionPage = original.OutboundEnvironmentEndpointCollectionPage type PerfMonCounterCollection = original.PerfMonCounterCollection type PerfMonCounterCollectionIterator = original.PerfMonCounterCollectionIterator type PerfMonCounterCollectionPage = original.PerfMonCounterCollectionPage @@ -1404,6 +1408,12 @@ func NewIdentifierCollectionIterator(page IdentifierCollectionPage) IdentifierCo func NewIdentifierCollectionPage(getNextPage func(context.Context, IdentifierCollection) (IdentifierCollection, error)) IdentifierCollectionPage { return original.NewIdentifierCollectionPage(getNextPage) } +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return original.NewInboundEnvironmentEndpointCollectionIterator(page) +} +func NewInboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return original.NewInboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { return original.NewJobCollectionIterator(page) } @@ -1416,6 +1426,12 @@ func NewNameIdentifierCollectionIterator(page NameIdentifierCollectionPage) Name func NewNameIdentifierCollectionPage(getNextPage func(context.Context, NameIdentifierCollection) (NameIdentifierCollection, error)) NameIdentifierCollectionPage { return original.NewNameIdentifierCollectionPage(getNextPage) } +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return original.NewOutboundEnvironmentEndpointCollectionIterator(page) +} +func NewOutboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return original.NewOutboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewPerfMonCounterCollectionIterator(page PerfMonCounterCollectionPage) PerfMonCounterCollectionIterator { return original.NewPerfMonCounterCollectionIterator(page) } diff --git a/services/web/mgmt/2018-02-01/web/appserviceenvironments.go b/services/web/mgmt/2018-02-01/web/appserviceenvironments.go index bd876c788a0b..5afa46726662 100644 --- a/services/web/mgmt/2018-02-01/web/appserviceenvironments.go +++ b/services/web/mgmt/2018-02-01/web/appserviceenvironments.go @@ -710,13 +710,13 @@ func (client AppServiceEnvironmentsClient) GetDiagnosticsItemResponder(resp *htt // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result ListInboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result InboundEnvironmentEndpointCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.ieec.Response.Response != nil { + sc = result.ieec.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -729,6 +729,7 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", err.Error()) } + result.fn = client.getInboundNetworkDependenciesEndpointsNextResults req, err := client.GetInboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", nil, "Failure preparing request") @@ -737,12 +738,12 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.ieec.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure sending request") return } - result, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + result.ieec, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure responding to request") } @@ -780,17 +781,54 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint // GetInboundNetworkDependenciesEndpointsResponder handles the response to the GetInboundNetworkDependenciesEndpoints request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListInboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result InboundEnvironmentEndpointCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// getInboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getInboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults InboundEnvironmentEndpointCollection) (result InboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.inboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetInboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result InboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") + 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.GetInboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + // GetMultiRolePool get properties of a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -881,13 +919,13 @@ func (client AppServiceEnvironmentsClient) GetMultiRolePoolResponder(resp *http. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result ListOutboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.oeec.Response.Response != nil { + sc = result.oeec.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -900,6 +938,7 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", err.Error()) } + result.fn = client.getOutboundNetworkDependenciesEndpointsNextResults req, err := client.GetOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") @@ -908,12 +947,12 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.oeec.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") return } - result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + result.oeec, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") } @@ -951,17 +990,54 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin // GetOutboundNetworkDependenciesEndpointsResponder handles the response to the GetOutboundNetworkDependenciesEndpoints request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListOutboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundEnvironmentEndpointCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// getOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundEnvironmentEndpointCollection) (result OutboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.outboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") + 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.GetOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + // GetWorkerPool get properties of a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. diff --git a/services/web/mgmt/2018-02-01/web/models.go b/services/web/mgmt/2018-02-01/web/models.go index 419c43da1364..42749a2319b4 100644 --- a/services/web/mgmt/2018-02-01/web/models.go +++ b/services/web/mgmt/2018-02-01/web/models.go @@ -11906,6 +11906,153 @@ type InboundEnvironmentEndpoint struct { Ports *[]string `json:"ports,omitempty"` } +// InboundEnvironmentEndpointCollection collection of Inbound Environment Endpoints +type InboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]InboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// InboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// InboundEnvironmentEndpoint values. +type InboundEnvironmentEndpointCollectionIterator struct { + i int + page InboundEnvironmentEndpointCollectionPage +} + +// 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 *InboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InboundEnvironmentEndpointCollectionIterator.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 *InboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InboundEnvironmentEndpointCollectionIterator) 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 InboundEnvironmentEndpointCollectionIterator) Response() InboundEnvironmentEndpointCollection { + 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 InboundEnvironmentEndpointCollectionIterator) Value() InboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return InboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InboundEnvironmentEndpointCollectionIterator type. +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return InboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ieec InboundEnvironmentEndpointCollection) IsEmpty() bool { + return ieec.Value == nil || len(*ieec.Value) == 0 +} + +// inboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ieec InboundEnvironmentEndpointCollection) inboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ieec.NextLink == nil || len(to.String(ieec.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ieec.NextLink))) +} + +// InboundEnvironmentEndpointCollectionPage contains a page of InboundEnvironmentEndpoint values. +type InboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error) + ieec InboundEnvironmentEndpointCollection +} + +// 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 *InboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InboundEnvironmentEndpointCollectionPage.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.ieec) + if err != nil { + return err + } + page.ieec = 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 *InboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.ieec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InboundEnvironmentEndpointCollectionPage) Response() InboundEnvironmentEndpointCollection { + return page.ieec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InboundEnvironmentEndpointCollectionPage) Values() []InboundEnvironmentEndpoint { + if page.ieec.IsEmpty() { + return nil + } + return *page.ieec.Value +} + +// Creates a new instance of the InboundEnvironmentEndpointCollectionPage type. +func NewInboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return InboundEnvironmentEndpointCollectionPage{fn: getNextPage} +} + // IPSecurityRestriction IP security restriction on an app. type IPSecurityRestriction struct { // IPAddress - IP address the security restriction is valid for. @@ -12244,12 +12391,6 @@ type ListHostingEnvironmentDiagnostics struct { Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"` } -// ListInboundEnvironmentEndpoint ... -type ListInboundEnvironmentEndpoint struct { - autorest.Response `json:"-"` - Value *[]InboundEnvironmentEndpoint `json:"value,omitempty"` -} - // ListNetworkTrace ... type ListNetworkTrace struct { autorest.Response `json:"-"` @@ -12262,12 +12403,6 @@ type ListOperation struct { Value *[]Operation `json:"value,omitempty"` } -// ListOutboundEnvironmentEndpoint ... -type ListOutboundEnvironmentEndpoint struct { - autorest.Response `json:"-"` - Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` -} - // ListVnetInfo ... type ListVnetInfo struct { autorest.Response `json:"-"` @@ -13370,6 +13505,153 @@ type OutboundEnvironmentEndpoint struct { Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` } +// OutboundEnvironmentEndpointCollection collection of Outbound Environment Endpoints +type OutboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// OutboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionIterator struct { + i int + page OutboundEnvironmentEndpointCollectionPage +} + +// 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 *OutboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionIterator.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 *OutboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundEnvironmentEndpointCollectionIterator) 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 OutboundEnvironmentEndpointCollectionIterator) Response() OutboundEnvironmentEndpointCollection { + 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 OutboundEnvironmentEndpointCollectionIterator) Value() OutboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return OutboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionIterator type. +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return OutboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oeec OutboundEnvironmentEndpointCollection) IsEmpty() bool { + return oeec.Value == nil || len(*oeec.Value) == 0 +} + +// outboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oeec OutboundEnvironmentEndpointCollection) outboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if oeec.NextLink == nil || len(to.String(oeec.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oeec.NextLink))) +} + +// OutboundEnvironmentEndpointCollectionPage contains a page of OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error) + oeec OutboundEnvironmentEndpointCollection +} + +// 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 *OutboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionPage.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.oeec) + if err != nil { + return err + } + page.oeec = 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 *OutboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.oeec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundEnvironmentEndpointCollectionPage) Response() OutboundEnvironmentEndpointCollection { + return page.oeec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundEnvironmentEndpointCollectionPage) Values() []OutboundEnvironmentEndpoint { + if page.oeec.IsEmpty() { + return nil + } + return *page.oeec.Value +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionPage type. +func NewOutboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return OutboundEnvironmentEndpointCollectionPage{fn: getNextPage} +} + // PerfMonCounterCollection collection of performance monitor counters. type PerfMonCounterCollection struct { autorest.Response `json:"-"` diff --git a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go index 4286cbad75ec..ce20c093071c 100644 --- a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go @@ -558,9 +558,9 @@ type AppServiceEnvironmentsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, name string, forceDelete *bool) (result web.AppServiceEnvironmentsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentResource, err error) GetDiagnosticsItem(ctx context.Context, resourceGroupName string, name string, diagnosticsName string) (result web.HostingEnvironmentDiagnostics, err error) - GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.ListInboundEnvironmentEndpoint, err error) + GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.InboundEnvironmentEndpointCollectionPage, err error) GetMultiRolePool(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolResource, err error) - GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.ListOutboundEnvironmentEndpoint, err error) + GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.OutboundEnvironmentEndpointCollectionPage, err error) GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.WorkerPoolResource, err error) List(ctx context.Context) (result web.AppServiceEnvironmentCollectionPage, err error) ListAppServicePlans(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlanCollectionPage, err error)