Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0"
".": "0.27.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.27.0](https://github.com/kernel/hypeman-python/compare/v0.2.0...v0.27.0) (2026-08-31)


### Features

* Allow skipping graceful shutdown on instance delete ([cfc7ca8](https://github.com/kernel/hypeman-python/commit/cfc7ca84d29e364889896f01c6e10cedd3ec0541))


### Chores

* align release version ([918cac7](https://github.com/kernel/hypeman-python/commit/918cac7aea641e285791de9d2377fc245b696da7))

## [0.2.0](https://github.com/kernel/hypeman-python/compare/v0.1.0...v0.2.0) (2026-08-21)


Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Methods:
- <code title="post /instances">client.instances.<a href="./src/hypeman/resources/instances/instances.py">create</a>(\*\*<a href="src/hypeman/types/instance_create_params.py">params</a>) -> <a href="./src/hypeman/types/instance.py">Instance</a></code>
- <code title="patch /instances/{id}">client.instances.<a href="./src/hypeman/resources/instances/instances.py">update</a>(id, \*\*<a href="src/hypeman/types/instance_update_params.py">params</a>) -> <a href="./src/hypeman/types/instance.py">Instance</a></code>
- <code title="get /instances">client.instances.<a href="./src/hypeman/resources/instances/instances.py">list</a>(\*\*<a href="src/hypeman/types/instance_list_params.py">params</a>) -> <a href="./src/hypeman/types/instance_list_response.py">InstanceListResponse</a></code>
- <code title="delete /instances/{id}">client.instances.<a href="./src/hypeman/resources/instances/instances.py">delete</a>(id) -> None</code>
- <code title="delete /instances/{id}">client.instances.<a href="./src/hypeman/resources/instances/instances.py">delete</a>(id, \*\*<a href="src/hypeman/types/instance_delete_params.py">params</a>) -> None</code>
- <code title="post /instances/{id}/fork">client.instances.<a href="./src/hypeman/resources/instances/instances.py">fork</a>(id, \*\*<a href="src/hypeman/types/instance_fork_params.py">params</a>) -> <a href="./src/hypeman/types/instance.py">Instance</a></code>
- <code title="get /instances/{id}">client.instances.<a href="./src/hypeman/resources/instances/instances.py">get</a>(id) -> <a href="./src/hypeman/types/instance.py">Instance</a></code>
- <code title="get /instances/{id}/logs">client.instances.<a href="./src/hypeman/resources/instances/instances.py">logs</a>(id, \*\*<a href="src/hypeman/types/instance_logs_params.py">params</a>) -> str</code>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "hypeman"
version = "0.2.0"
version = "0.27.0"
description = "The official Python library for the hypeman API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/hypeman/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "hypeman"
__version__ = "0.2.0" # x-release-please-version
__version__ = "0.27.0" # x-release-please-version
23 changes: 21 additions & 2 deletions src/hypeman/resources/instances/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
instance_wait_params,
instance_start_params,
instance_create_params,
instance_delete_params,
instance_update_params,
instance_standby_params,
)
Expand Down Expand Up @@ -404,6 +405,7 @@ def delete(
self,
id: str,
*,
graceful_shutdown: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -415,6 +417,8 @@ def delete(
Stop and delete instance

Args:
graceful_shutdown: Whether to attempt graceful guest shutdown before deleting the instance

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -429,7 +433,13 @@ def delete(
return self._delete(
path_template("/instances/{id}", id=id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"graceful_shutdown": graceful_shutdown}, instance_delete_params.InstanceDeleteParams
),
),
cast_to=NoneType,
)
Expand Down Expand Up @@ -1217,6 +1227,7 @@ async def delete(
self,
id: str,
*,
graceful_shutdown: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -1228,6 +1239,8 @@ async def delete(
Stop and delete instance

Args:
graceful_shutdown: Whether to attempt graceful guest shutdown before deleting the instance

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -1242,7 +1255,13 @@ async def delete(
return await self._delete(
path_template("/instances/{id}", id=id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"graceful_shutdown": graceful_shutdown}, instance_delete_params.InstanceDeleteParams
),
),
cast_to=NoneType,
)
Expand Down
1 change: 1 addition & 0 deletions src/hypeman/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
from .snapshot_policy_param import SnapshotPolicyParam as SnapshotPolicyParam
from .health_check_tcp_param import HealthCheckTcpParam as HealthCheckTcpParam
from .instance_create_params import InstanceCreateParams as InstanceCreateParams
from .instance_delete_params import InstanceDeleteParams as InstanceDeleteParams
from .instance_health_status import InstanceHealthStatus as InstanceHealthStatus
from .instance_list_response import InstanceListResponse as InstanceListResponse
from .instance_logs_response import InstanceLogsResponse as InstanceLogsResponse
Expand Down
12 changes: 12 additions & 0 deletions src/hypeman/types/instance_delete_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import TypedDict

__all__ = ["InstanceDeleteParams"]


class InstanceDeleteParams(TypedDict, total=False):
graceful_shutdown: bool
"""Whether to attempt graceful guest shutdown before deleting the instance"""
34 changes: 26 additions & 8 deletions tests/api_resources/test_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,24 @@ def test_streaming_response_list(self, client: Hypeman) -> None:
@parametrize
def test_method_delete(self, client: Hypeman) -> None:
instance = client.instances.delete(
"id",
id="id",
)
assert instance is None

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_delete_with_all_params(self, client: Hypeman) -> None:
instance = client.instances.delete(
id="id",
graceful_shutdown=True,
)
assert instance is None

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_delete(self, client: Hypeman) -> None:
response = client.instances.with_raw_response.delete(
"id",
id="id",
)

assert response.is_closed is True
Expand All @@ -312,7 +321,7 @@ def test_raw_response_delete(self, client: Hypeman) -> None:
@parametrize
def test_streaming_response_delete(self, client: Hypeman) -> None:
with client.instances.with_streaming_response.delete(
"id",
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -327,7 +336,7 @@ def test_streaming_response_delete(self, client: Hypeman) -> None:
def test_path_params_delete(self, client: Hypeman) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.instances.with_raw_response.delete(
"",
id="",
)

@pytest.mark.skip(reason="Mock server tests are disabled")
Expand Down Expand Up @@ -1101,15 +1110,24 @@ async def test_streaming_response_list(self, async_client: AsyncHypeman) -> None
@parametrize
async def test_method_delete(self, async_client: AsyncHypeman) -> None:
instance = await async_client.instances.delete(
"id",
id="id",
)
assert instance is None

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_delete_with_all_params(self, async_client: AsyncHypeman) -> None:
instance = await async_client.instances.delete(
id="id",
graceful_shutdown=True,
)
assert instance is None

@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_delete(self, async_client: AsyncHypeman) -> None:
response = await async_client.instances.with_raw_response.delete(
"id",
id="id",
)

assert response.is_closed is True
Expand All @@ -1121,7 +1139,7 @@ async def test_raw_response_delete(self, async_client: AsyncHypeman) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncHypeman) -> None:
async with async_client.instances.with_streaming_response.delete(
"id",
id="id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -1136,7 +1154,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHypeman) -> No
async def test_path_params_delete(self, async_client: AsyncHypeman) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.instances.with_raw_response.delete(
"",
id="",
)

@pytest.mark.skip(reason="Mock server tests are disabled")
Expand Down