@@ -95,6 +95,67 @@ func (c *client) GetLinuxInstallationStatus(ctx context.Context) (types.Status,
9595 return status , nil
9696}
9797
98+ func (c * client ) RunLinuxInstallHostPreflights (ctx context.Context ) (types.InstallHostPreflightsStatusResponse , error ) {
99+ b , err := json .Marshal (types.PostInstallRunHostPreflightsRequest {
100+ IsUI : false ,
101+ })
102+ if err != nil {
103+ return types.InstallHostPreflightsStatusResponse {}, err
104+ }
105+
106+ req , err := http .NewRequestWithContext (ctx , "POST" , c .apiURL + "/api/linux/install/host-preflights/run" , bytes .NewBuffer (b ))
107+ if err != nil {
108+ return types.InstallHostPreflightsStatusResponse {}, err
109+ }
110+ req .Header .Set ("Content-Type" , "application/json" )
111+ setAuthorizationHeader (req , c .token )
112+
113+ resp , err := c .httpClient .Do (req )
114+ if err != nil {
115+ return types.InstallHostPreflightsStatusResponse {}, err
116+ }
117+ defer resp .Body .Close ()
118+
119+ if resp .StatusCode != http .StatusOK {
120+ return types.InstallHostPreflightsStatusResponse {}, errorFromResponse (resp )
121+ }
122+
123+ var status types.InstallHostPreflightsStatusResponse
124+ err = json .NewDecoder (resp .Body ).Decode (& status )
125+ if err != nil {
126+ return types.InstallHostPreflightsStatusResponse {}, err
127+ }
128+
129+ return status , nil
130+ }
131+
132+ func (c * client ) GetLinuxInstallHostPreflightsStatus (ctx context.Context ) (types.InstallHostPreflightsStatusResponse , error ) {
133+ req , err := http .NewRequestWithContext (ctx , "GET" , c .apiURL + "/api/linux/install/host-preflights/status" , nil )
134+ if err != nil {
135+ return types.InstallHostPreflightsStatusResponse {}, err
136+ }
137+ req .Header .Set ("Content-Type" , "application/json" )
138+ setAuthorizationHeader (req , c .token )
139+
140+ resp , err := c .httpClient .Do (req )
141+ if err != nil {
142+ return types.InstallHostPreflightsStatusResponse {}, err
143+ }
144+ defer resp .Body .Close ()
145+
146+ if resp .StatusCode != http .StatusOK {
147+ return types.InstallHostPreflightsStatusResponse {}, errorFromResponse (resp )
148+ }
149+
150+ var status types.InstallHostPreflightsStatusResponse
151+ err = json .NewDecoder (resp .Body ).Decode (& status )
152+ if err != nil {
153+ return types.InstallHostPreflightsStatusResponse {}, err
154+ }
155+
156+ return status , nil
157+ }
158+
98159func (c * client ) SetupLinuxInfra (ctx context.Context , ignoreHostPreflights bool ) (types.Infra , error ) {
99160 b , err := json .Marshal (types.LinuxInfraSetupRequest {
100161 IgnoreHostPreflights : ignoreHostPreflights ,
@@ -156,6 +217,60 @@ func (c *client) GetLinuxInfraStatus(ctx context.Context) (types.Infra, error) {
156217 return infra , nil
157218}
158219
220+ func (c * client ) ProcessLinuxAirgap (ctx context.Context ) (types.Airgap , error ) {
221+ req , err := http .NewRequestWithContext (ctx , "POST" , c .apiURL + "/api/linux/install/airgap/process" , nil )
222+ if err != nil {
223+ return types.Airgap {}, err
224+ }
225+ req .Header .Set ("Content-Type" , "application/json" )
226+ setAuthorizationHeader (req , c .token )
227+
228+ resp , err := c .httpClient .Do (req )
229+ if err != nil {
230+ return types.Airgap {}, err
231+ }
232+ defer resp .Body .Close ()
233+
234+ if resp .StatusCode != http .StatusOK {
235+ return types.Airgap {}, errorFromResponse (resp )
236+ }
237+
238+ var airgap types.Airgap
239+ err = json .NewDecoder (resp .Body ).Decode (& airgap )
240+ if err != nil {
241+ return types.Airgap {}, err
242+ }
243+
244+ return airgap , nil
245+ }
246+
247+ func (c * client ) GetLinuxAirgapStatus (ctx context.Context ) (types.Airgap , error ) {
248+ req , err := http .NewRequestWithContext (ctx , "GET" , c .apiURL + "/api/linux/install/airgap/status" , nil )
249+ if err != nil {
250+ return types.Airgap {}, err
251+ }
252+ req .Header .Set ("Content-Type" , "application/json" )
253+ setAuthorizationHeader (req , c .token )
254+
255+ resp , err := c .httpClient .Do (req )
256+ if err != nil {
257+ return types.Airgap {}, err
258+ }
259+ defer resp .Body .Close ()
260+
261+ if resp .StatusCode != http .StatusOK {
262+ return types.Airgap {}, errorFromResponse (resp )
263+ }
264+
265+ var airgap types.Airgap
266+ err = json .NewDecoder (resp .Body ).Decode (& airgap )
267+ if err != nil {
268+ return types.Airgap {}, err
269+ }
270+
271+ return airgap , nil
272+ }
273+
159274func (c * client ) GetKubernetesInstallationConfig (ctx context.Context ) (types.KubernetesInstallationConfigResponse , error ) {
160275 req , err := http .NewRequestWithContext (ctx , "GET" , c .apiURL + "/api/kubernetes/install/installation/config" , nil )
161276 if err != nil {
@@ -601,8 +716,16 @@ func (c *client) GetKubernetesInstallAppPreflightsStatus(ctx context.Context) (t
601716 return status , nil
602717}
603718
604- func (c * client ) InstallLinuxApp (ctx context.Context ) (types.AppInstall , error ) {
605- req , err := http .NewRequestWithContext (ctx , "POST" , c .apiURL + "/api/linux/install/app/install" , nil )
719+ func (c * client ) InstallLinuxApp (ctx context.Context , ignoreAppPreflights bool ) (types.AppInstall , error ) {
720+ request := types.InstallAppRequest {
721+ IgnoreAppPreflights : ignoreAppPreflights ,
722+ }
723+ b , err := json .Marshal (request )
724+ if err != nil {
725+ return types.AppInstall {}, err
726+ }
727+
728+ req , err := http .NewRequestWithContext (ctx , "POST" , c .apiURL + "/api/linux/install/app/install" , bytes .NewBuffer (b ))
606729 if err != nil {
607730 return types.AppInstall {}, err
608731 }
0 commit comments