Skip to content

incident_io_client.api.alert_events_v2.alert_events_v2_create_http

asyncio async

asyncio(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET
) -> Optional[AlertEventsV2CreateHTTPResponseBody]

CreateHTTP Alert Events V2

Create an alert event using an HTTP source.

Parameters:

Name Type Description Default
alert_source_config_id str
required
token Union[Unset, str]
UNSET
authorization Union[Unset, str]
UNSET
body AlertEventsV2CreateHTTPRequestBody

Example: {'deduplication_key': '4293868629', 'description': "We've detected a number of timeouts on hello.world.com, the service may be down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']}, 'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status': 'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[AlertEventsV2CreateHTTPResponseBody]

AlertEventsV2CreateHTTPResponseBody

Source code in incident_io_client/api/alert_events_v2/alert_events_v2_create_http.py
async def asyncio(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET,
) -> Optional[AlertEventsV2CreateHTTPResponseBody]:
    """CreateHTTP Alert Events V2

     Create an alert event using an HTTP source.

    Args:
        alert_source_config_id (str):
        token (Union[Unset, str]):
        authorization (Union[Unset, str]):
        body (AlertEventsV2CreateHTTPRequestBody):  Example: {'deduplication_key': '4293868629',
            'description': "We've detected a number of timeouts on hello.world.com, the service may be
            down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']},
            'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status':
            'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        AlertEventsV2CreateHTTPResponseBody
    """

    return (
        await asyncio_detailed(
            alert_source_config_id=alert_source_config_id,
            client=client,
            body=body,
            token=token,
            authorization=authorization,
        )
    ).parsed

asyncio_detailed async

asyncio_detailed(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET
) -> Response[AlertEventsV2CreateHTTPResponseBody]

CreateHTTP Alert Events V2

Create an alert event using an HTTP source.

Parameters:

Name Type Description Default
alert_source_config_id str
required
token Union[Unset, str]
UNSET
authorization Union[Unset, str]
UNSET
body AlertEventsV2CreateHTTPRequestBody

Example: {'deduplication_key': '4293868629', 'description': "We've detected a number of timeouts on hello.world.com, the service may be down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']}, 'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status': 'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[AlertEventsV2CreateHTTPResponseBody]

Response[AlertEventsV2CreateHTTPResponseBody]

Source code in incident_io_client/api/alert_events_v2/alert_events_v2_create_http.py
async def asyncio_detailed(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET,
) -> Response[AlertEventsV2CreateHTTPResponseBody]:
    """CreateHTTP Alert Events V2

     Create an alert event using an HTTP source.

    Args:
        alert_source_config_id (str):
        token (Union[Unset, str]):
        authorization (Union[Unset, str]):
        body (AlertEventsV2CreateHTTPRequestBody):  Example: {'deduplication_key': '4293868629',
            'description': "We've detected a number of timeouts on hello.world.com, the service may be
            down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']},
            'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status':
            'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[AlertEventsV2CreateHTTPResponseBody]
    """

    kwargs = _get_kwargs(
        alert_source_config_id=alert_source_config_id,
        body=body,
        token=token,
        authorization=authorization,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync

sync(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET
) -> Optional[AlertEventsV2CreateHTTPResponseBody]

CreateHTTP Alert Events V2

Create an alert event using an HTTP source.

Parameters:

Name Type Description Default
alert_source_config_id str
required
token Union[Unset, str]
UNSET
authorization Union[Unset, str]
UNSET
body AlertEventsV2CreateHTTPRequestBody

Example: {'deduplication_key': '4293868629', 'description': "We've detected a number of timeouts on hello.world.com, the service may be down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']}, 'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status': 'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[AlertEventsV2CreateHTTPResponseBody]

AlertEventsV2CreateHTTPResponseBody

Source code in incident_io_client/api/alert_events_v2/alert_events_v2_create_http.py
def sync(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET,
) -> Optional[AlertEventsV2CreateHTTPResponseBody]:
    """CreateHTTP Alert Events V2

     Create an alert event using an HTTP source.

    Args:
        alert_source_config_id (str):
        token (Union[Unset, str]):
        authorization (Union[Unset, str]):
        body (AlertEventsV2CreateHTTPRequestBody):  Example: {'deduplication_key': '4293868629',
            'description': "We've detected a number of timeouts on hello.world.com, the service may be
            down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']},
            'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status':
            'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        AlertEventsV2CreateHTTPResponseBody
    """

    return sync_detailed(
        alert_source_config_id=alert_source_config_id,
        client=client,
        body=body,
        token=token,
        authorization=authorization,
    ).parsed

sync_detailed

sync_detailed(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET
) -> Response[AlertEventsV2CreateHTTPResponseBody]

CreateHTTP Alert Events V2

Create an alert event using an HTTP source.

Parameters:

Name Type Description Default
alert_source_config_id str
required
token Union[Unset, str]
UNSET
authorization Union[Unset, str]
UNSET
body AlertEventsV2CreateHTTPRequestBody

Example: {'deduplication_key': '4293868629', 'description': "We've detected a number of timeouts on hello.world.com, the service may be down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']}, 'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status': 'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[AlertEventsV2CreateHTTPResponseBody]

Response[AlertEventsV2CreateHTTPResponseBody]

Source code in incident_io_client/api/alert_events_v2/alert_events_v2_create_http.py
def sync_detailed(
    alert_source_config_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: AlertEventsV2CreateHTTPRequestBody,
    token: Union[Unset, str] = UNSET,
    authorization: Union[Unset, str] = UNSET,
) -> Response[AlertEventsV2CreateHTTPResponseBody]:
    """CreateHTTP Alert Events V2

     Create an alert event using an HTTP source.

    Args:
        alert_source_config_id (str):
        token (Union[Unset, str]):
        authorization (Union[Unset, str]):
        body (AlertEventsV2CreateHTTPRequestBody):  Example: {'deduplication_key': '4293868629',
            'description': "We've detected a number of timeouts on hello.world.com, the service may be
            down. To fix...", 'metadata': {'service': 'hello.world.com', 'team': ['my-team']},
            'source_url': 'https://www.my-alerting-platform.com/alerts/my-alert-123', 'status':
            'firing', 'title': '*errors.withMessage: PG::Error failed to connect'}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[AlertEventsV2CreateHTTPResponseBody]
    """

    kwargs = _get_kwargs(
        alert_source_config_id=alert_source_config_id,
        body=body,
        token=token,
        authorization=authorization,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)