Forráskód Böngészése

docs: add swagger error codes for /trace/:name/[log|download]

Stefan Strigler 3 éve
szülő
commit
f8dd8d652d
1 módosított fájl, 6 hozzáadás és 2 törlés
  1. 6 2
      apps/emqx_management/src/emqx_mgmt_api_trace.erl

+ 6 - 2
apps/emqx_management/src/emqx_mgmt_api_trace.erl

@@ -140,7 +140,8 @@ schema("/trace/:name/download") ->
                             'application/octet-stream' =>
                             'application/octet-stream' =>
                                 #{schema => #{type => "string", format => "binary"}}
                                 #{schema => #{type => "string", format => "binary"}}
                         }
                         }
-                    }
+                    },
+                404 => emqx_dashboard_swagger:error_codes(['NOT_FOUND'], <<"Trace Name Not Found">>)
             }
             }
         }
         }
     };
     };
@@ -174,7 +175,10 @@ schema("/trace/:name/log") ->
                     [
                     [
                         {items, hoconsc:mk(binary(), #{example => "TEXT-LOG-ITEMS"})},
                         {items, hoconsc:mk(binary(), #{example => "TEXT-LOG-ITEMS"})},
                         {meta, fields(bytes) ++ fields(position)}
                         {meta, fields(bytes) ++ fields(position)}
-                    ]
+                    ],
+                400 => emqx_dashboard_swagger:error_codes(
+                    ['READ_FILE_ERROR', 'RPC_ERROR', 'NODE_ERROR'], <<"Trace Log Failed">>
+                )
             }
             }
         }
         }
     }.
     }.