Esempio n. 1
0
 def get(self):
     query = filter_query(Server, request.args)
     return [s.to_json(add_gates=check_param_in_uri('gates'),
                       human=check_param_in_uri('human'),
                       no_delete=True,
                       add_ignore=True) for s in
             query.all()]
Esempio n. 2
0
 def get(self, file_id):
     query = filter_query(FileServerAssociation,
                          request.args).filter_by(file_id=file_id)
     return [
         fsa.to_json(human=check_param_in_uri('human'), no_delete=True)
         for fsa in query.all()
     ]
Esempio n. 3
0
 def get(self, execution_id):
     query = filter_query(StepExecution, request.args)
     return [
         oe.to_json(human=check_param_in_uri('human'))
         for oe in query.filter_by(orch_execution_id=execution_id).order_by(
             StepExecution.start_time).all()
     ]
Esempio n. 4
0
 def get(self):
     query = filter_query(OrchExecution, request.args)
     return [
         oe.to_json(human=check_param_in_uri('human'),
                    add_step_exec=check_param_in_uri('steps'),
                    split_lines=True)
         for oe in query.order_by(OrchExecution.start_time).all()
     ]
Esempio n. 5
0
 def get(self):
     query = filter_query(Orchestration,
                          request.args).order_by(Orchestration.created_at)
     return [
         o.to_json(add_target=check_param_in_uri('target'),
                   add_params=check_param_in_uri('vars'),
                   add_steps=check_param_in_uri('steps'),
                   add_action=check_param_in_uri('action'),
                   split_lines=check_param_in_uri('split_lines'),
                   add_schema=check_param_in_uri('schema'))
         for o in query.all()
     ]
Esempio n. 6
0
 def get(self):
     if check_param_in_uri('scopes'):
         return [r[0] for r in
                 db.session.query(distinct(Vault.scope)).filter_by(user_id=get_jwt_identity()).filter_by(
                     deleted=0).all()]
     elif check_param_in_uri('vars'):
         query = db.session.query(distinct(Vault.name)).filter_by(user_id=get_jwt_identity()).filter_by(deleted=0)
         if 'scope' in request.args:
             query = query.filter_by(scope=request.args.get('scope'))
         return [r[0] for r in query.order_by(Vault.name)]
     else:
         query = filter_query(Vault, request.args, exclude=["user_id", "value"]).filter_by(
             user_id=get_jwt_identity())
         return [vault.to_json(no_delete=True, human=check_param_in_uri('human')) for vault in query.all()]
Esempio n. 7
0
 def get(self):
     query = filter_query(Log, request.args)
     return [log.to_json(human=check_param_in_uri('human'), delete_data=False) for log in query.all()]
Esempio n. 8
0
 def get(self):
     query = filter_query(StepExecution, request.args)
     return [
         e.to_json(human=check_param_in_uri('human'), split_lines=True)
         for e in query.order_by(StepExecution.start_time).all()
     ]
Esempio n. 9
0
 def get(self):
     query = filter_query(Step, request.args)
     return [s.to_json(split_lines=check_param_in_uri('split_lines')) for s in query.all()]
Esempio n. 10
0
 def get(self):
     query = filter_query(User, request.args, exclude=['_password'])
     return [user.to_json() for user in query.all()]
Esempio n. 11
0
 def get(self):
     query = filter_query(ActionTemplate, request.args)
     return [
         at.to_json(split_lines=check_param_in_uri('split_lines'))
         for at in query.all()
     ]
Esempio n. 12
0
 def get(self):
     query = filter_query(Software, request.args)
     return [
         soft.to_json(servers=check_param_in_uri('servers'),
                      no_delete=False) for soft in query.all()
     ]
Esempio n. 13
0
 def get(self):
     query = filter_query(Transfer, request.args)
     return [t.to_json() for t in query.order_by(Transfer.created_on).all()]
Esempio n. 14
0
 def get(self):
     query = filter_query(File, request.args)
     return [file.to_json(human=check_param_in_uri('human'), no_delete=True,
                          destinations=check_param_in_uri('destinations')) for file in
             query.all()]