mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 13:15:14 +09:00
F #2490: Add new unregister address range functionality
* Modify the IPAM driver
* Modify AddressRangePool to call the new action script
* Add example dummy script
(cherry picked from commit 7e36bc7c74)
This commit is contained in:
1 parent
fbc40d7a8c
commit
552fc83e9b
8 files changed
+142
-13
No files matched your search
@@ -104,6 +104,11 @@ public:
|
||||
return (type & 0x00000008) != 0;
|
||||
}
|
||||
|
||||
bool is_ipam() const
|
||||
{
|
||||
return !attr->vector_value("IPAM_MAD").empty() && attr->vector_value("IPAM_MAD") != "internal";
|
||||
}
|
||||
|
||||
// *************************************************************************
|
||||
// Address Range initialization functions
|
||||
// *************************************************************************
|
||||
|
||||
+10
-4
@@ -36,10 +36,11 @@ class IPMAction : public ActionRequest
|
||||
public:
|
||||
enum Actions
|
||||
{
|
||||
REGISTER_ADDRESS_RANGE, /**< Register/Request a new IP network */
|
||||
ALLOCATE_ADDRESS, /**< Request a specific IP (or range) */
|
||||
GET_ADDRESS, /**< Request any free IP (or range) */
|
||||
FREE_ADDRESS /**< Frees a previously requested IP */
|
||||
REGISTER_ADDRESS_RANGE, /**< Register/Request a new IP network */
|
||||
UNREGISTER_ADDRESS_RANGE, /**< Unregister IP network */
|
||||
ALLOCATE_ADDRESS, /**< Request a specific IP (or range) */
|
||||
GET_ADDRESS, /**< Request any free IP (or range) */
|
||||
FREE_ADDRESS /**< Frees a previously requested IP */
|
||||
};
|
||||
|
||||
IPMAction(Actions a, IPAMRequest *r):ActionRequest(ActionRequest::USER),
|
||||
@@ -187,6 +188,11 @@ private:
|
||||
*/
|
||||
void register_address_range_action(IPAMRequest * ir);
|
||||
|
||||
/**
|
||||
* Unregisters an address range.
|
||||
*/
|
||||
void unregister_address_range_action(IPAMRequest * ir);
|
||||
|
||||
/**
|
||||
* Requests the IPAM a free address (or range)
|
||||
*/
|
||||
|
||||
@@ -67,6 +67,14 @@ private:
|
||||
send_message("REGISTER_ADDRESS_RANGE", id, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister an AddressRange from the IPAM
|
||||
*/
|
||||
void unregister_address_range(int id, const std::string& arg) const
|
||||
{
|
||||
send_message("UNREGISTER_ADDRESS_RANGE", id, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a free address (or range)
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user