diff --git a/services/network/mgmt/2018-01-01/network/models.go b/services/network/mgmt/2018-01-01/network/models.go index 7a77ce1ab6f9..2da829618a9e 100644 --- a/services/network/mgmt/2018-01-01/network/models.go +++ b/services/network/mgmt/2018-01-01/network/models.go @@ -7010,12 +7010,13 @@ type ExpressRouteServiceProviderPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// FlowLogInformation information on the configuration of flow log. +// FlowLogInformation information on the configuration of flow log and traffic analytics (optional). type FlowLogInformation struct { autorest.Response `json:"-"` // TargetResourceID - The ID of the resource to configure for flow logging. - TargetResourceID *string `json:"targetResourceId,omitempty"` - *FlowLogProperties `json:"properties,omitempty"` + TargetResourceID *string `json:"targetResourceId,omitempty"` + *FlowLogProperties `json:"properties,omitempty"` + *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` } // MarshalJSON is the custom marshaler for FlowLogInformation. @@ -7027,6 +7028,9 @@ func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { if fli.FlowLogProperties != nil { objectMap["properties"] = fli.FlowLogProperties } + if fli.TrafficAnalyticsProperties != nil { + objectMap["flowAnalyticsConfiguration"] = fli.TrafficAnalyticsProperties + } return json.Marshal(objectMap) } @@ -7057,6 +7061,15 @@ func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { } fli.FlowLogProperties = &flowLogProperties } + case "flowAnalyticsConfiguration": + if v != nil { + var trafficAnalyticsProperties TrafficAnalyticsProperties + err = json.Unmarshal(*v, &trafficAnalyticsProperties) + if err != nil { + return err + } + fli.TrafficAnalyticsProperties = &trafficAnalyticsProperties + } } } @@ -7072,9 +7085,10 @@ type FlowLogProperties struct { RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` } -// FlowLogStatusParameters parameters that define a resource to query flow log status. +// FlowLogStatusParameters parameters that define a resource to query flow log and traffic analytics (optional) +// status. type FlowLogStatusParameters struct { - // TargetResourceID - The target resource where getting the flow logging status. + // TargetResourceID - The target resource where getting the flow logging and traffic analytics (optional) status. TargetResourceID *string `json:"targetResourceId,omitempty"` } @@ -14134,6 +14148,23 @@ type TopologyResource struct { Associations *[]TopologyAssociation `json:"associations,omitempty"` } +// TrafficAnalyticsConfigurationProperties parameters that define the configuration of traffic analytics. +type TrafficAnalyticsConfigurationProperties struct { + // Enabled - Flag to enable/disable traffic analytics. + Enabled *bool `json:"enabled,omitempty"` + // WorkspaceID - The resource guid of the attached workspace + WorkspaceID *string `json:"workspaceId,omitempty"` + // WorkspaceRegion - The location of the attached workspace + WorkspaceRegion *string `json:"workspaceRegion,omitempty"` + // WorkspaceResourceID - Resource Id of the attached workspace + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` +} + +// TrafficAnalyticsProperties parameters that define the configuration of traffic analytics. +type TrafficAnalyticsProperties struct { + NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` +} + // TroubleshootingDetails information gained from troubleshooting of specified resource. type TroubleshootingDetails struct { // ID - The id of the get troubleshoot operation. diff --git a/services/network/mgmt/2018-01-01/network/watchers.go b/services/network/mgmt/2018-01-01/network/watchers.go index 94c5839a67ca..1d5f6decb397 100644 --- a/services/network/mgmt/2018-01-01/network/watchers.go +++ b/services/network/mgmt/2018-01-01/network/watchers.go @@ -403,10 +403,11 @@ func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Resp return } -// GetFlowLogStatus queries status of flow log on a specified resource. +// GetFlowLogStatus queries status of flow log and traffic analytics (optional) on a specified resource. // // resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the -// network watcher resource. parameters is parameters that define a resource to query flow log status. +// network watcher resource. parameters is parameters that define a resource to query flow log and traffic +// analytics (optional) status. func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (result WatchersGetFlowLogStatusFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -1061,7 +1062,7 @@ func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response return } -// SetFlowLogConfiguration configures flow log on a specified resource. +// SetFlowLogConfiguration configures flow log and traffic analytics (optional) on a specified resource. // // resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the // network watcher resource. parameters is parameters that define the configuration of flow log. @@ -1072,6 +1073,14 @@ func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resour {Target: "parameters.FlowLogProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.FlowLogProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.FlowLogProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.TrafficAnalyticsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TrafficAnalyticsProperties.NetworkWatcherFlowAnalyticsConfiguration", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.TrafficAnalyticsProperties.NetworkWatcherFlowAnalyticsConfiguration.Enabled", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TrafficAnalyticsProperties.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TrafficAnalyticsProperties.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceRegion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TrafficAnalyticsProperties.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceResourceID", Name: validation.Null, Rule: true, Chain: nil}, + }}, }}}}}); err != nil { return result, validation.NewError("network.WatchersClient", "SetFlowLogConfiguration", err.Error()) }