Skip to content

Commit 0030fc7

Browse files
rawvegTim Green
andauthored
Detach ip address from nic (#480)
* Added method to handle ip address detachment Co-authored-by: Tim Green <tim.green@ukfast.co.uk>
1 parent 06c02f8 commit 0030fc7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/eCloud/NicClient.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function loadEntity($data)
3333
$this->apiToFriendly($data, $this->getEntityMap())
3434
);
3535
}
36-
36+
3737
/**
3838
* Assigns an IP address with a NIC
3939
* @param $id
@@ -48,7 +48,19 @@ public function assignIpAddress($id, $ipAddressId)
4848
);
4949
return $response->getStatusCode() == 202;
5050
}
51-
51+
52+
/**
53+
* Detaches an IP address from a NIC
54+
* @param $id
55+
* @param $ipAddressId
56+
* @return bool
57+
*/
58+
public function detachIpAddress($id, $ipAddressId)
59+
{
60+
$response = $this->delete($this->collectionPath . '/' . $id . '/ip-addresses/' . $ipAddressId);
61+
return $response->getStatusCode() == 202;
62+
}
63+
5264
/**
5365
* Get the IP address records associated with a NIC
5466
* @param $id

0 commit comments

Comments
 (0)