@@ -235,8 +235,34 @@ func (h *AccountHandler) GetAccountHandler(w http.ResponseWriter, r *http.Reques
235
235
w .WriteHeader (http .StatusOK )
236
236
render .Render (w , r , & sandbox )
237
237
return
238
+
239
+ case "DNSSandbox" , "dns" :
240
+ sandbox , err := h .DNSSandboxProvider .FetchByName (accountName )
241
+ if err != nil {
242
+ if err == models .ErrAccountNotFound {
243
+ log .Logger .Warn ("GET account" , "error" , err )
244
+ w .WriteHeader (http .StatusNotFound )
245
+ render .Render (w , r , & v1.Error {
246
+ HTTPStatusCode : http .StatusNotFound ,
247
+ Message : "Account not found" ,
248
+ })
249
+ return
250
+ }
251
+ log .Logger .Error ("GET account" , "error" , err )
252
+
253
+ w .WriteHeader (http .StatusInternalServerError )
254
+ render .Render (w , r , & v1.Error {
255
+ HTTPStatusCode : 500 ,
256
+ Message : "Error reading account" ,
257
+ })
258
+ return
259
+ }
260
+ // Print account using JSON
261
+ w .WriteHeader (http .StatusOK )
262
+ render .Render (w , r , & sandbox )
263
+ return
264
+
238
265
case "IBMResourceGroupSandbox" , "ibmrg" :
239
- // Get the account from DynamoDB
240
266
sandbox , err := h .IBMResourceGroupSandboxProvider .FetchByName (accountName )
241
267
if err != nil {
242
268
if err == models .ErrAccountNotFound {
0 commit comments