Exemplo n.º 1
0
def _create_or_update_actions(wb_db, actions_spec):
    db_actions = []

    if actions_spec:
        for action_spec in actions_spec:
            action_name = '%s.%s' % (wb_db.name, action_spec.get_name())

            input_list = actions.get_input_list(
                action_spec.to_dict().get('input', [])
            )
            values = {
                'name': action_name,
                'spec': action_spec.to_dict(),
                'tags': action_spec.get_tags(),
                'definition': _get_action_definition(wb_db, action_spec),
                'description': action_spec.get_description(),
                'is_system': False,
                'input': ', '.join(input_list) if input_list else None,
                'scope': wb_db.scope,
                'project_id': wb_db.project_id
            }

            db_actions.append(
                db_api_v2.create_or_update_action_definition(
                    action_name,
                    values
                )
            )

    return db_actions
Exemplo n.º 2
0
def _create_or_update_actions(wb_db, actions_spec):
    db_actions = []

    if actions_spec:
        for action_spec in actions_spec:
            action_name = '%s.%s' % (wb_db.name, action_spec.get_name())

            input_list = actions.get_input_list(action_spec.to_dict().get(
                'input', []))
            values = {
                'name': action_name,
                'spec': action_spec.to_dict(),
                'tags': action_spec.get_tags(),
                'definition': _get_action_definition(wb_db, action_spec),
                'description': action_spec.get_description(),
                'is_system': False,
                'input': ', '.join(input_list) if input_list else None,
                'scope': wb_db.scope,
                'project_id': wb_db.project_id
            }

            db_actions.append(
                db_api_v2.create_or_update_action_definition(
                    action_name, values))

    return db_actions
Exemplo n.º 3
0
def _create_or_update_actions(wb_db, actions_spec):
    if actions_spec:
        for action_spec in actions_spec:
            action_name = "%s.%s" % (wb_db.name, action_spec.get_name())

            input_list = actions.get_input_list(action_spec.to_dict().get("input", []))
            values = {
                "name": action_name,
                "spec": action_spec.to_dict(),
                "tags": action_spec.get_tags(),
                "description": action_spec.get_description(),
                "is_system": False,
                "input": ", ".join(input_list) if input_list else None,
                "scope": wb_db.scope,
                "project_id": wb_db.project_id,
            }

            db_api_v2.create_or_update_action_definition(action_name, values)