parent
92b417a103
commit
2a5fceae91
|
@ -234,7 +234,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
Future<void> deleteVolume(final ServerVolume volume) async {
|
Future<void> deleteVolume(final ServerVolume volume) async {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
await client.delete('/volumes/$volume.id');
|
await client.delete('/volumes/${volume.id}');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -253,7 +253,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
dbPostResponse = await client.post(
|
dbPostResponse = await client.post(
|
||||||
'/volumes/$volume.id/actions/attach',
|
'/volumes/${volume.id}/actions/attach',
|
||||||
data: {
|
data: {
|
||||||
'automount': true,
|
'automount': true,
|
||||||
'server': serverId,
|
'server': serverId,
|
||||||
|
@ -276,7 +276,9 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final Response dbPostResponse;
|
final Response dbPostResponse;
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
dbPostResponse = await client.post('/volumes/$volume.id/actions/detach');
|
dbPostResponse = await client.post(
|
||||||
|
'/volumes/${volume.id}/actions/detach',
|
||||||
|
);
|
||||||
success = dbPostResponse.data['action']['status'].toString() != 'error';
|
success = dbPostResponse.data['action']['status'].toString() != 'error';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
@ -298,7 +300,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
dbPostResponse = await client.post(
|
dbPostResponse = await client.post(
|
||||||
'/volumes/$volume.id/actions/resize',
|
'/volumes/${volume.id}/actions/resize',
|
||||||
data: {
|
data: {
|
||||||
'size': size.gibibyte,
|
'size': size.gibibyte,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue