21 get flight_recorder_data <cluster/instance> Requests and returns the status information of the
22 Network Routing Core of this cluster/instance
23 Attention: There may be a delay of a few seconds until
24 the counters are updated after the packets were
27 from __future__
import absolute_import
30 python_api_client_path = os.getcwd()+
"/cFSPlib/python_api_client/"
31 sys.path.append(python_api_client_path)
35 from swagger_client.rest
import ApiException
36 from swagger_client.api_client
import ApiClient
37 from swagger_client.configuration
import Configuration
41 conf = Configuration()
42 conf.host = cfsp_globals.__cf_manager_url__
43 api_client = ApiClient(conf)
44 api_instance = swagger_client.DebugApi(api_client=api_client)
46 if (len(args[
'<args>']) != 4):
47 print(
"ERROR: invalid arguments provided in 'cfsp debug' command. Aborting...")
50 username = cfsp_globals.__cfsp_username__
51 password = cfsp_globals.__cfsp_password__
52 project_name = cfsp_globals.__cfsp_project__
54 if args[
'<args>'][0] ==
'get':
55 if (args[
'<args>'][1] ==
"flight_recorder_data"):
56 if args[
'<args>'][2] ==
'cluster':
58 api_response = api_instance.cf_manager_rest_api_get_flight_recorder_cluster(username, password, args[
'<args>'][3])
59 except ApiException
as e:
60 print(
"Exception when calling DebugApi->cf_manager_rest_api_get_flight_recorder_cluster: %s\n" % e)
62 elif args[
'<args>'][2] ==
'instance':
64 api_response = api_instance.cf_manager_rest_api_get_flight_recorder_instance(username, password, args[
'<args>'][3])
65 except ApiException
as e:
66 print(
"Exception when calling DebugApi->cf_manager_rest_api_get_flight_recorder_instance: %s\n" % e)
69 exit(print(
"ERROR: invalid arguments provided in cfsp debug get flight_recorder_data. Choose between 'cluster' or 'instance'. Aborting..."))
71 exit(print(
"ERROR: invalid arguments provided in cfsp debug get. Aborting..."))
74 exit(print(
"ERROR: invalid command provided in cfsp debug. Type 'cfsp help debug' to get a list of supported commands. Aborting..."))
75 if __name__ ==
'__main__':