Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Body of FastAPI for local test #125

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/spaceone/monitoring/interface/rest/v1/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
from fastapi import Request, Body
from fastapi_utils.inferring_router import InferringRouter
from fastapi_utils.cbv import cbv
from spaceone.core.fastapi.api import BaseAPI, exception_handler
from spaceone.core.error import *
from spaceone.core.locator import Locator
from spaceone.core.fastapi.api import BaseAPI
from spaceone.monitoring.service import EventService
from spaceone.monitoring.model.event_model import CreateEvent

_LOGGER = logging.getLogger(__name__)

Expand All @@ -16,7 +13,9 @@
@cbv(router)
class Event(BaseAPI):
@router.post("/webhook/{webhook_id}/{access_key}/events")
async def create_event(self, access_key: str, webhook_id: str, request: Request):
async def create_event(
self, access_key: str, webhook_id: str, request: Request, data: dict = Body()
):
params, metadata = await self.parse_request(request)

event_service: EventService = self.locator.get_service("EventService")
Expand Down
Loading