45 "Options available in cFSPlib.mngmt library :\n" +
47 " - post_cluster(user, number_of_FPGA_nodes, role_image_id, host_address)\n" +
48 " - get_cluster_data(cluster) \n" +
49 " - get_clusters_data(user) \n" +
50 " - delete_cluster_data(cluster) \n" +
51 " - restart_cluster_apps(cluster) \n" +
53 " - restart_instance_app(instance) \n" +
54 " - delete_instance(instance) \n" +
55 " - Resources (admin users only): \n" +
56 " - get_resource_status(resource_id) \n" +
58 " - cFuser(path/to/credentials.json) \n" +
59 " - load_user_credentials(filedir) \n" +
60 " - show_user_credentials(filedir) \n\n")
64 print(
"Request " + msg +
" failed with HTTP code " +
str(code) +
".")
66 print(
"0 error: no response from server\n")
67 elif (msg ==
"GET cluster")
or (msg ==
"GET clusters")
or (msg ==
"DELETE cluster"):
69 print(
"400 Bad request (maybe login/pass with space char?)\n")
71 print(
"401 Unauthenticated, bad login\n")
73 print(
"403 Unauthorized\n")
75 print(
"404 Cluster does not exist\n")
76 elif msg ==
"POST cluster":
78 print(
"401 Unauthenticated, bad login\n")
80 print(
"404 One of the regested images does not exist\n")
82 print(
"415 Image has wrong type/breed\n")
84 print(
"422 Malformed request\n")
86 print(
"424 Bitfile seems to be preecarious/unstable (e.g. bad timing or could also hide an internal server error)\n")
88 print(
"429 Insufficient Quota\n")
90 print(
"500 Error in communication with devices (maybe try again)\n")
92 print(
"503 No resources available to fullfil the request\n")
94 print(
"507 Network or Memory failure on target device (maybe try again)\n")
96 print(
"508 No network resources available, please contact admins\n")
def print_usage()
Utility Functions.
def errorReqExit(msg, code)