intelion-cloud 0.2.3__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/PKG-INFO +1 -1
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/__init__.py +1 -1
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/resources/cloud_servers.py +16 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud.egg-info/PKG-INFO +1 -1
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/pyproject.toml +1 -1
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/tests/test_cloud_servers.py +10 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/LICENSE +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/README.md +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/_client.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/_pagination.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/_transport.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/constants.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/exceptions.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/models/__init__.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/models/_base.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/models/components.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/models/flavors.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/models/servers.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/models/users.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/resources/__init__.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/resources/_base.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/resources/flavors.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/resources/os_images.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud/resources/users.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud.egg-info/SOURCES.txt +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud.egg-info/dependency_links.txt +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud.egg-info/requires.txt +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/intelion_cloud.egg-info/top_level.txt +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/setup.cfg +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/tests/test_client.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/tests/test_flavors.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/tests/test_models.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/tests/test_transport.py +0 -0
- {intelion_cloud-0.2.3 → intelion_cloud-0.3.0}/tests/test_users.py +0 -0
|
@@ -137,6 +137,17 @@ class CloudServers(SyncResource):
|
|
|
137
137
|
data = self._post(f"{_PATH}{server_id}/actions/", json={"status": -3})
|
|
138
138
|
return CloudServer.from_dict(data)
|
|
139
139
|
|
|
140
|
+
def reinstall_os(self, server_id: int) -> CloudServer:
|
|
141
|
+
"""Reinstall the OS on a server, wiping the boot disk.
|
|
142
|
+
|
|
143
|
+
All data on the boot disk is destroyed. The current monthly billing
|
|
144
|
+
cycle is preserved (the open UsageAct is reused). A new IP and root
|
|
145
|
+
password are generated and become available in the user panel a few
|
|
146
|
+
minutes after the call returns.
|
|
147
|
+
"""
|
|
148
|
+
data = self._post(f"{_PATH}{server_id}/reinstall-os/")
|
|
149
|
+
return CloudServer.from_dict(data)
|
|
150
|
+
|
|
140
151
|
# --- Info endpoints ---
|
|
141
152
|
|
|
142
153
|
def get_status(self, server_id: int) -> ServerStatus:
|
|
@@ -264,6 +275,11 @@ class AsyncCloudServers(AsyncResource):
|
|
|
264
275
|
data = await self._post(f"{_PATH}{server_id}/actions/", json={"status": -3})
|
|
265
276
|
return CloudServer.from_dict(data)
|
|
266
277
|
|
|
278
|
+
async def reinstall_os(self, server_id: int) -> CloudServer:
|
|
279
|
+
"""Reinstall the OS on a server, wiping the boot disk."""
|
|
280
|
+
data = await self._post(f"{_PATH}{server_id}/reinstall-os/")
|
|
281
|
+
return CloudServer.from_dict(data)
|
|
282
|
+
|
|
267
283
|
async def get_status(self, server_id: int) -> ServerStatus:
|
|
268
284
|
data = await self._get(f"{_PATH}{server_id}/status/")
|
|
269
285
|
return ServerStatus.from_dict(data)
|
|
@@ -190,6 +190,16 @@ class TestCloudServersActions:
|
|
|
190
190
|
assert server.status == -3
|
|
191
191
|
client.close()
|
|
192
192
|
|
|
193
|
+
@respx.mock(base_url=API_URL)
|
|
194
|
+
def test_reinstall_os(self, respx_mock):
|
|
195
|
+
respx_mock.post("cloud-servers/42/reinstall-os/").respond(
|
|
196
|
+
200, json=SAMPLE_CLOUD_SERVER
|
|
197
|
+
)
|
|
198
|
+
client = IntelionCloud(token="tok", base_url=BASE_URL)
|
|
199
|
+
server = client.cloud_servers.reinstall_os(42)
|
|
200
|
+
assert server.id == SAMPLE_CLOUD_SERVER["id"]
|
|
201
|
+
client.close()
|
|
202
|
+
|
|
193
203
|
@respx.mock(base_url=API_URL)
|
|
194
204
|
def test_start_with_auto_renewal(self, respx_mock):
|
|
195
205
|
respx_mock.post("cloud-servers/42/actions/").respond(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|