From fea4274a5616cdd94b588f5910267434a56ccb5c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 26 Jul 2019 13:45:31 -0700 Subject: [PATCH 1/3] Generated from 0e0525cb28b7c796be9aa0958d430bc764a78ed4 (#5293) Merge branch 'master' into michal-dev-security-Microsoft.Security-2017-08-01-preview --- .../preview/security/mgmt/security/models.go | 36 +++--- .../security/mgmt/v3.0/security/models.go | 110 ++++++++++-------- 2 files changed, 80 insertions(+), 66 deletions(-) diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index d17999ae6fe7..9798ac9547d7 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -221,8 +221,8 @@ const ( type RecommendationConfigStatus = original.RecommendationConfigStatus const ( - TurnedOff RecommendationConfigStatus = original.TurnedOff - TurnedOn RecommendationConfigStatus = original.TurnedOn + Disabled RecommendationConfigStatus = original.Disabled + Enabled RecommendationConfigStatus = original.Enabled ) type RecommendationStatus = original.RecommendationStatus @@ -237,18 +237,22 @@ const ( type RecommendationType = original.RecommendationType const ( - DenyDefaultIPPolicy RecommendationType = original.DenyDefaultIPPolicy - EnableDiagnosticsLog RecommendationType = original.EnableDiagnosticsLog - IdenticalAuthenticationCredentials RecommendationType = original.IdenticalAuthenticationCredentials - OpenPortsOnDevice RecommendationType = original.OpenPortsOnDevice - OperationSystemNotValid RecommendationType = original.OperationSystemNotValid - PermissiveFirewallPolicy RecommendationType = original.PermissiveFirewallPolicy - PermissiveFirewallRuleInput RecommendationType = original.PermissiveFirewallRuleInput - PermissiveFirewallRuleOut RecommendationType = original.PermissiveFirewallRuleOut - SecurityTwinConfigurationConflict RecommendationType = original.SecurityTwinConfigurationConflict - SecurityTwinConfigurationNotOptimal RecommendationType = original.SecurityTwinConfigurationNotOptimal - TooLargeIPRange RecommendationType = original.TooLargeIPRange - UnutilizedMessagesFromAgent RecommendationType = original.UnutilizedMessagesFromAgent + IoTACRAuthentication RecommendationType = original.IoTACRAuthentication + IoTAgentSendsUnutilizedMessages RecommendationType = original.IoTAgentSendsUnutilizedMessages + IoTBaseline RecommendationType = original.IoTBaseline + IoTEdgeHubMemOptimize RecommendationType = original.IoTEdgeHubMemOptimize + IoTEdgeLoggingOptions RecommendationType = original.IoTEdgeLoggingOptions + IoTInconsistentModuleSettings RecommendationType = original.IoTInconsistentModuleSettings + IoTInstallAgent RecommendationType = original.IoTInstallAgent + IoTIPFilterDenyAll RecommendationType = original.IoTIPFilterDenyAll + IoTIPFilterPermissiveRule RecommendationType = original.IoTIPFilterPermissiveRule + IoTOpenPorts RecommendationType = original.IoTOpenPorts + IoTPermissiveFirewallPolicy RecommendationType = original.IoTPermissiveFirewallPolicy + IoTPermissiveInputFirewallRules RecommendationType = original.IoTPermissiveInputFirewallRules + IoTPermissiveOutputFirewallRules RecommendationType = original.IoTPermissiveOutputFirewallRules + IoTPrivilegedDockerOptions RecommendationType = original.IoTPrivilegedDockerOptions + IoTSharedCredentials RecommendationType = original.IoTSharedCredentials + IoTVulnerableTLSCipherSuite RecommendationType = original.IoTVulnerableTLSCipherSuite ) type ReportedSeverity = original.ReportedSeverity @@ -279,8 +283,8 @@ const ( type SolutionStatus = original.SolutionStatus const ( - Disabled SolutionStatus = original.Disabled - Enabled SolutionStatus = original.Enabled + SolutionStatusDisabled SolutionStatus = original.SolutionStatusDisabled + SolutionStatusEnabled SolutionStatus = original.SolutionStatusEnabled ) type SourceSystem = original.SourceSystem diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 3e7b076b5bce..d9aa8af052a7 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -436,15 +436,15 @@ func PossibleRecommendationAction1Values() []RecommendationAction1 { type RecommendationConfigStatus string const ( - // TurnedOff ... - TurnedOff RecommendationConfigStatus = "TurnedOff" - // TurnedOn ... - TurnedOn RecommendationConfigStatus = "TurnedOn" + // Disabled ... + Disabled RecommendationConfigStatus = "Disabled" + // Enabled ... + Enabled RecommendationConfigStatus = "Enabled" ) // PossibleRecommendationConfigStatusValues returns an array of possible values for the RecommendationConfigStatus const type. func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { - return []RecommendationConfigStatus{TurnedOff, TurnedOn} + return []RecommendationConfigStatus{Disabled, Enabled} } // RecommendationStatus enumerates the values for recommendation status. @@ -470,45 +470,55 @@ func PossibleRecommendationStatusValues() []RecommendationStatus { type RecommendationType string const ( - // DenyDefaultIPPolicy IP filter configuration should have rules defined for allowed traffic, and should by - // default, deny all other traffic by default. - DenyDefaultIPPolicy RecommendationType = "DenyDefaultIpPolicy" - // EnableDiagnosticsLog Enable logs and retain them for up to a year. Retaining logs enables you to - // recreate activity trails for investigation purposes when a security incident occurs or your network is - // compromised. - EnableDiagnosticsLog RecommendationType = "EnableDiagnosticsLog" - // IdenticalAuthenticationCredentials IoT Hub authentication credentials are used by multiple devices. This - // may indicate an illegitimate device impersonating a legitimate device. Duplicate credential use - // increases the risk of device impersonation by a malicious actor. - IdenticalAuthenticationCredentials RecommendationType = "IdenticalAuthenticationCredentials" - // OpenPortsOnDevice A listening endpoint was found on the device. - OpenPortsOnDevice RecommendationType = "OpenPortsOnDevice" - // OperationSystemNotValid Device doesn't comply with CIS Linux benchmarks. - OperationSystemNotValid RecommendationType = "OperationSystemNotValid" - // PermissiveFirewallPolicy Allowed firewall policy found (INPUT/OUTPUT). Firewall policy should deny all - // traffic by default, and define rules to allow necessary communication to/from the device. - PermissiveFirewallPolicy RecommendationType = "PermissiveFirewallPolicy" - // PermissiveFirewallRuleInput A rule in the firewall in the input chain has been found that contains a - // permissive pattern for a wide range of IP addresses or ports. - PermissiveFirewallRuleInput RecommendationType = "PermissiveFirewallRuleInput" - // PermissiveFirewallRuleOut A rule in the firewall in the output chain has been found that contains a - // permissive pattern for a wide range of IP addresses or ports. - PermissiveFirewallRuleOut RecommendationType = "PermissiveFirewallRuleOut" - // SecurityTwinConfigurationConflict Conflicts were identified in the security twin configuration. - SecurityTwinConfigurationConflict RecommendationType = "SecurityTwinConfigurationConflict" - // SecurityTwinConfigurationNotOptimal Security twin configuration is not optimal. - SecurityTwinConfigurationNotOptimal RecommendationType = "SecurityTwinConfigurationNotOptimal" - // TooLargeIPRange An allow IP filter rule source IP range is too large. Overly permissive rules can expose - // your IoT hub to malicious actors. - TooLargeIPRange RecommendationType = "TooLargeIPRange" - // UnutilizedMessagesFromAgent 10% or more of security messages were smaller than 4kb during the last 24 - // hours. - UnutilizedMessagesFromAgent RecommendationType = "UnutilizedMessagesFromAgent" + // IoTACRAuthentication Authentication schema used for pull an edge module from an ACR repository does not + // use Service Principal Authentication. + IoTACRAuthentication RecommendationType = "IoT_ACRAuthentication" + // IoTAgentSendsUnutilizedMessages IoT agent message size capacity is currently underutilized, causing an + // increase in the number of sent messages. Adjust message intervals for better utilization. + IoTAgentSendsUnutilizedMessages RecommendationType = "IoT_AgentSendsUnutilizedMessages" + // IoTBaseline Identified security related system configuration issues. + IoTBaseline RecommendationType = "IoT_Baseline" + // IoTEdgeHubMemOptimize You can optimize Edge Hub memory usage by turning off protocol heads for any + // protocols not used by Edge modules in your solution. + IoTEdgeHubMemOptimize RecommendationType = "IoT_EdgeHubMemOptimize" + // IoTEdgeLoggingOptions Logging is disabled for this edge module. + IoTEdgeLoggingOptions RecommendationType = "IoT_EdgeLoggingOptions" + // IoTInconsistentModuleSettings A minority within a device security group has inconsistent Edge Module + // settings with the rest of their group. + IoTInconsistentModuleSettings RecommendationType = "IoT_InconsistentModuleSettings" + // IoTInstallAgent Install the Azure Security of Things Agent. + IoTInstallAgent RecommendationType = "IoT_InstallAgent" + // IoTIPFilterDenyAll IP Filter Configuration should have rules defined for allowed traffic and should deny + // all other traffic by default. + IoTIPFilterDenyAll RecommendationType = "IoT_IPFilter_DenyAll" + // IoTIPFilterPermissiveRule An Allow IP Filter rules source IP range is too large. Overly permissive rules + // might expose your IoT hub to malicious intenders. + IoTIPFilterPermissiveRule RecommendationType = "IoT_IPFilter_PermissiveRule" + // IoTOpenPorts A listening endpoint was found on the device. + IoTOpenPorts RecommendationType = "IoT_OpenPorts" + // IoTPermissiveFirewallPolicy An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny + // all traffic by default and define rules to allow necessary communication to/from the device. + IoTPermissiveFirewallPolicy RecommendationType = "IoT_PermissiveFirewallPolicy" + // IoTPermissiveInputFirewallRules A rule in the firewall has been found that contains a permissive pattern + // for a wide range of IP addresses or Ports. + IoTPermissiveInputFirewallRules RecommendationType = "IoT_PermissiveInputFirewallRules" + // IoTPermissiveOutputFirewallRules A rule in the firewall has been found that contains a permissive + // pattern for a wide range of IP addresses or Ports. + IoTPermissiveOutputFirewallRules RecommendationType = "IoT_PermissiveOutputFirewallRules" + // IoTPrivilegedDockerOptions Edge module is configured to run in privileged mode, with extensive Linux + // capabilities or with host-level network access (send/receive data to host machine). + IoTPrivilegedDockerOptions RecommendationType = "IoT_PrivilegedDockerOptions" + // IoTSharedCredentials Same authentication credentials to the IoT Hub used by multiple devices. This could + // indicate an illegitimate device impersonating a legitimate device. It also exposes the risk of device + // impersonation by an attacker. + IoTSharedCredentials RecommendationType = "IoT_SharedCredentials" + // IoTVulnerableTLSCipherSuite Insecure TLS configurations detected. Immediate upgrade recommended. + IoTVulnerableTLSCipherSuite RecommendationType = "IoT_VulnerableTLSCipherSuite" ) // PossibleRecommendationTypeValues returns an array of possible values for the RecommendationType const type. func PossibleRecommendationTypeValues() []RecommendationType { - return []RecommendationType{DenyDefaultIPPolicy, EnableDiagnosticsLog, IdenticalAuthenticationCredentials, OpenPortsOnDevice, OperationSystemNotValid, PermissiveFirewallPolicy, PermissiveFirewallRuleInput, PermissiveFirewallRuleOut, SecurityTwinConfigurationConflict, SecurityTwinConfigurationNotOptimal, TooLargeIPRange, UnutilizedMessagesFromAgent} + return []RecommendationType{IoTACRAuthentication, IoTAgentSendsUnutilizedMessages, IoTBaseline, IoTEdgeHubMemOptimize, IoTEdgeLoggingOptions, IoTInconsistentModuleSettings, IoTInstallAgent, IoTIPFilterDenyAll, IoTIPFilterPermissiveRule, IoTOpenPorts, IoTPermissiveFirewallPolicy, IoTPermissiveInputFirewallRules, IoTPermissiveOutputFirewallRules, IoTPrivilegedDockerOptions, IoTSharedCredentials, IoTVulnerableTLSCipherSuite} } // ReportedSeverity enumerates the values for reported severity. @@ -568,15 +578,15 @@ func PossibleSettingKindValues() []SettingKind { type SolutionStatus string const ( - // Disabled ... - Disabled SolutionStatus = "Disabled" - // Enabled ... - Enabled SolutionStatus = "Enabled" + // SolutionStatusDisabled ... + SolutionStatusDisabled SolutionStatus = "Disabled" + // SolutionStatusEnabled ... + SolutionStatusEnabled SolutionStatus = "Enabled" ) // PossibleSolutionStatusValues returns an array of possible values for the SolutionStatus const type. func PossibleSolutionStatusValues() []SolutionStatus { - return []SolutionStatus{Disabled, Enabled} + return []SolutionStatus{SolutionStatusDisabled, SolutionStatusEnabled} } // SourceSystem enumerates the values for source system. @@ -4774,7 +4784,7 @@ type IoTSecuritySolutionProperties struct { Workspace *string `json:"workspace,omitempty"` // DisplayName - Resource display name. DisplayName *string `json:"displayName,omitempty"` - // Status - Security solution status. Possible values include: 'Enabled', 'Disabled' + // Status - Security solution status. Possible values include: 'SolutionStatusEnabled', 'SolutionStatusDisabled' Status SolutionStatus `json:"status,omitempty"` // Export - List of additional export to workspace data options Export *[]ExportData `json:"export,omitempty"` @@ -5578,11 +5588,11 @@ type PublisherInfo struct { // RecommendationConfigurationProperties recommendation configuration type RecommendationConfigurationProperties struct { - // RecommendationType - The recommendation type. Possible values include: 'OpenPortsOnDevice', 'PermissiveFirewallPolicy', 'PermissiveFirewallRuleInput', 'PermissiveFirewallRuleOut', 'OperationSystemNotValid', 'UnutilizedMessagesFromAgent', 'SecurityTwinConfigurationNotOptimal', 'SecurityTwinConfigurationConflict', 'IdenticalAuthenticationCredentials', 'DenyDefaultIPPolicy', 'TooLargeIPRange', 'EnableDiagnosticsLog' + // RecommendationType - The recommendation type. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' RecommendationType RecommendationType `json:"recommendationType,omitempty"` - // Description - READ-ONLY - Description *string `json:"description,omitempty"` - // Status - Recommendation status. The recommendation is not generated when the status is turned off. Possible values include: 'TurnedOff', 'TurnedOn' + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Status - Recommendation status. The recommendation is not generated when the status is disabled. Possible values include: 'Disabled', 'Enabled' Status RecommendationConfigStatus `json:"status,omitempty"` } From 48270f885b7a930997e30f2488fd780d0f5f3539 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 31 Jul 2019 16:05:25 -0700 Subject: [PATCH 2/3] [AutoPR security/resource-manager] Set IoTSecuritySolutions & IoTSecuritySolutionAnalytics API as stable (#5365) * Generated from 4d6fbc52713c0423aa04f74ae330867fac488b86 Set IoTSecuritySolutions & IoTSecuritySolutionAnalytics API as stable * Generated from de032ab9863bb6d4e12b9796f64508fd4bb16f88 Merge branch 'dev-security-Microsoft.Security-2019-01-01' of https://github.com/hagba/azure-rest-api-specs into dev-security-Microsoft.Security-2019-01-01 * Generated from e763a96421ef60d69bbae038d008c08002f16359 remove paging support from IoTSecurityDeviceRecommendationsList * Generated from dea80a5e1da4b383480342bba4eca97ba55c053b remove paging from IoTSecurityAlertedDevicesList --- .../mgmt/v2.0/security/iotsecuritysolution.go | 413 +++++ .../v2.0/security/iotsecuritysolutions.go | 163 ++ .../security/iotsecuritysolutionsanalytics.go | 219 +++ ...curitysolutionsanalyticsaggregatedalert.go | 224 +++ ...uritysolutionsanalyticsaggregatedalerts.go | 175 +++ ...ecuritysolutionsanalyticsrecommendation.go | 135 ++ ...curitysolutionsanalyticsrecommendations.go | 175 +++ .../iotsecuritysolutionsresourcegroup.go | 173 +++ .../security/mgmt/v2.0/security/models.go | 1359 +++++++++++++++-- .../v2.0/security/securityapi/interfaces.go | 61 + .../mgmt/v3.0/security/iotsecuritysolution.go | 8 +- .../v3.0/security/iotsecuritysolutions.go | 2 +- .../security/iotsecuritysolutionsanalytics.go | 4 +- ...curitysolutionsanalyticsaggregatedalert.go | 4 +- ...uritysolutionsanalyticsaggregatedalerts.go | 2 +- ...ecuritysolutionsanalyticsrecommendation.go | 2 +- ...curitysolutionsanalyticsrecommendations.go | 2 +- .../iotsecuritysolutionsresourcegroup.go | 2 +- .../security/mgmt/v3.0/security/models.go | 4 - .../v3.0/security/securityapi/interfaces.go | 122 +- 20 files changed, 3055 insertions(+), 194 deletions(-) create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go create mode 100644 services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go new file mode 100644 index 000000000000..73b1112f75c2 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go @@ -0,0 +1,413 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IotSecuritySolutionClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type IotSecuritySolutionClient struct { + BaseClient +} + +// NewIotSecuritySolutionClient creates an instance of the IotSecuritySolutionClient client. +func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) IotSecuritySolutionClient { + return NewIotSecuritySolutionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIotSecuritySolutionClientWithBaseURI creates an instance of the IotSecuritySolutionClient client. +func NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionClient { + return IotSecuritySolutionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Create create new solution manager +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// iotSecuritySolutionData - the security solution data +func (client IotSecuritySolutionClient) Create(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel) (result IoTSecuritySolutionModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: iotSecuritySolutionData, + Constraints: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.Workspace", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.IotHubs", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.UserDefinedResources", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.UserDefinedResources.Query", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.UserDefinedResources.QuerySubscriptions", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, solutionName, iotSecuritySolutionData) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client IotSecuritySolutionClient) CreatePreparer(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + iotSecuritySolutionData.ID = nil + iotSecuritySolutionData.Name = nil + iotSecuritySolutionData.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}", pathParameters), + autorest.WithJSON(iotSecuritySolutionData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client IotSecuritySolutionClient) CreateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionClient) CreateResponder(resp *http.Response) (result IoTSecuritySolutionModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete create new solution manager +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +func (client IotSecuritySolutionClient) Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, solutionName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IotSecuritySolutionClient) DeletePreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IotSecuritySolutionClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get details of a specific iot security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +func (client IotSecuritySolutionClient) Get(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, solutionName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IotSecuritySolutionClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IotSecuritySolutionClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionClient) GetResponder(resp *http.Response) (result IoTSecuritySolutionModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update existing Security Solution tags or user defined resources. To update other fields use the +// CreateOrUpdate method +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// updateIotSecuritySolutionData - the security solution data +func (client IotSecuritySolutionClient) Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData UpdateIotSecuritySolutionData) (result IoTSecuritySolutionModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotSecuritySolutionClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotSecuritySolutionClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, solutionName, updateIotSecuritySolutionData) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotSecuritySolutionClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IotSecuritySolutionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData UpdateIotSecuritySolutionData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}", pathParameters), + autorest.WithJSON(updateIotSecuritySolutionData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IotSecuritySolutionClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IotSecuritySolutionClient) UpdateResponder(resp *http.Response) (result IoTSecuritySolutionModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go new file mode 100644 index 000000000000..14fbfd273a72 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go @@ -0,0 +1,163 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type IoTSecuritySolutionsClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsClient creates an instance of the IoTSecuritySolutionsClient client. +func NewIoTSecuritySolutionsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { + return NewIoTSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsClientWithBaseURI creates an instance of the IoTSecuritySolutionsClient client. +func NewIoTSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { + return IoTSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List list of security solutions +// Parameters: +// filter - filter the Security Solution with OData syntax. supporting filter by iotHubs +func (client IoTSecuritySolutionsClient) List(ctx context.Context, filter string) (result IoTSecuritySolutionsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsClient.List") + defer func() { + sc := -1 + if result.itssl.Response.Response != nil { + sc = result.itssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.itssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "List", resp, "Failure sending request") + return + } + + result.itssl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IoTSecuritySolutionsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsClient) ListResponder(resp *http.Response) (result IoTSecuritySolutionsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client IoTSecuritySolutionsClient) listNextResults(ctx context.Context, lastResults IoTSecuritySolutionsList) (result IoTSecuritySolutionsList, err error) { + req, err := lastResults.ioTSecuritySolutionsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IoTSecuritySolutionsClient) ListComplete(ctx context.Context, filter string) (result IoTSecuritySolutionsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go new file mode 100644 index 000000000000..d242868be31b --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go @@ -0,0 +1,219 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsAnalyticsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type IoTSecuritySolutionsAnalyticsClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsAnalyticsClient creates an instance of the IoTSecuritySolutionsAnalyticsClient client. +func NewIoTSecuritySolutionsAnalyticsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { + return NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsAnalyticsClientWithBaseURI creates an instance of the IoTSecuritySolutionsAnalyticsClient +// client. +func NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { + return IoTSecuritySolutionsAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// GetAll security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +func (client IoTSecuritySolutionsAnalyticsClient) GetAll(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionAnalyticsModelList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsClient.GetAll") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsClient", "GetAll", err.Error()) + } + + req, err := client.GetAllPreparer(ctx, resourceGroupName, solutionName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetAll", nil, "Failure preparing request") + return + } + + resp, err := client.GetAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetAll", resp, "Failure sending request") + return + } + + result, err = client.GetAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetAll", resp, "Failure responding to request") + } + + return +} + +// GetAllPreparer prepares the GetAll request. +func (client IoTSecuritySolutionsAnalyticsClient) GetAllPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAllSender sends the GetAll request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsClient) GetAllSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAllResponder handles the response to the GetAll request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsClient) GetAllResponder(resp *http.Response) (result IoTSecuritySolutionAnalyticsModelList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDefault security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +func (client IoTSecuritySolutionsAnalyticsClient) GetDefault(ctx context.Context, resourceGroupName string, solutionName string) (result IoTSecuritySolutionAnalyticsModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsClient.GetDefault") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", err.Error()) + } + + req, err := client.GetDefaultPreparer(ctx, resourceGroupName, solutionName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", nil, "Failure preparing request") + return + } + + resp, err := client.GetDefaultSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", resp, "Failure sending request") + return + } + + result, err = client.GetDefaultResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsClient", "GetDefault", resp, "Failure responding to request") + } + + return +} + +// GetDefaultPreparer prepares the GetDefault request. +func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDefaultSender sends the GetDefault request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetDefaultResponder handles the response to the GetDefault request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultResponder(resp *http.Response) (result IoTSecuritySolutionAnalyticsModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go new file mode 100644 index 000000000000..07196e670723 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go @@ -0,0 +1,224 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsAnalyticsAggregatedAlertClient is the API spec for Microsoft.Security (Azure Security Center) +// resource provider +type IoTSecuritySolutionsAnalyticsAggregatedAlertClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient creates an instance of the +// IoTSecuritySolutionsAnalyticsAggregatedAlertClient client. +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { + return NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI creates an instance of the +// IoTSecuritySolutionsAnalyticsAggregatedAlertClient client. +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { + return IoTSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Dismiss security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// aggregatedAlertName - identifier of the aggregated alert +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", err.Error()) + } + + req, err := client.DismissPreparer(ctx, resourceGroupName, solutionName, aggregatedAlertName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", nil, "Failure preparing request") + return + } + + resp, err := client.DismissSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", resp, "Failure sending request") + return + } + + result, err = client.DismissResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Dismiss", resp, "Failure responding to request") + } + + return +} + +// DismissPreparer prepares the Dismiss request. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "aggregatedAlertName": autorest.Encode("path", aggregatedAlertName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DismissSender sends the Dismiss request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DismissResponder handles the response to the Dismiss request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// aggregatedAlertName - identifier of the aggregated alert +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result IoTSecurityAggregatedAlert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, aggregatedAlertName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "aggregatedAlertName": autorest.Encode("path", aggregatedAlertName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetResponder(resp *http.Response) (result IoTSecurityAggregatedAlert, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go new file mode 100644 index 000000000000..0e295e14f36b --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go @@ -0,0 +1,175 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsAnalyticsAggregatedAlertsClient is the API spec for Microsoft.Security (Azure Security Center) +// resource provider +type IoTSecuritySolutionsAnalyticsAggregatedAlertsClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient creates an instance of the +// IoTSecuritySolutionsAnalyticsAggregatedAlertsClient client. +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { + return NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI creates an instance of the +// IoTSecuritySolutionsAnalyticsAggregatedAlertsClient client. +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { + return IoTSecuritySolutionsAnalyticsAggregatedAlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// top - the number of results to retrieve. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedAlertListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertsClient.List") + defer func() { + sc := -1 + if result.itsaal.Response.Response != nil { + sc = result.itsaal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.itsaal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", resp, "Failure sending request") + return + } + + result.itsaal, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) ListResponder(resp *http.Response) (result IoTSecurityAggregatedAlertList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) listNextResults(ctx context.Context, lastResults IoTSecurityAggregatedAlertList) (result IoTSecurityAggregatedAlertList, err error) { + req, err := lastResults.ioTSecurityAggregatedAlertListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedAlertListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsAggregatedAlertsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, solutionName, top) + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go new file mode 100644 index 000000000000..ff3fad682371 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go @@ -0,0 +1,135 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsAnalyticsRecommendationClient is the API spec for Microsoft.Security (Azure Security Center) +// resource provider +type IoTSecuritySolutionsAnalyticsRecommendationClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsAnalyticsRecommendationClient creates an instance of the +// IoTSecuritySolutionsAnalyticsRecommendationClient client. +func NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { + return NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI creates an instance of the +// IoTSecuritySolutionsAnalyticsRecommendationClient client. +func NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { + return IoTSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// aggregatedRecommendationName - identifier of the aggregated recommendation +func (client IoTSecuritySolutionsAnalyticsRecommendationClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result IoTSecurityAggregatedRecommendation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsRecommendationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, aggregatedRecommendationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "aggregatedRecommendationName": autorest.Encode("path", aggregatedRecommendationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetResponder(resp *http.Response) (result IoTSecurityAggregatedRecommendation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go new file mode 100644 index 000000000000..fbda8ca7f69e --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go @@ -0,0 +1,175 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsAnalyticsRecommendationsClient is the API spec for Microsoft.Security (Azure Security Center) +// resource provider +type IoTSecuritySolutionsAnalyticsRecommendationsClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsAnalyticsRecommendationsClient creates an instance of the +// IoTSecuritySolutionsAnalyticsRecommendationsClient client. +func NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { + return NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI creates an instance of the +// IoTSecuritySolutionsAnalyticsRecommendationsClient client. +func NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { + return IoTSecuritySolutionsAnalyticsRecommendationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List security Analytics of a security solution +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// solutionName - the solution manager name +// top - the number of results to retrieve. +func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedRecommendationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsRecommendationsClient.List") + defer func() { + sc := -1 + if result.itsarl.Response.Response != nil { + sc = result.itsarl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.itsarl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", resp, "Failure sending request") + return + } + + result.itsarl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "solutionName": autorest.Encode("path", solutionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) ListResponder(resp *http.Response) (result IoTSecurityAggregatedRecommendationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) listNextResults(ctx context.Context, lastResults IoTSecurityAggregatedRecommendationList) (result IoTSecurityAggregatedRecommendationList, err error) { + req, err := lastResults.ioTSecurityAggregatedRecommendationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsAnalyticsRecommendationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result IoTSecurityAggregatedRecommendationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsAnalyticsRecommendationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, solutionName, top) + return +} diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go new file mode 100644 index 000000000000..71faba118a1e --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go @@ -0,0 +1,173 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IoTSecuritySolutionsResourceGroupClient is the API spec for Microsoft.Security (Azure Security Center) resource +// provider +type IoTSecuritySolutionsResourceGroupClient struct { + BaseClient +} + +// NewIoTSecuritySolutionsResourceGroupClient creates an instance of the IoTSecuritySolutionsResourceGroupClient +// client. +func NewIoTSecuritySolutionsResourceGroupClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { + return NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIoTSecuritySolutionsResourceGroupClientWithBaseURI creates an instance of the +// IoTSecuritySolutionsResourceGroupClient client. +func NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { + return IoTSecuritySolutionsResourceGroupClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List list of security solutions +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// filter - filter the Security Solution with OData syntax. supporting filter by iotHubs +func (client IoTSecuritySolutionsResourceGroupClient) List(ctx context.Context, resourceGroupName string, filter string) (result IoTSecuritySolutionsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsResourceGroupClient.List") + defer func() { + sc := -1 + if result.itssl.Response.Response != nil { + sc = result.itssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IoTSecuritySolutionsResourceGroupClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.itssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "List", resp, "Failure sending request") + return + } + + result.itssl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IoTSecuritySolutionsResourceGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client IoTSecuritySolutionsResourceGroupClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IoTSecuritySolutionsResourceGroupClient) ListResponder(resp *http.Response) (result IoTSecuritySolutionsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client IoTSecuritySolutionsResourceGroupClient) listNextResults(ctx context.Context, lastResults IoTSecuritySolutionsList) (result IoTSecuritySolutionsList, err error) { + req, err := lastResults.ioTSecuritySolutionsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IoTSecuritySolutionsResourceGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IoTSecuritySolutionsResourceGroupClient) ListComplete(ctx context.Context, resourceGroupName string, filter string) (result IoTSecuritySolutionsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsResourceGroupClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, filter) + return +} diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index d2369e5e53bb..4e6659976cea 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -189,6 +189,19 @@ func PossibleConnectionTypeValues() []ConnectionType { return []ConnectionType{External, Internal} } +// DataSource enumerates the values for data source. +type DataSource string + +const ( + // TwinData Devices twin data + TwinData DataSource = "TwinData" +) + +// PossibleDataSourceValues returns an array of possible values for the DataSource const type. +func PossibleDataSourceValues() []DataSource { + return []DataSource{TwinData} +} + // Direction enumerates the values for direction. type Direction string @@ -234,6 +247,19 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} } +// ExportData enumerates the values for export data. +type ExportData string + +const ( + // RawEvents Agent raw events + RawEvents ExportData = "RawEvents" +) + +// PossibleExportDataValues returns an array of possible values for the ExportData const type. +func PossibleExportDataValues() []ExportData { + return []ExportData{RawEvents} +} + // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -401,6 +427,21 @@ func PossibleRecommendationAction1Values() []RecommendationAction1 { return []RecommendationAction1{RecommendationAction1Add, RecommendationAction1Recommended, RecommendationAction1Remove} } +// RecommendationConfigStatus enumerates the values for recommendation config status. +type RecommendationConfigStatus string + +const ( + // Disabled ... + Disabled RecommendationConfigStatus = "Disabled" + // Enabled ... + Enabled RecommendationConfigStatus = "Enabled" +) + +// PossibleRecommendationConfigStatusValues returns an array of possible values for the RecommendationConfigStatus const type. +func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { + return []RecommendationConfigStatus{Disabled, Enabled} +} + // RecommendationStatus enumerates the values for recommendation status. type RecommendationStatus string @@ -420,6 +461,61 @@ func PossibleRecommendationStatusValues() []RecommendationStatus { return []RecommendationStatus{RecommendationStatusNoStatus, RecommendationStatusNotAvailable, RecommendationStatusNotRecommended, RecommendationStatusRecommended} } +// RecommendationType enumerates the values for recommendation type. +type RecommendationType string + +const ( + // IoTACRAuthentication Authentication schema used for pull an edge module from an ACR repository does not + // use Service Principal Authentication. + IoTACRAuthentication RecommendationType = "IoT_ACRAuthentication" + // IoTAgentSendsUnutilizedMessages IoT agent message size capacity is currently underutilized, causing an + // increase in the number of sent messages. Adjust message intervals for better utilization. + IoTAgentSendsUnutilizedMessages RecommendationType = "IoT_AgentSendsUnutilizedMessages" + // IoTBaseline Identified security related system configuration issues. + IoTBaseline RecommendationType = "IoT_Baseline" + // IoTEdgeHubMemOptimize You can optimize Edge Hub memory usage by turning off protocol heads for any + // protocols not used by Edge modules in your solution. + IoTEdgeHubMemOptimize RecommendationType = "IoT_EdgeHubMemOptimize" + // IoTEdgeLoggingOptions Logging is disabled for this edge module. + IoTEdgeLoggingOptions RecommendationType = "IoT_EdgeLoggingOptions" + // IoTInconsistentModuleSettings A minority within a device security group has inconsistent Edge Module + // settings with the rest of their group. + IoTInconsistentModuleSettings RecommendationType = "IoT_InconsistentModuleSettings" + // IoTInstallAgent Install the Azure Security of Things Agent. + IoTInstallAgent RecommendationType = "IoT_InstallAgent" + // IoTIPFilterDenyAll IP Filter Configuration should have rules defined for allowed traffic and should deny + // all other traffic by default. + IoTIPFilterDenyAll RecommendationType = "IoT_IPFilter_DenyAll" + // IoTIPFilterPermissiveRule An Allow IP Filter rules source IP range is too large. Overly permissive rules + // might expose your IoT hub to malicious intenders. + IoTIPFilterPermissiveRule RecommendationType = "IoT_IPFilter_PermissiveRule" + // IoTOpenPorts A listening endpoint was found on the device. + IoTOpenPorts RecommendationType = "IoT_OpenPorts" + // IoTPermissiveFirewallPolicy An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny + // all traffic by default and define rules to allow necessary communication to/from the device. + IoTPermissiveFirewallPolicy RecommendationType = "IoT_PermissiveFirewallPolicy" + // IoTPermissiveInputFirewallRules A rule in the firewall has been found that contains a permissive pattern + // for a wide range of IP addresses or Ports. + IoTPermissiveInputFirewallRules RecommendationType = "IoT_PermissiveInputFirewallRules" + // IoTPermissiveOutputFirewallRules A rule in the firewall has been found that contains a permissive + // pattern for a wide range of IP addresses or Ports. + IoTPermissiveOutputFirewallRules RecommendationType = "IoT_PermissiveOutputFirewallRules" + // IoTPrivilegedDockerOptions Edge module is configured to run in privileged mode, with extensive Linux + // capabilities or with host-level network access (send/receive data to host machine). + IoTPrivilegedDockerOptions RecommendationType = "IoT_PrivilegedDockerOptions" + // IoTSharedCredentials Same authentication credentials to the IoT Hub used by multiple devices. This could + // indicate an illegitimate device impersonating a legitimate device. It also exposes the risk of device + // impersonation by an attacker. + IoTSharedCredentials RecommendationType = "IoT_SharedCredentials" + // IoTVulnerableTLSCipherSuite Insecure TLS configurations detected. Immediate upgrade recommended. + IoTVulnerableTLSCipherSuite RecommendationType = "IoT_VulnerableTLSCipherSuite" +) + +// PossibleRecommendationTypeValues returns an array of possible values for the RecommendationType const type. +func PossibleRecommendationTypeValues() []RecommendationType { + return []RecommendationType{IoTACRAuthentication, IoTAgentSendsUnutilizedMessages, IoTBaseline, IoTEdgeHubMemOptimize, IoTEdgeLoggingOptions, IoTInconsistentModuleSettings, IoTInstallAgent, IoTIPFilterDenyAll, IoTIPFilterPermissiveRule, IoTOpenPorts, IoTPermissiveFirewallPolicy, IoTPermissiveInputFirewallRules, IoTPermissiveOutputFirewallRules, IoTPrivilegedDockerOptions, IoTSharedCredentials, IoTVulnerableTLSCipherSuite} +} + // ReportedSeverity enumerates the values for reported severity. type ReportedSeverity string @@ -454,6 +550,21 @@ func PossibleSettingKindValues() []SettingKind { return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} } +// SolutionStatus enumerates the values for solution status. +type SolutionStatus string + +const ( + // SolutionStatusDisabled ... + SolutionStatusDisabled SolutionStatus = "Disabled" + // SolutionStatusEnabled ... + SolutionStatusEnabled SolutionStatus = "Enabled" +) + +// PossibleSolutionStatusValues returns an array of possible values for the SolutionStatus const type. +func PossibleSolutionStatusValues() []SolutionStatus { + return []SolutionStatus{SolutionStatusDisabled, SolutionStatusEnabled} +} + // SourceSystem enumerates the values for source system. type SourceSystem string @@ -4212,26 +4323,114 @@ type InformationType struct { Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` } -// JitNetworkAccessPoliciesList ... -type JitNetworkAccessPoliciesList struct { +// IoTSecurityAggregatedAlert security Solution Aggregated Alert information +type IoTSecurityAggregatedAlert struct { autorest.Response `json:"-"` - Value *[]JitNetworkAccessPolicy `json:"value,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // IoTSecurityAggregatedAlertProperties - Security Solution Aggregated Alert data + *IoTSecurityAggregatedAlertProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IoTSecurityAggregatedAlert. +func (itsaa IoTSecurityAggregatedAlert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itsaa.Tags != nil { + objectMap["tags"] = itsaa.Tags + } + if itsaa.IoTSecurityAggregatedAlertProperties != nil { + objectMap["properties"] = itsaa.IoTSecurityAggregatedAlertProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IoTSecurityAggregatedAlert struct. +func (itsaa *IoTSecurityAggregatedAlert) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itsaa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itsaa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itsaa.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + itsaa.Tags = tags + } + case "properties": + if v != nil { + var ioTSecurityAggregatedAlertProperties IoTSecurityAggregatedAlertProperties + err = json.Unmarshal(*v, &ioTSecurityAggregatedAlertProperties) + if err != nil { + return err + } + itsaa.IoTSecurityAggregatedAlertProperties = &ioTSecurityAggregatedAlertProperties + } + } + } + + return nil +} + +// IoTSecurityAggregatedAlertList list of IoT aggregated security alerts +type IoTSecurityAggregatedAlertList struct { + autorest.Response `json:"-"` + // Value - List of aggregated alerts data + Value *[]IoTSecurityAggregatedAlert `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy -// values. -type JitNetworkAccessPoliciesListIterator struct { +// IoTSecurityAggregatedAlertListIterator provides access to a complete listing of +// IoTSecurityAggregatedAlert values. +type IoTSecurityAggregatedAlertListIterator struct { i int - page JitNetworkAccessPoliciesListPage + page IoTSecurityAggregatedAlertListPage } // 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 *JitNetworkAccessPoliciesListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *IoTSecurityAggregatedAlertListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedAlertListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4256,62 +4455,62 @@ func (iter *JitNetworkAccessPoliciesListIterator) NextWithContext(ctx context.Co // 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 *JitNetworkAccessPoliciesListIterator) Next() error { +func (iter *IoTSecurityAggregatedAlertListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JitNetworkAccessPoliciesListIterator) NotDone() bool { +func (iter IoTSecurityAggregatedAlertListIterator) 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 JitNetworkAccessPoliciesListIterator) Response() JitNetworkAccessPoliciesList { +func (iter IoTSecurityAggregatedAlertListIterator) Response() IoTSecurityAggregatedAlertList { 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 JitNetworkAccessPoliciesListIterator) Value() JitNetworkAccessPolicy { +func (iter IoTSecurityAggregatedAlertListIterator) Value() IoTSecurityAggregatedAlert { if !iter.page.NotDone() { - return JitNetworkAccessPolicy{} + return IoTSecurityAggregatedAlert{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the JitNetworkAccessPoliciesListIterator type. -func NewJitNetworkAccessPoliciesListIterator(page JitNetworkAccessPoliciesListPage) JitNetworkAccessPoliciesListIterator { - return JitNetworkAccessPoliciesListIterator{page: page} +// Creates a new instance of the IoTSecurityAggregatedAlertListIterator type. +func NewIoTSecurityAggregatedAlertListIterator(page IoTSecurityAggregatedAlertListPage) IoTSecurityAggregatedAlertListIterator { + return IoTSecurityAggregatedAlertListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (jnapl JitNetworkAccessPoliciesList) IsEmpty() bool { - return jnapl.Value == nil || len(*jnapl.Value) == 0 +func (itsaal IoTSecurityAggregatedAlertList) IsEmpty() bool { + return itsaal.Value == nil || len(*itsaal.Value) == 0 } -// jitNetworkAccessPoliciesListPreparer prepares a request to retrieve the next set of results. +// ioTSecurityAggregatedAlertListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (jnapl JitNetworkAccessPoliciesList) jitNetworkAccessPoliciesListPreparer(ctx context.Context) (*http.Request, error) { - if jnapl.NextLink == nil || len(to.String(jnapl.NextLink)) < 1 { +func (itsaal IoTSecurityAggregatedAlertList) ioTSecurityAggregatedAlertListPreparer(ctx context.Context) (*http.Request, error) { + if itsaal.NextLink == nil || len(to.String(itsaal.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(jnapl.NextLink))) + autorest.WithBaseURL(to.String(itsaal.NextLink))) } -// JitNetworkAccessPoliciesListPage contains a page of JitNetworkAccessPolicy values. -type JitNetworkAccessPoliciesListPage struct { - fn func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error) - jnapl JitNetworkAccessPoliciesList +// IoTSecurityAggregatedAlertListPage contains a page of IoTSecurityAggregatedAlert values. +type IoTSecurityAggregatedAlertListPage struct { + fn func(context.Context, IoTSecurityAggregatedAlertList) (IoTSecurityAggregatedAlertList, error) + itsaal IoTSecurityAggregatedAlertList } // 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 *JitNetworkAccessPoliciesListPage) NextWithContext(ctx context.Context) (err error) { +func (page *IoTSecurityAggregatedAlertListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedAlertListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4320,46 +4519,74 @@ func (page *JitNetworkAccessPoliciesListPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.jnapl) + next, err := page.fn(ctx, page.itsaal) if err != nil { return err } - page.jnapl = next + page.itsaal = 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 *JitNetworkAccessPoliciesListPage) Next() error { +func (page *IoTSecurityAggregatedAlertListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JitNetworkAccessPoliciesListPage) NotDone() bool { - return !page.jnapl.IsEmpty() +func (page IoTSecurityAggregatedAlertListPage) NotDone() bool { + return !page.itsaal.IsEmpty() } // Response returns the raw server response from the last page request. -func (page JitNetworkAccessPoliciesListPage) Response() JitNetworkAccessPoliciesList { - return page.jnapl +func (page IoTSecurityAggregatedAlertListPage) Response() IoTSecurityAggregatedAlertList { + return page.itsaal } // Values returns the slice of values for the current page or nil if there are no values. -func (page JitNetworkAccessPoliciesListPage) Values() []JitNetworkAccessPolicy { - if page.jnapl.IsEmpty() { +func (page IoTSecurityAggregatedAlertListPage) Values() []IoTSecurityAggregatedAlert { + if page.itsaal.IsEmpty() { return nil } - return *page.jnapl.Value + return *page.itsaal.Value } -// Creates a new instance of the JitNetworkAccessPoliciesListPage type. -func NewJitNetworkAccessPoliciesListPage(getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { - return JitNetworkAccessPoliciesListPage{fn: getNextPage} +// Creates a new instance of the IoTSecurityAggregatedAlertListPage type. +func NewIoTSecurityAggregatedAlertListPage(getNextPage func(context.Context, IoTSecurityAggregatedAlertList) (IoTSecurityAggregatedAlertList, error)) IoTSecurityAggregatedAlertListPage { + return IoTSecurityAggregatedAlertListPage{fn: getNextPage} } -// JitNetworkAccessPolicy ... -type JitNetworkAccessPolicy struct { +// IoTSecurityAggregatedAlertProperties security Solution Aggregated Alert data +type IoTSecurityAggregatedAlertProperties struct { + // AlertType - READ-ONLY; Name of the alert type + AlertType *string `json:"alertType,omitempty"` + // AlertDisplayName - READ-ONLY; Display name of the alert type + AlertDisplayName *string `json:"alertDisplayName,omitempty"` + // AggregatedDateUtc - READ-ONLY; The date the incidents were detected by the vendor + AggregatedDateUtc *date.Date `json:"aggregatedDateUtc,omitempty"` + // VendorName - READ-ONLY; Name of the vendor that discovered the incident + VendorName *string `json:"vendorName,omitempty"` + // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' + ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` + // RemediationSteps - READ-ONLY; Recommended steps for remediation + RemediationSteps *string `json:"remediationSteps,omitempty"` + // Description - READ-ONLY; Description of the incident and what it means + Description *string `json:"description,omitempty"` + // Count - READ-ONLY; Occurrence number of the alert within the aggregated date + Count *int32 `json:"count,omitempty"` + // EffectedResourceType - READ-ONLY; Azure resource ID of the resource that got the alerts + EffectedResourceType *string `json:"effectedResourceType,omitempty"` + // SystemSource - READ-ONLY; The type of the alerted resource (Azure, Non-Azure) + SystemSource *string `json:"systemSource,omitempty"` + // ActionTaken - READ-ONLY; The action that was taken as a response to the alert (Active, Blocked etc.) + ActionTaken *string `json:"actionTaken,omitempty"` + // LogAnalyticsQuery - READ-ONLY; query in log analytics to get the list of affected devices/alerts + LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` +} + +// IoTSecurityAggregatedRecommendation security Solution Recommendation Information +type IoTSecurityAggregatedRecommendation struct { autorest.Response `json:"-"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` @@ -4367,27 +4594,26 @@ type JitNetworkAccessPolicy struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type Type *string `json:"type,omitempty"` - // Kind - Kind of the resource - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *JitNetworkAccessPolicyProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // IoTSecurityAggregatedRecommendationProperties - Security Solution data + *IoTSecurityAggregatedRecommendationProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for JitNetworkAccessPolicy. -func (jnap JitNetworkAccessPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IoTSecurityAggregatedRecommendation. +func (itsar IoTSecurityAggregatedRecommendation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if jnap.Kind != nil { - objectMap["kind"] = jnap.Kind + if itsar.Tags != nil { + objectMap["tags"] = itsar.Tags } - if jnap.JitNetworkAccessPolicyProperties != nil { - objectMap["properties"] = jnap.JitNetworkAccessPolicyProperties + if itsar.IoTSecurityAggregatedRecommendationProperties != nil { + objectMap["properties"] = itsar.IoTSecurityAggregatedRecommendationProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for JitNetworkAccessPolicy struct. -func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for IoTSecurityAggregatedRecommendation struct. +func (itsar *IoTSecurityAggregatedRecommendation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4402,7 +4628,7 @@ func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - jnap.ID = &ID + itsar.ID = &ID } case "name": if v != nil { @@ -4411,7 +4637,7 @@ func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - jnap.Name = &name + itsar.Name = &name } case "type": if v != nil { @@ -4420,34 +4646,25 @@ func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - jnap.Type = &typeVar - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - jnap.Kind = &kind + itsar.Type = &typeVar } - case "location": + case "tags": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - jnap.Location = &location + itsar.Tags = tags } case "properties": if v != nil { - var jitNetworkAccessPolicyProperties JitNetworkAccessPolicyProperties - err = json.Unmarshal(*v, &jitNetworkAccessPolicyProperties) + var ioTSecurityAggregatedRecommendationProperties IoTSecurityAggregatedRecommendationProperties + err = json.Unmarshal(*v, &ioTSecurityAggregatedRecommendationProperties) if err != nil { return err } - jnap.JitNetworkAccessPolicyProperties = &jitNetworkAccessPolicyProperties + itsar.IoTSecurityAggregatedRecommendationProperties = &ioTSecurityAggregatedRecommendationProperties } } } @@ -4455,56 +4672,910 @@ func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { return nil } -// JitNetworkAccessPolicyInitiatePort ... -type JitNetworkAccessPolicyInitiatePort struct { - Number *int32 `json:"number,omitempty"` - // AllowedSourceAddressPrefix - Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request. - AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` - // EndTimeUtc - The time to close the request in UTC - EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` +// IoTSecurityAggregatedRecommendationList list of IoT aggregated security recommendations +type IoTSecurityAggregatedRecommendationList struct { + autorest.Response `json:"-"` + // Value - List of aggregated alerts data + Value *[]IoTSecurityAggregatedRecommendation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// JitNetworkAccessPolicyInitiateRequest ... -type JitNetworkAccessPolicyInitiateRequest struct { - // VirtualMachines - A list of virtual machines & ports to open access for - VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` +// IoTSecurityAggregatedRecommendationListIterator provides access to a complete listing of +// IoTSecurityAggregatedRecommendation values. +type IoTSecurityAggregatedRecommendationListIterator struct { + i int + page IoTSecurityAggregatedRecommendationListPage } -// JitNetworkAccessPolicyInitiateVirtualMachine ... -type JitNetworkAccessPolicyInitiateVirtualMachine struct { - // ID - Resource ID of the virtual machine that is linked to this policy - ID *string `json:"id,omitempty"` - // Ports - The ports to open for the resource with the `id` - Ports *[]JitNetworkAccessPolicyInitiatePort `json:"ports,omitempty"` +// 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 *IoTSecurityAggregatedRecommendationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedRecommendationListIterator.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 } -// JitNetworkAccessPolicyProperties ... -type JitNetworkAccessPolicyProperties struct { - // VirtualMachines - Configurations for Microsoft.Compute/virtualMachines resource type. - VirtualMachines *[]JitNetworkAccessPolicyVirtualMachine `json:"virtualMachines,omitempty"` - Requests *[]JitNetworkAccessRequest `json:"requests,omitempty"` - // ProvisioningState - READ-ONLY; Gets the provisioning state of the Just-in-Time policy. - ProvisioningState *string `json:"provisioningState,omitempty"` +// 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 *IoTSecurityAggregatedRecommendationListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// JitNetworkAccessPolicyVirtualMachine ... -type JitNetworkAccessPolicyVirtualMachine struct { - // ID - Resource ID of the virtual machine that is linked to this policy - ID *string `json:"id,omitempty"` - // Ports - Port configurations for the virtual machine - Ports *[]JitNetworkAccessPortRule `json:"ports,omitempty"` - // PublicIPAddress - Public IP address of the Azure Firewall that is linked to this policy, if applicable - PublicIPAddress *string `json:"publicIpAddress,omitempty"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IoTSecurityAggregatedRecommendationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// JitNetworkAccessPortRule ... -type JitNetworkAccessPortRule struct { - Number *int32 `json:"number,omitempty"` - // Protocol - Possible values include: 'TCP', 'UDP', 'All' - Protocol Protocol `json:"protocol,omitempty"` - // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` - // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. +// Response returns the raw server response from the last page request. +func (iter IoTSecurityAggregatedRecommendationListIterator) Response() IoTSecurityAggregatedRecommendationList { + 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 IoTSecurityAggregatedRecommendationListIterator) Value() IoTSecurityAggregatedRecommendation { + if !iter.page.NotDone() { + return IoTSecurityAggregatedRecommendation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IoTSecurityAggregatedRecommendationListIterator type. +func NewIoTSecurityAggregatedRecommendationListIterator(page IoTSecurityAggregatedRecommendationListPage) IoTSecurityAggregatedRecommendationListIterator { + return IoTSecurityAggregatedRecommendationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (itsarl IoTSecurityAggregatedRecommendationList) IsEmpty() bool { + return itsarl.Value == nil || len(*itsarl.Value) == 0 +} + +// ioTSecurityAggregatedRecommendationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (itsarl IoTSecurityAggregatedRecommendationList) ioTSecurityAggregatedRecommendationListPreparer(ctx context.Context) (*http.Request, error) { + if itsarl.NextLink == nil || len(to.String(itsarl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(itsarl.NextLink))) +} + +// IoTSecurityAggregatedRecommendationListPage contains a page of IoTSecurityAggregatedRecommendation +// values. +type IoTSecurityAggregatedRecommendationListPage struct { + fn func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error) + itsarl IoTSecurityAggregatedRecommendationList +} + +// 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 *IoTSecurityAggregatedRecommendationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedRecommendationListPage.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.itsarl) + if err != nil { + return err + } + page.itsarl = 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 *IoTSecurityAggregatedRecommendationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IoTSecurityAggregatedRecommendationListPage) NotDone() bool { + return !page.itsarl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IoTSecurityAggregatedRecommendationListPage) Response() IoTSecurityAggregatedRecommendationList { + return page.itsarl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IoTSecurityAggregatedRecommendationListPage) Values() []IoTSecurityAggregatedRecommendation { + if page.itsarl.IsEmpty() { + return nil + } + return *page.itsarl.Value +} + +// Creates a new instance of the IoTSecurityAggregatedRecommendationListPage type. +func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage { + return IoTSecurityAggregatedRecommendationListPage{fn: getNextPage} +} + +// IoTSecurityAggregatedRecommendationProperties security Solution Recommendation Information +type IoTSecurityAggregatedRecommendationProperties struct { + // RecommendationName - Name of the recommendation + RecommendationName *string `json:"recommendationName,omitempty"` + // RecommendationDisplayName - READ-ONLY; Display name of the recommendation type. + RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` + // Description - READ-ONLY; Description of the incident and what it means + Description *string `json:"description,omitempty"` + // RecommendationTypeID - READ-ONLY; The recommendation-type GUID. + RecommendationTypeID *string `json:"recommendationTypeId,omitempty"` + // DetectedBy - READ-ONLY; Name of the vendor that discovered the issue + DetectedBy *string `json:"detectedBy,omitempty"` + // RemediationSteps - READ-ONLY; Recommended steps for remediation + RemediationSteps *string `json:"remediationSteps,omitempty"` + // ReportedSeverity - READ-ONLY; Estimated severity of this recommendation. Possible values include: 'Informational', 'Low', 'Medium', 'High' + ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` + // HealthyDevices - READ-ONLY; the number of the healthy devices within the solution + HealthyDevices *int32 `json:"healthyDevices,omitempty"` + // UnhealthyDeviceCount - READ-ONLY; the number of the unhealthy devices within the solution + UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` + // LogAnalyticsQuery - READ-ONLY; query in log analytics to get the list of affected devices/alerts + LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` +} + +// IoTSecurityAlertedDevice statistic information about the number of alerts per device during the last +// period +type IoTSecurityAlertedDevice struct { + // DeviceID - READ-ONLY; Name of the alert type + DeviceID *string `json:"deviceId,omitempty"` + // AlertsCount - READ-ONLY; the number of alerts raised for this device + AlertsCount *int32 `json:"alertsCount,omitempty"` +} + +// IoTSecurityAlertedDevicesList list of devices with the count of raised alerts +type IoTSecurityAlertedDevicesList struct { + // Value - List of aggregated alerts data + Value *[]IoTSecurityAlertedDevice `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// IoTSecurityDeviceAlert statistic information about the number of alerts per alert type during the last +// period +type IoTSecurityDeviceAlert struct { + // AlertDisplayName - READ-ONLY; Display name of the alert + AlertDisplayName *string `json:"alertDisplayName,omitempty"` + // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' + ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` + // AlertsCount - READ-ONLY; the number of alerts raised for this alert type + AlertsCount *int32 `json:"alertsCount,omitempty"` +} + +// IoTSecurityDeviceAlertsList list of alerts with the count of raised alerts +type IoTSecurityDeviceAlertsList struct { + // Value - List of top alerts data + Value *[]IoTSecurityDeviceAlert `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// IoTSecurityDeviceRecommendation statistic information about the number of recommendations per +// recommendation type +type IoTSecurityDeviceRecommendation struct { + // RecommendationDisplayName - READ-ONLY; Display name of the recommendation + RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` + // ReportedSeverity - READ-ONLY; Estimated severity of this recommendation. Possible values include: 'Informational', 'Low', 'Medium', 'High' + ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` + // DevicesCount - READ-ONLY; the number of device with this recommendation + DevicesCount *int32 `json:"devicesCount,omitempty"` +} + +// IoTSecurityDeviceRecommendationsList list of recommendations with the count of devices +type IoTSecurityDeviceRecommendationsList struct { + // Value - List of aggregated recommendation data + Value *[]IoTSecurityDeviceRecommendation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// IoTSecuritySolutionAnalyticsModel security Analytics of a security solution +type IoTSecuritySolutionAnalyticsModel struct { + autorest.Response `json:"-"` + // IoTSecuritySolutionAnalyticsModelProperties - Security Solution Aggregated Alert data + *IoTSecuritySolutionAnalyticsModelProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IoTSecuritySolutionAnalyticsModel. +func (itssam IoTSecuritySolutionAnalyticsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itssam.IoTSecuritySolutionAnalyticsModelProperties != nil { + objectMap["properties"] = itssam.IoTSecuritySolutionAnalyticsModelProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IoTSecuritySolutionAnalyticsModel struct. +func (itssam *IoTSecuritySolutionAnalyticsModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var ioTSecuritySolutionAnalyticsModelProperties IoTSecuritySolutionAnalyticsModelProperties + err = json.Unmarshal(*v, &ioTSecuritySolutionAnalyticsModelProperties) + if err != nil { + return err + } + itssam.IoTSecuritySolutionAnalyticsModelProperties = &ioTSecuritySolutionAnalyticsModelProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itssam.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itssam.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itssam.Type = &typeVar + } + } + } + + return nil +} + +// IoTSecuritySolutionAnalyticsModelList list of Security Analytics of a security solution +type IoTSecuritySolutionAnalyticsModelList struct { + autorest.Response `json:"-"` + // Value - List of Security Analytics of a security solution + Value *[]IoTSecuritySolutionAnalyticsModel `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// IoTSecuritySolutionAnalyticsModelProperties security Analytics of a security solution properties +type IoTSecuritySolutionAnalyticsModelProperties struct { + // Metrics - READ-ONLY; Security Analytics of a security solution + Metrics *IoTSeverityMetrics `json:"metrics,omitempty"` + // UnhealthyDeviceCount - READ-ONLY; number of unhealthy devices + UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` + // DevicesMetrics - READ-ONLY; The list of devices metrics by the aggregated date. + DevicesMetrics *[]IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem `json:"devicesMetrics,omitempty"` + // TopAlertedDevices - The list of top 3 devices with the most attacked. + TopAlertedDevices *IoTSecurityAlertedDevicesList `json:"topAlertedDevices,omitempty"` + // MostPrevalentDeviceAlerts - The list of most prevalent 3 alerts. + MostPrevalentDeviceAlerts *IoTSecurityDeviceAlertsList `json:"mostPrevalentDeviceAlerts,omitempty"` + // MostPrevalentDeviceRecommendations - The list of most prevalent 3 recommendations. + MostPrevalentDeviceRecommendations *IoTSecurityDeviceRecommendationsList `json:"mostPrevalentDeviceRecommendations,omitempty"` +} + +// IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem ... +type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem struct { + // Date - the date of the metrics + Date *date.Time `json:"date,omitempty"` + // DevicesMetrics - devices alerts count by severity. + DevicesMetrics *IoTSeverityMetrics `json:"devicesMetrics,omitempty"` +} + +// IoTSecuritySolutionModel security Solution +type IoTSecuritySolutionModel struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // IoTSecuritySolutionProperties - Security Solution data + *IoTSecuritySolutionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IoTSecuritySolutionModel. +func (itssm IoTSecuritySolutionModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itssm.Tags != nil { + objectMap["tags"] = itssm.Tags + } + if itssm.Location != nil { + objectMap["location"] = itssm.Location + } + if itssm.IoTSecuritySolutionProperties != nil { + objectMap["properties"] = itssm.IoTSecuritySolutionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IoTSecuritySolutionModel struct. +func (itssm *IoTSecuritySolutionModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itssm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itssm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itssm.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + itssm.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + itssm.Location = &location + } + case "properties": + if v != nil { + var ioTSecuritySolutionProperties IoTSecuritySolutionProperties + err = json.Unmarshal(*v, &ioTSecuritySolutionProperties) + if err != nil { + return err + } + itssm.IoTSecuritySolutionProperties = &ioTSecuritySolutionProperties + } + } + } + + return nil +} + +// IoTSecuritySolutionProperties security Solution setting data +type IoTSecuritySolutionProperties struct { + // Workspace - Workspace resource ID + Workspace *string `json:"workspace,omitempty"` + // DisplayName - Resource display name. + DisplayName *string `json:"displayName,omitempty"` + // Status - Security solution status. Possible values include: 'SolutionStatusEnabled', 'SolutionStatusDisabled' + Status SolutionStatus `json:"status,omitempty"` + // Export - List of additional export to workspace data options + Export *[]ExportData `json:"export,omitempty"` + // DisabledDataSources - Disabled data sources. Disabling these data sources compromises the system. + DisabledDataSources *[]DataSource `json:"disabledDataSources,omitempty"` + // IotHubs - IoT Hub resource IDs + IotHubs *[]string `json:"iotHubs,omitempty"` + UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` + // AutoDiscoveredResources - READ-ONLY; List of resources that were automatically discovered as relevant to the security solution. + AutoDiscoveredResources *[]string `json:"autoDiscoveredResources,omitempty"` + RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` +} + +// IoTSecuritySolutionsList list of iot solutions +type IoTSecuritySolutionsList struct { + autorest.Response `json:"-"` + // Value - List of security solutions + Value *[]IoTSecuritySolutionModel `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// IoTSecuritySolutionsListIterator provides access to a complete listing of IoTSecuritySolutionModel +// values. +type IoTSecuritySolutionsListIterator struct { + i int + page IoTSecuritySolutionsListPage +} + +// 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 *IoTSecuritySolutionsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsListIterator.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 *IoTSecuritySolutionsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IoTSecuritySolutionsListIterator) 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 IoTSecuritySolutionsListIterator) Response() IoTSecuritySolutionsList { + 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 IoTSecuritySolutionsListIterator) Value() IoTSecuritySolutionModel { + if !iter.page.NotDone() { + return IoTSecuritySolutionModel{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IoTSecuritySolutionsListIterator type. +func NewIoTSecuritySolutionsListIterator(page IoTSecuritySolutionsListPage) IoTSecuritySolutionsListIterator { + return IoTSecuritySolutionsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (itssl IoTSecuritySolutionsList) IsEmpty() bool { + return itssl.Value == nil || len(*itssl.Value) == 0 +} + +// ioTSecuritySolutionsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (itssl IoTSecuritySolutionsList) ioTSecuritySolutionsListPreparer(ctx context.Context) (*http.Request, error) { + if itssl.NextLink == nil || len(to.String(itssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(itssl.NextLink))) +} + +// IoTSecuritySolutionsListPage contains a page of IoTSecuritySolutionModel values. +type IoTSecuritySolutionsListPage struct { + fn func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error) + itssl IoTSecuritySolutionsList +} + +// 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 *IoTSecuritySolutionsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsListPage.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.itssl) + if err != nil { + return err + } + page.itssl = 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 *IoTSecuritySolutionsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IoTSecuritySolutionsListPage) NotDone() bool { + return !page.itssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IoTSecuritySolutionsListPage) Response() IoTSecuritySolutionsList { + return page.itssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IoTSecuritySolutionsListPage) Values() []IoTSecuritySolutionModel { + if page.itssl.IsEmpty() { + return nil + } + return *page.itssl.Value +} + +// Creates a new instance of the IoTSecuritySolutionsListPage type. +func NewIoTSecuritySolutionsListPage(getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { + return IoTSecuritySolutionsListPage{fn: getNextPage} +} + +// IoTSeverityMetrics severity metrics +type IoTSeverityMetrics struct { + // High - count of high severity items + High *int32 `json:"high,omitempty"` + // Medium - count of medium severity items + Medium *int32 `json:"medium,omitempty"` + // Low - count of low severity items + Low *int32 `json:"low,omitempty"` +} + +// JitNetworkAccessPoliciesList ... +type JitNetworkAccessPoliciesList struct { + autorest.Response `json:"-"` + Value *[]JitNetworkAccessPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy +// values. +type JitNetworkAccessPoliciesListIterator struct { + i int + page JitNetworkAccessPoliciesListPage +} + +// 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 *JitNetworkAccessPoliciesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListIterator.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 *JitNetworkAccessPoliciesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JitNetworkAccessPoliciesListIterator) 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 JitNetworkAccessPoliciesListIterator) Response() JitNetworkAccessPoliciesList { + 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 JitNetworkAccessPoliciesListIterator) Value() JitNetworkAccessPolicy { + if !iter.page.NotDone() { + return JitNetworkAccessPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JitNetworkAccessPoliciesListIterator type. +func NewJitNetworkAccessPoliciesListIterator(page JitNetworkAccessPoliciesListPage) JitNetworkAccessPoliciesListIterator { + return JitNetworkAccessPoliciesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jnapl JitNetworkAccessPoliciesList) IsEmpty() bool { + return jnapl.Value == nil || len(*jnapl.Value) == 0 +} + +// jitNetworkAccessPoliciesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jnapl JitNetworkAccessPoliciesList) jitNetworkAccessPoliciesListPreparer(ctx context.Context) (*http.Request, error) { + if jnapl.NextLink == nil || len(to.String(jnapl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jnapl.NextLink))) +} + +// JitNetworkAccessPoliciesListPage contains a page of JitNetworkAccessPolicy values. +type JitNetworkAccessPoliciesListPage struct { + fn func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error) + jnapl JitNetworkAccessPoliciesList +} + +// 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 *JitNetworkAccessPoliciesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListPage.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.jnapl) + if err != nil { + return err + } + page.jnapl = 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 *JitNetworkAccessPoliciesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JitNetworkAccessPoliciesListPage) NotDone() bool { + return !page.jnapl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JitNetworkAccessPoliciesListPage) Response() JitNetworkAccessPoliciesList { + return page.jnapl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JitNetworkAccessPoliciesListPage) Values() []JitNetworkAccessPolicy { + if page.jnapl.IsEmpty() { + return nil + } + return *page.jnapl.Value +} + +// Creates a new instance of the JitNetworkAccessPoliciesListPage type. +func NewJitNetworkAccessPoliciesListPage(getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { + return JitNetworkAccessPoliciesListPage{fn: getNextPage} +} + +// JitNetworkAccessPolicy ... +type JitNetworkAccessPolicy struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *JitNetworkAccessPolicyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JitNetworkAccessPolicy. +func (jnap JitNetworkAccessPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jnap.Kind != nil { + objectMap["kind"] = jnap.Kind + } + if jnap.JitNetworkAccessPolicyProperties != nil { + objectMap["properties"] = jnap.JitNetworkAccessPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JitNetworkAccessPolicy struct. +func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jnap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jnap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jnap.Type = &typeVar + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + jnap.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jnap.Location = &location + } + case "properties": + if v != nil { + var jitNetworkAccessPolicyProperties JitNetworkAccessPolicyProperties + err = json.Unmarshal(*v, &jitNetworkAccessPolicyProperties) + if err != nil { + return err + } + jnap.JitNetworkAccessPolicyProperties = &jitNetworkAccessPolicyProperties + } + } + } + + return nil +} + +// JitNetworkAccessPolicyInitiatePort ... +type JitNetworkAccessPolicyInitiatePort struct { + Number *int32 `json:"number,omitempty"` + // AllowedSourceAddressPrefix - Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request. + AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` + // EndTimeUtc - The time to close the request in UTC + EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` +} + +// JitNetworkAccessPolicyInitiateRequest ... +type JitNetworkAccessPolicyInitiateRequest struct { + // VirtualMachines - A list of virtual machines & ports to open access for + VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` +} + +// JitNetworkAccessPolicyInitiateVirtualMachine ... +type JitNetworkAccessPolicyInitiateVirtualMachine struct { + // ID - Resource ID of the virtual machine that is linked to this policy + ID *string `json:"id,omitempty"` + // Ports - The ports to open for the resource with the `id` + Ports *[]JitNetworkAccessPolicyInitiatePort `json:"ports,omitempty"` +} + +// JitNetworkAccessPolicyProperties ... +type JitNetworkAccessPolicyProperties struct { + // VirtualMachines - Configurations for Microsoft.Compute/virtualMachines resource type. + VirtualMachines *[]JitNetworkAccessPolicyVirtualMachine `json:"virtualMachines,omitempty"` + Requests *[]JitNetworkAccessRequest `json:"requests,omitempty"` + // ProvisioningState - READ-ONLY; Gets the provisioning state of the Just-in-Time policy. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// JitNetworkAccessPolicyVirtualMachine ... +type JitNetworkAccessPolicyVirtualMachine struct { + // ID - Resource ID of the virtual machine that is linked to this policy + ID *string `json:"id,omitempty"` + // Ports - Port configurations for the virtual machine + Ports *[]JitNetworkAccessPortRule `json:"ports,omitempty"` + // PublicIPAddress - Public IP address of the Azure Firewall that is linked to this policy, if applicable + PublicIPAddress *string `json:"publicIpAddress,omitempty"` +} + +// JitNetworkAccessPortRule ... +type JitNetworkAccessPortRule struct { + Number *int32 `json:"number,omitempty"` + // Protocol - Possible values include: 'TCP', 'UDP', 'All' + Protocol Protocol `json:"protocol,omitempty"` + // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` + // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` // MaxRequestAccessDuration - Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day MaxRequestAccessDuration *string `json:"maxRequestAccessDuration,omitempty"` @@ -4857,6 +5928,16 @@ type PublisherInfo struct { Version *string `json:"version,omitempty"` } +// RecommendationConfigurationProperties recommendation configuration +type RecommendationConfigurationProperties struct { + // RecommendationType - The recommendation type. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' + RecommendationType RecommendationType `json:"recommendationType,omitempty"` + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Status - Recommendation status. The recommendation is not generated when the status is disabled. Possible values include: 'Disabled', 'Enabled' + Status RecommendationConfigStatus `json:"status,omitempty"` +} + // RegulatoryComplianceAssessment regulatory compliance assessment details and state type RegulatoryComplianceAssessment struct { autorest.Response `json:"-"` @@ -5769,6 +6850,21 @@ func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (Settin return SettingsListPage{fn: getNextPage} } +// TagsResource a container holding only the Tags for a resource, allowing the user to update the tags. +type TagsResource struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsResource. +func (tr TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + return json.Marshal(objectMap) +} + // Task security task that we recommend to do in order to strengthen security type Task struct { autorest.Response `json:"-"` @@ -6357,6 +7453,37 @@ type TopologySingleResourceParent struct { ResourceID *string `json:"resourceId,omitempty"` } +// UpdateIotSecuritySolutionData ... +type UpdateIotSecuritySolutionData struct { + UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` + RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateIotSecuritySolutionData. +func (uissd UpdateIotSecuritySolutionData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uissd.UserDefinedResources != nil { + objectMap["userDefinedResources"] = uissd.UserDefinedResources + } + if uissd.RecommendationsConfiguration != nil { + objectMap["recommendationsConfiguration"] = uissd.RecommendationsConfiguration + } + if uissd.Tags != nil { + objectMap["tags"] = uissd.Tags + } + return json.Marshal(objectMap) +} + +// UserDefinedResourcesProperties properties of the solution's user defined resources. +type UserDefinedResourcesProperties struct { + // Query - Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"" + Query *string `json:"query,omitempty"` + // QuerySubscriptions - List of Azure subscription ids on which the user defined resources query should be executed. + QuerySubscriptions *[]string `json:"querySubscriptions,omitempty"` +} + // UserRecommendation represents a user that is recommended to be allowed for a certain rule type UserRecommendation struct { // Username - Represents a user that is recommended to be allowed for a certain rule diff --git a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go index 357335dd3a70..dde4288d926e 100644 --- a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go @@ -131,6 +131,67 @@ type InformationProtectionPoliciesClientAPI interface { var _ InformationProtectionPoliciesClientAPI = (*security.InformationProtectionPoliciesClient)(nil) +// IoTSecuritySolutionsClientAPI contains the set of methods on the IoTSecuritySolutionsClient type. +type IoTSecuritySolutionsClientAPI interface { + List(ctx context.Context, filter string) (result security.IoTSecuritySolutionsListPage, err error) +} + +var _ IoTSecuritySolutionsClientAPI = (*security.IoTSecuritySolutionsClient)(nil) + +// IoTSecuritySolutionsResourceGroupClientAPI contains the set of methods on the IoTSecuritySolutionsResourceGroupClient type. +type IoTSecuritySolutionsResourceGroupClientAPI interface { + List(ctx context.Context, resourceGroupName string, filter string) (result security.IoTSecuritySolutionsListPage, err error) +} + +var _ IoTSecuritySolutionsResourceGroupClientAPI = (*security.IoTSecuritySolutionsResourceGroupClient)(nil) + +// IotSecuritySolutionClientAPI contains the set of methods on the IotSecuritySolutionClient type. +type IotSecuritySolutionClientAPI interface { + Create(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData security.IoTSecuritySolutionModel) (result security.IoTSecuritySolutionModel, err error) + Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionModel, err error) + Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData security.UpdateIotSecuritySolutionData) (result security.IoTSecuritySolutionModel, err error) +} + +var _ IotSecuritySolutionClientAPI = (*security.IotSecuritySolutionClient)(nil) + +// IoTSecuritySolutionsAnalyticsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsClient type. +type IoTSecuritySolutionsAnalyticsClientAPI interface { + GetAll(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModelList, err error) + GetDefault(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModel, err error) +} + +var _ IoTSecuritySolutionsAnalyticsClientAPI = (*security.IoTSecuritySolutionsAnalyticsClient)(nil) + +// IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertsClient type. +type IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI interface { + List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedAlertListPage, err error) +} + +var _ IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient)(nil) + +// IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertClient type. +type IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI interface { + Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result security.IoTSecurityAggregatedAlert, err error) +} + +var _ IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient)(nil) + +// IoTSecuritySolutionsAnalyticsRecommendationClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationClient type. +type IoTSecuritySolutionsAnalyticsRecommendationClientAPI interface { + Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result security.IoTSecurityAggregatedRecommendation, err error) +} + +var _ IoTSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationClient)(nil) + +// IoTSecuritySolutionsAnalyticsRecommendationsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationsClient type. +type IoTSecuritySolutionsAnalyticsRecommendationsClientAPI interface { + List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedRecommendationListPage, err error) +} + +var _ IoTSecuritySolutionsAnalyticsRecommendationsClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationsClient)(nil) + // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result security.OperationListPage, err error) diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go index 73b1112f75c2..69320fae227d 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go @@ -107,7 +107,7 @@ func (client IotSecuritySolutionClient) CreatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -200,7 +200,7 @@ func (client IotSecuritySolutionClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,7 +287,7 @@ func (client IotSecuritySolutionClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -377,7 +377,7 @@ func (client IotSecuritySolutionClient) UpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go index 14fbfd273a72..03b256dad4c7 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutions.go @@ -89,7 +89,7 @@ func (client IoTSecuritySolutionsClient) ListPreparer(ctx context.Context, filte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go index d242868be31b..22ce11631743 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalytics.go @@ -97,7 +97,7 @@ func (client IoTSecuritySolutionsAnalyticsClient) GetAllPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -185,7 +185,7 @@ func (client IoTSecuritySolutionsAnalyticsClient) GetDefaultPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go index 07196e670723..27eddd6c8c14 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go @@ -101,7 +101,7 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) DismissPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -190,7 +190,7 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertClient) GetPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go index 0e295e14f36b..1cc08c1c364a 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go @@ -101,7 +101,7 @@ func (client IoTSecuritySolutionsAnalyticsAggregatedAlertsClient) ListPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go index ff3fad682371..ead902a83498 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go @@ -101,7 +101,7 @@ func (client IoTSecuritySolutionsAnalyticsRecommendationClient) GetPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendations.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendations.go index fbda8ca7f69e..0a4201655260 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendations.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendations.go @@ -101,7 +101,7 @@ func (client IoTSecuritySolutionsAnalyticsRecommendationsClient) ListPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsresourcegroup.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsresourcegroup.go index 71faba118a1e..a2214a0bdf94 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsresourcegroup.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsresourcegroup.go @@ -99,7 +99,7 @@ func (client IoTSecuritySolutionsResourceGroupClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index d9aa8af052a7..5b885ef56c87 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -4529,8 +4529,6 @@ type IoTSecurityAlertedDevice struct { type IoTSecurityAlertedDevicesList struct { // Value - List of aggregated alerts data Value *[]IoTSecurityAlertedDevice `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` } // IoTSecurityDeviceAlert statistic information about the number of alerts per alert type during the last @@ -4567,8 +4565,6 @@ type IoTSecurityDeviceRecommendation struct { type IoTSecurityDeviceRecommendationsList struct { // Value - List of aggregated recommendation data Value *[]IoTSecurityDeviceRecommendation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` } // IoTSecuritySolutionAnalyticsModel security Analytics of a security solution diff --git a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go index 573a51be7f5f..c795ece3011d 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -63,6 +63,67 @@ type SettingsClientAPI interface { var _ SettingsClientAPI = (*security.SettingsClient)(nil) +// IoTSecuritySolutionsClientAPI contains the set of methods on the IoTSecuritySolutionsClient type. +type IoTSecuritySolutionsClientAPI interface { + List(ctx context.Context, filter string) (result security.IoTSecuritySolutionsListPage, err error) +} + +var _ IoTSecuritySolutionsClientAPI = (*security.IoTSecuritySolutionsClient)(nil) + +// IoTSecuritySolutionsResourceGroupClientAPI contains the set of methods on the IoTSecuritySolutionsResourceGroupClient type. +type IoTSecuritySolutionsResourceGroupClientAPI interface { + List(ctx context.Context, resourceGroupName string, filter string) (result security.IoTSecuritySolutionsListPage, err error) +} + +var _ IoTSecuritySolutionsResourceGroupClientAPI = (*security.IoTSecuritySolutionsResourceGroupClient)(nil) + +// IotSecuritySolutionClientAPI contains the set of methods on the IotSecuritySolutionClient type. +type IotSecuritySolutionClientAPI interface { + Create(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData security.IoTSecuritySolutionModel) (result security.IoTSecuritySolutionModel, err error) + Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionModel, err error) + Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData security.UpdateIotSecuritySolutionData) (result security.IoTSecuritySolutionModel, err error) +} + +var _ IotSecuritySolutionClientAPI = (*security.IotSecuritySolutionClient)(nil) + +// IoTSecuritySolutionsAnalyticsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsClient type. +type IoTSecuritySolutionsAnalyticsClientAPI interface { + GetAll(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModelList, err error) + GetDefault(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModel, err error) +} + +var _ IoTSecuritySolutionsAnalyticsClientAPI = (*security.IoTSecuritySolutionsAnalyticsClient)(nil) + +// IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertsClient type. +type IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI interface { + List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedAlertListPage, err error) +} + +var _ IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient)(nil) + +// IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertClient type. +type IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI interface { + Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result security.IoTSecurityAggregatedAlert, err error) +} + +var _ IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient)(nil) + +// IoTSecuritySolutionsAnalyticsRecommendationClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationClient type. +type IoTSecuritySolutionsAnalyticsRecommendationClientAPI interface { + Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result security.IoTSecurityAggregatedRecommendation, err error) +} + +var _ IoTSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationClient)(nil) + +// IoTSecuritySolutionsAnalyticsRecommendationsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationsClient type. +type IoTSecuritySolutionsAnalyticsRecommendationsClientAPI interface { + List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedRecommendationListPage, err error) +} + +var _ IoTSecuritySolutionsAnalyticsRecommendationsClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationsClient)(nil) + // AllowedConnectionsClientAPI contains the set of methods on the AllowedConnectionsClient type. type AllowedConnectionsClientAPI interface { Get(ctx context.Context, resourceGroupName string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) @@ -206,67 +267,6 @@ type WorkspaceSettingsClientAPI interface { var _ WorkspaceSettingsClientAPI = (*security.WorkspaceSettingsClient)(nil) -// IoTSecuritySolutionsClientAPI contains the set of methods on the IoTSecuritySolutionsClient type. -type IoTSecuritySolutionsClientAPI interface { - List(ctx context.Context, filter string) (result security.IoTSecuritySolutionsListPage, err error) -} - -var _ IoTSecuritySolutionsClientAPI = (*security.IoTSecuritySolutionsClient)(nil) - -// IoTSecuritySolutionsResourceGroupClientAPI contains the set of methods on the IoTSecuritySolutionsResourceGroupClient type. -type IoTSecuritySolutionsResourceGroupClientAPI interface { - List(ctx context.Context, resourceGroupName string, filter string) (result security.IoTSecuritySolutionsListPage, err error) -} - -var _ IoTSecuritySolutionsResourceGroupClientAPI = (*security.IoTSecuritySolutionsResourceGroupClient)(nil) - -// IotSecuritySolutionClientAPI contains the set of methods on the IotSecuritySolutionClient type. -type IotSecuritySolutionClientAPI interface { - Create(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData security.IoTSecuritySolutionModel) (result security.IoTSecuritySolutionModel, err error) - Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionModel, err error) - Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData security.UpdateIotSecuritySolutionData) (result security.IoTSecuritySolutionModel, err error) -} - -var _ IotSecuritySolutionClientAPI = (*security.IotSecuritySolutionClient)(nil) - -// IoTSecuritySolutionsAnalyticsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsClient type. -type IoTSecuritySolutionsAnalyticsClientAPI interface { - GetAll(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModelList, err error) - GetDefault(ctx context.Context, resourceGroupName string, solutionName string) (result security.IoTSecuritySolutionAnalyticsModel, err error) -} - -var _ IoTSecuritySolutionsAnalyticsClientAPI = (*security.IoTSecuritySolutionsAnalyticsClient)(nil) - -// IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertsClient type. -type IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI interface { - List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedAlertListPage, err error) -} - -var _ IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient)(nil) - -// IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsAggregatedAlertClient type. -type IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI interface { - Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string) (result security.IoTSecurityAggregatedAlert, err error) -} - -var _ IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI = (*security.IoTSecuritySolutionsAnalyticsAggregatedAlertClient)(nil) - -// IoTSecuritySolutionsAnalyticsRecommendationClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationClient type. -type IoTSecuritySolutionsAnalyticsRecommendationClientAPI interface { - Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string) (result security.IoTSecurityAggregatedRecommendation, err error) -} - -var _ IoTSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationClient)(nil) - -// IoTSecuritySolutionsAnalyticsRecommendationsClientAPI contains the set of methods on the IoTSecuritySolutionsAnalyticsRecommendationsClient type. -type IoTSecuritySolutionsAnalyticsRecommendationsClientAPI interface { - List(ctx context.Context, resourceGroupName string, solutionName string, top *int32) (result security.IoTSecurityAggregatedRecommendationListPage, err error) -} - -var _ IoTSecuritySolutionsAnalyticsRecommendationsClientAPI = (*security.IoTSecuritySolutionsAnalyticsRecommendationsClient)(nil) - // RegulatoryComplianceStandardsClientAPI contains the set of methods on the RegulatoryComplianceStandardsClient type. type RegulatoryComplianceStandardsClientAPI interface { Get(ctx context.Context, regulatoryComplianceStandardName string) (result security.RegulatoryComplianceStandard, err error) From dbbb71c1a31b4c24ec8ca790325c250747102c54 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 5 Aug 2019 06:50:06 -0700 Subject: [PATCH 3/3] Generated from e2aaa71c099725ee90c36c388f88398bc33c000c (#5436) Merge https://github.com/Azure/azure-rest-api-specs --- .../preview/security/mgmt/v2.0/security/models.go | 6 ++++-- .../preview/security/mgmt/v2.0/security/pricings.go | 12 +++--------- .../preview/security/mgmt/v3.0/security/models.go | 6 ++++-- .../preview/security/mgmt/v3.0/security/pricings.go | 12 +++--------- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index 4e6659976cea..01ae7161a81d 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -5828,7 +5828,9 @@ type PathRecommendation struct { ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` } -// Pricing pricing tier will be applied for the scope based on the resource ID +// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard +// tier available with a trial period. The standard tier offers advanced security capabilities, while the +// free tier offers basic security features. type Pricing struct { autorest.Response `json:"-"` // PricingProperties - Pricing data @@ -5901,7 +5903,7 @@ func (p *Pricing) UnmarshalJSON(body []byte) error { return nil } -// PricingList list of pricing configurations response +// PricingList list of pricing configurations response. type PricingList struct { autorest.Response `json:"-"` // Value - List of pricing configurations diff --git a/services/preview/security/mgmt/v2.0/security/pricings.go b/services/preview/security/mgmt/v2.0/security/pricings.go index 07566049a986..d43a4ac71fb5 100644 --- a/services/preview/security/mgmt/v2.0/security/pricings.go +++ b/services/preview/security/mgmt/v2.0/security/pricings.go @@ -41,9 +41,7 @@ func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLoca return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Get a given security pricing configuration in the subscription. Azure Security Center is available in two pricing -// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and -// Storage accounts. +// Get gets a provided Security Center pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { @@ -124,9 +122,7 @@ func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, return } -// List a given security pricing configuration in the subscription. Azure Security Center is available in two pricing -// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and -// Storage accounts. +// List lists Security Center pricing configurations in the subscription. func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") @@ -204,9 +200,7 @@ func (client PricingsClient) ListResponder(resp *http.Response) (result PricingL return } -// Update a given security pricing configuration in the subscription. Azure Security Center is available in two pricing -// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and -// Storage accounts. +// Update updates a provided Security Center pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration // pricing - pricing object diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 5b885ef56c87..5e32802273f0 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -5482,7 +5482,9 @@ type PathRecommendation struct { ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` } -// Pricing pricing tier will be applied for the scope based on the resource ID +// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard +// tier available with a trial period. The standard tier offers advanced security capabilities, while the +// free tier offers basic security features. type Pricing struct { autorest.Response `json:"-"` // PricingProperties - Pricing data @@ -5555,7 +5557,7 @@ func (p *Pricing) UnmarshalJSON(body []byte) error { return nil } -// PricingList list of pricing configurations response +// PricingList list of pricing configurations response. type PricingList struct { autorest.Response `json:"-"` // Value - List of pricing configurations diff --git a/services/preview/security/mgmt/v3.0/security/pricings.go b/services/preview/security/mgmt/v3.0/security/pricings.go index 07566049a986..d43a4ac71fb5 100644 --- a/services/preview/security/mgmt/v3.0/security/pricings.go +++ b/services/preview/security/mgmt/v3.0/security/pricings.go @@ -41,9 +41,7 @@ func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLoca return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Get a given security pricing configuration in the subscription. Azure Security Center is available in two pricing -// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and -// Storage accounts. +// Get gets a provided Security Center pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { @@ -124,9 +122,7 @@ func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, return } -// List a given security pricing configuration in the subscription. Azure Security Center is available in two pricing -// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and -// Storage accounts. +// List lists Security Center pricing configurations in the subscription. func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") @@ -204,9 +200,7 @@ func (client PricingsClient) ListResponder(resp *http.Response) (result PricingL return } -// Update a given security pricing configuration in the subscription. Azure Security Center is available in two pricing -// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and -// Storage accounts. +// Update updates a provided Security Center pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration // pricing - pricing object