Skip to content

incident_io_client.api.managed_resources_v2.managed_resources_v2_create_managed_resource

asyncio async

asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody
) -> Optional[
    ManagedResourcesV2CreateManagedResourceResponseBody
]

CreateManagedResource Managed Resources V2

Called by external providers such as Terraform, this can 'claim' an incident.io resource as being managed externally.

Parameters:

Name Type Description Default
body ManagedResourcesV2CreateManagedResourceRequestBody

Example: {'annotations': {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type': 'schedule'}.

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[ManagedResourcesV2CreateManagedResourceResponseBody]

ManagedResourcesV2CreateManagedResourceResponseBody

Source code in incident_io_client/api/managed_resources_v2/managed_resources_v2_create_managed_resource.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody,
) -> Optional[ManagedResourcesV2CreateManagedResourceResponseBody]:
    """CreateManagedResource Managed Resources V2

     Called by external providers such as Terraform, this can 'claim' an incident.io resource as being
    managed externally.

    Args:
        body (ManagedResourcesV2CreateManagedResourceRequestBody):  Example: {'annotations':
            {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type':
            'schedule'}.

    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:
        ManagedResourcesV2CreateManagedResourceResponseBody
    """

    return (
        await asyncio_detailed(
            client=client,
            body=body,
        )
    ).parsed

asyncio_detailed async

asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody
) -> Response[
    ManagedResourcesV2CreateManagedResourceResponseBody
]

CreateManagedResource Managed Resources V2

Called by external providers such as Terraform, this can 'claim' an incident.io resource as being managed externally.

Parameters:

Name Type Description Default
body ManagedResourcesV2CreateManagedResourceRequestBody

Example: {'annotations': {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type': 'schedule'}.

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[ManagedResourcesV2CreateManagedResourceResponseBody]

Response[ManagedResourcesV2CreateManagedResourceResponseBody]

Source code in incident_io_client/api/managed_resources_v2/managed_resources_v2_create_managed_resource.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody,
) -> Response[ManagedResourcesV2CreateManagedResourceResponseBody]:
    """CreateManagedResource Managed Resources V2

     Called by external providers such as Terraform, this can 'claim' an incident.io resource as being
    managed externally.

    Args:
        body (ManagedResourcesV2CreateManagedResourceRequestBody):  Example: {'annotations':
            {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type':
            'schedule'}.

    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[ManagedResourcesV2CreateManagedResourceResponseBody]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync

sync(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody
) -> Optional[
    ManagedResourcesV2CreateManagedResourceResponseBody
]

CreateManagedResource Managed Resources V2

Called by external providers such as Terraform, this can 'claim' an incident.io resource as being managed externally.

Parameters:

Name Type Description Default
body ManagedResourcesV2CreateManagedResourceRequestBody

Example: {'annotations': {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type': 'schedule'}.

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[ManagedResourcesV2CreateManagedResourceResponseBody]

ManagedResourcesV2CreateManagedResourceResponseBody

Source code in incident_io_client/api/managed_resources_v2/managed_resources_v2_create_managed_resource.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody,
) -> Optional[ManagedResourcesV2CreateManagedResourceResponseBody]:
    """CreateManagedResource Managed Resources V2

     Called by external providers such as Terraform, this can 'claim' an incident.io resource as being
    managed externally.

    Args:
        body (ManagedResourcesV2CreateManagedResourceRequestBody):  Example: {'annotations':
            {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type':
            'schedule'}.

    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:
        ManagedResourcesV2CreateManagedResourceResponseBody
    """

    return sync_detailed(
        client=client,
        body=body,
    ).parsed

sync_detailed

sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody
) -> Response[
    ManagedResourcesV2CreateManagedResourceResponseBody
]

CreateManagedResource Managed Resources V2

Called by external providers such as Terraform, this can 'claim' an incident.io resource as being managed externally.

Parameters:

Name Type Description Default
body ManagedResourcesV2CreateManagedResourceRequestBody

Example: {'annotations': {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type': 'schedule'}.

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[ManagedResourcesV2CreateManagedResourceResponseBody]

Response[ManagedResourcesV2CreateManagedResourceResponseBody]

Source code in incident_io_client/api/managed_resources_v2/managed_resources_v2_create_managed_resource.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: ManagedResourcesV2CreateManagedResourceRequestBody,
) -> Response[ManagedResourcesV2CreateManagedResourceResponseBody]:
    """CreateManagedResource Managed Resources V2

     Called by external providers such as Terraform, this can 'claim' an incident.io resource as being
    managed externally.

    Args:
        body (ManagedResourcesV2CreateManagedResourceRequestBody):  Example: {'annotations':
            {'incident.io/terraform/version': '3.0.0'}, 'resource_id': 'abc123', 'resource_type':
            'schedule'}.

    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[ManagedResourcesV2CreateManagedResourceResponseBody]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)