@@ -965,6 +965,20 @@ async def purge_command(session, args):
965965 return job
966966
967967
968+ async def prune_command (session , args ):
969+ resp = await session .post (
970+ urljoin (args .manager_url , "api/v1/prune" ),
971+ headers = {"Authorization" : "Bearer " + args .token },
972+ json = {"repo" : args .repo },
973+ )
974+ async with resp :
975+ if resp .status >= 500 :
976+ raise ServerApiError (resp , await resp .text ())
977+ elif resp .status != 200 :
978+ raise ApiError (resp , await resp .text ())
979+ return await resp .json ()
980+
981+
968982async def create_token_command (session , args ):
969983 data = await create_token (
970984 session ,
@@ -1204,17 +1218,3 @@ if __name__ == "__main__":
12041218 f .write ("\n " )
12051219 f .close ()
12061220 exit (res )
1207-
1208-
1209- async def prune_command (args , session ):
1210- resp = await session .post (
1211- urljoin (args .manager_url , "api/v1/prune" ),
1212- headers = {"Authorization" : "Bearer " + args .token },
1213- json = {"repo" : args .repo },
1214- )
1215- async with resp :
1216- if resp .status >= 500 :
1217- raise ServerApiError (resp , await resp .text ())
1218- elif resp .status != 200 :
1219- raise ApiError (resp , await resp .text ())
1220- return await resp .json ()
0 commit comments