@@ -23,10 +23,11 @@ import (
2323 "strings"
2424 "time"
2525
26- "github.com/lacework/go-sdk/api"
2726 "github.com/olekukonko/tablewriter"
2827 "github.com/pkg/errors"
2928 "github.com/spf13/cobra"
29+
30+ "github.com/lacework/go-sdk/api"
3031)
3132
3233var (
@@ -47,15 +48,7 @@ Then, select one GUID from an integration and visialize its details using the co
4748` ,
4849 Args : cobra .ExactArgs (1 ),
4950 RunE : func (_ * cobra.Command , args []string ) error {
50- lacework , err := api .NewClient (cli .Account ,
51- api .WithLogLevel (cli .LogLevel ),
52- api .WithApiKeys (cli .KeyID , cli .Secret ),
53- )
54- if err != nil {
55- return errors .Wrap (err , "unable to generate api client" )
56- }
57-
58- response , err := lacework .Compliance .ListAzureSubscriptions (args [0 ])
51+ response , err := cli .LwApi .Compliance .ListAzureSubscriptions (args [0 ])
5952 if err != nil {
6053 return errors .Wrap (err , "unable to list azure subscriptions" )
6154 }
@@ -94,14 +87,6 @@ To run an ad-hoc compliance assessment use the command:
9487` ,
9588 Args : cobra .ExactArgs (2 ),
9689 RunE : func (_ * cobra.Command , args []string ) error {
97- lacework , err := api .NewClient (cli .Account ,
98- api .WithLogLevel (cli .LogLevel ),
99- api .WithApiKeys (cli .KeyID , cli .Secret ),
100- )
101- if err != nil {
102- return errors .Wrap (err , "unable to generate api client" )
103- }
104-
10590 config := api.ComplianceAzureReportConfig {
10691 TenantID : args [0 ],
10792 SubscriptionID : args [1 ],
@@ -110,7 +95,7 @@ To run an ad-hoc compliance assessment use the command:
11095
11196 if compCmdState .PdfName != "" {
11297 cli .StartProgress (" Downloading compliance report..." )
113- err := lacework .Compliance .DownloadAzureReportPDF (compCmdState .PdfName , config )
98+ err := cli . LwApi .Compliance .DownloadAzureReportPDF (compCmdState .PdfName , config )
11499 cli .StopProgress ()
115100 if err != nil {
116101 return errors .Wrap (err , "unable to get azure pdf compliance report" )
@@ -121,7 +106,7 @@ To run an ad-hoc compliance assessment use the command:
121106 }
122107
123108 cli .StartProgress (" Getting compliance report..." )
124- response , err := lacework .Compliance .GetAzureReport (config )
109+ response , err := cli . LwApi .Compliance .GetAzureReport (config )
125110 cli .StopProgress ()
126111 if err != nil {
127112 return errors .Wrap (err , "unable to get azure compliance report" )
@@ -156,15 +141,7 @@ To run an ad-hoc compliance assessment use the command:
156141 Long : `Run a compliance assessment of the provided Azure tenant.` ,
157142 Args : cobra .ExactArgs (1 ),
158143 RunE : func (_ * cobra.Command , args []string ) error {
159- lacework , err := api .NewClient (cli .Account ,
160- api .WithLogLevel (cli .LogLevel ),
161- api .WithApiKeys (cli .KeyID , cli .Secret ),
162- )
163- if err != nil {
164- return errors .Wrap (err , "unable to generate api client" )
165- }
166-
167- response , err := lacework .Compliance .RunAzureReport (args [0 ])
144+ response , err := cli .LwApi .Compliance .RunAzureReport (args [0 ])
168145 if err != nil {
169146 return errors .Wrap (err , "unable to run azure compliance assessment" )
170147 }
0 commit comments