@@ -21,19 +21,26 @@ func (r *runners) InitNetworkReport(parent *cobra.Command) *cobra.Command {
2121 Short : "Get network report" ,
2222 Long : `Get a network report showing detailed network activity for a specified network.
2323
24- The report shows individual network events including source/destination IPs, ports, protocols,
24+ The report shows individual network events including source/destination IPs, ports, protocols,
2525pods, processes, and DNS queries. Reports must be enabled with 'replicated network update <network-id> --collect-report'.
2626
2727Output formats:
2828 - Default: Full event details in JSON format
2929 - --summary: Aggregated statistics with top domains and destinations
30- - --watch: Continuous stream of new events in JSON Lines format` ,
31- Example : `# Get full network traffic report
30+ - --watch: Continuous stream of new events in JSON Lines format
31+
32+ Filtering:
33+ - --show-external-only: Show only external network traffic (default: true)
34+ Set to false to include internal cluster traffic` ,
35+ Example : `# Get full network traffic report (external traffic only)
3236replicated network report <network-id>
3337
3438# Get aggregated summary with statistics. Only available for networks that have been terminated.
3539replicated network report <network-id> --summary
3640
41+ # Include internal cluster traffic in the report
42+ replicated network report <network-id> --show-external-only=false
43+
3744# Watch for new network events in real-time
3845replicated network report <network-id> --watch` ,
3946 RunE : r .getNetworkReport ,
@@ -69,11 +76,6 @@ func (r *runners) getNetworkReport(cmd *cobra.Command, args []string) error {
6976
7077 // Don't call getNetworkIDFromArg here. Reporting API supports short IDs and will also work for networks that have been deleted.
7178
72- // Validate flags
73- if r .args .networkReportSummary && cmd .Flags ().Lookup ("show-external-only" ).Changed {
74- return fmt .Errorf ("cannot use --show-external-only and --summary flags together" )
75- }
76-
7779 // Get the initial network report or summary depending on args provided
7880 if r .args .networkReportSummary {
7981 return r .getNetworkReportSummary (cmd .Context ())
@@ -150,7 +152,7 @@ func (r *runners) getNetworkReportSummary(ctx context.Context) error {
150152 return fmt .Errorf ("cannot use watch and summary flags together" )
151153 }
152154
153- summary , err := r .kotsAPI .GetNetworkReportSummary (ctx , r .args .networkReportID )
155+ summary , err := r .kotsAPI .GetNetworkReportSummary (ctx , r .args .networkReportID , r . args . networkReportShowExternalOnly )
154156 if errors .Cause (err ) == platformclient .ErrForbidden {
155157 return ErrCompatibilityMatrixTermsNotAccepted
156158 } else if errors .Cause (err ) == platformclient .ErrNotFound {
0 commit comments