Exemplo n.º 1
0
 def create(self, params):
     if not params:
         return "ERROR: missing <nsr> or <path-to-json>"
     nsr = parse_path_or_json(params[0])
     return result_to_str(get_result_to_show(self.app.ob_client.create_nsr(nsr),
                                             excluded_keys=self.keys_to_exclude,
                                             _format=self.app.format))
Exemplo n.º 2
0
 def find(self, params):
     if not params:
         return "ERROR: missing <nsr-id>"
     _id = params[0]
     return result_to_str(get_result_to_show(self.app.ob_client.get_nsr(_id),
                                             excluded_keys=self.keys_to_exclude,
                                             _format=self.app.format))
Exemplo n.º 3
0
 def refresh(self, params):
     if not params:
         return "ERROR: missing <vim-id>"
     _id = params[0]
     return result_to_str(get_result_to_show(self.app.ob_client.refresh_vim(_id),
                                             excluded_keys=self.keys_to_exclude,
                                             _format=self.app.format))
Exemplo n.º 4
0
 def create(self, params):
     if not params:
         return "ERROR: missing <path-to-package>"
     package = params[0]
     return result_to_str(
         get_result_to_show(self.app.ob_client.create_package(package),
                            excluded_keys=self.keys_to_exclude,
                            _format=self.app.format))
Exemplo n.º 5
0
 def create(self, params):
     if not params:
         return "ERROR: missing <marketplace-link>"
     link = params[0]
     return result_to_str(
         get_result_to_show(self.app.ob_client.create_nsd_from_market(link),
                            excluded_keys=self.keys_to_exclude,
                            _format=self.app.format))
Exemplo n.º 6
0
 def list(self, params=None):
     return result_to_str(
         get_result_to_list(self.app.ob_client.list_nsrs(), keys=self.keys_to_list, _format=self.app.format),
         _format=self.app.format)