cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
cFSPlib.cfsp_util Namespace Reference

Functions

def print_usage ()
 Utility Functions. More...
 
def errorReqExit (msg, code)
 

Function Documentation

◆ errorReqExit()

def cFSPlib.cfsp_util.errorReqExit (   msg,
  code 
)

Definition at line 63 of file cfsp_util.py.

63 def errorReqExit(msg, code):
64  print("Request " + msg + " failed with HTTP code " + str(code) + ".")
65  if code == 0:
66  print("0 error: no response from server\n")
67  elif (msg == "GET cluster") or (msg == "GET clusters") or (msg == "DELETE cluster"):
68  if code == 400:
69  print("400 Bad request (maybe login/pass with space char?)\n")
70  if code == 401:
71  print("401 Unauthenticated, bad login\n")
72  if code == 403:
73  print("403 Unauthorized\n")
74  if code == 404:
75  print("404 Cluster does not exist\n")
76  elif msg == "POST cluster":
77  if code == 401:
78  print("401 Unauthenticated, bad login\n")
79  if code == 404:
80  print("404 One of the regested images does not exist\n")
81  if code == 415:
82  print("415 Image has wrong type/breed\n")
83  if code == 422:
84  print("422 Malformed request\n")
85  if code == 424:
86  print("424 Bitfile seems to be preecarious/unstable (e.g. bad timing or could also hide an internal server error)\n")
87  if code == 429:
88  print("429 Insufficient Quota\n")
89  if code == 500:
90  print("500 Error in communication with devices (maybe try again)\n")
91  if code == 503:
92  print("503 No resources available to fullfil the request\n")
93  if code == 507:
94  print("507 Network or Memory failure on target device (maybe try again)\n")
95  if code == 508:
96  print("508 No network resources available, please contact admins\n")
97  exit(1)
98 
99 
def errorReqExit(msg, code)
Definition: cfsp_util.py:63
Here is the caller graph for this function:

◆ print_usage()

def cFSPlib.cfsp_util.print_usage ( )

Utility Functions.

Definition at line 43 of file cfsp_util.py.

43 def print_usage():
44  print( # "Openstack credentials should be stored in {}) \n".format(__credentials_file_name__) +
45  "Options available in cFSPlib.mngmt library :\n" +
46  " - Clusters: \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" +
52  " - Instances: \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" +
57  " - Users: \n" +
58  " - cFuser(path/to/credentials.json) \n" +
59  " - load_user_credentials(filedir) \n" +
60  " - show_user_credentials(filedir) \n\n")
61 
62 
def print_usage()
Utility Functions.
Definition: cfsp_util.py:43