Пример #1
0
def create_event_status(
    event_status: EventStatusCreate,
    request: Request,
    response: Response,
    db: Session = Depends(get_db),
):
    uuid = crud.create(obj=event_status, db_table=EventStatus, db=db)

    response.headers["Content-Location"] = request.url_for("get_event_status", uuid=uuid)
Пример #2
0
def create_node_tag(
    node_tag: NodeTagCreate,
    request: Request,
    response: Response,
    db: Session = Depends(get_db),
):
    uuid = crud.create(obj=node_tag, db_table=NodeTag, db=db)

    response.headers["Content-Location"] = request.url_for("get_node_tag", uuid=uuid)
Пример #3
0
def create_node_history_action(
    node_history_action: NodeHistoryActionCreate,
    request: Request,
    response: Response,
    db: Session = Depends(get_db),
):
    uuid = crud.create(obj=node_history_action, db_table=NodeHistoryAction, db=db)

    response.headers["Content-Location"] = request.url_for("get_node_history_action", uuid=uuid)
Пример #4
0
def create_event_remediation(
    event_remediation: EventRemediationCreate,
    request: Request,
    response: Response,
    db: Session = Depends(get_db),
):
    uuid = crud.create(obj=event_remediation, db_table=EventRemediation, db=db)

    response.headers["Content-Location"] = request.url_for("get_event_remediation", uuid=uuid)
Пример #5
0
def create_alert_tool(
        alert_tool: AlertToolCreate,
        request: Request,
        response: Response,
        db: Session = Depends(get_db),
):
    uuid = crud.create(obj=alert_tool, db_table=AlertTool, db=db)

    response.headers["Content-Location"] = request.url_for("get_alert_tool",
                                                           uuid=uuid)
Пример #6
0
def create_observable_type(
        observable_type: ObservableTypeCreate,
        request: Request,
        response: Response,
        db: Session = Depends(get_db),
):
    uuid = crud.create(obj=observable_type, db_table=ObservableType, db=db)

    response.headers["Content-Location"] = request.url_for(
        "get_observable_type", uuid=uuid)
Пример #7
0
def create_user_role(
        user_role: UserRoleCreate,
        request: Request,
        response: Response,
        db: Session = Depends(get_db),
):
    uuid = crud.create(obj=user_role, db_table=UserRole, db=db)

    response.headers["Content-Location"] = request.url_for("get_user_role",
                                                           uuid=uuid)
Пример #8
0
def create_disposition(
        disposition: AlertDispositionCreate,
        request: Request,
        response: Response,
        db: Session = Depends(get_db),
):
    uuid = crud.create(obj=disposition, db_table=AlertDisposition, db=db)

    response.headers["Content-Location"] = request.url_for("get_disposition",
                                                           uuid=uuid)
Пример #9
0
def create_event_risk_level(
        event_risk_level: EventRiskLevelCreate,
        request: Request,
        response: Response,
        db: Session = Depends(get_db),
):
    uuid = crud.create(obj=event_risk_level, db_table=EventRiskLevel, db=db)

    response.headers["Content-Location"] = request.url_for(
        "get_event_risk_level", uuid=uuid)
Пример #10
0
def create_event_prevention_tool(
        event_prevention_tool: EventPreventionToolCreate,
        request: Request,
        response: Response,
        db: Session = Depends(get_db),
):
    uuid = crud.create(obj=event_prevention_tool,
                       db_table=EventPreventionTool,
                       db=db)

    response.headers["Content-Location"] = request.url_for(
        "get_event_prevention_tool", uuid=uuid)