diff options
| author | Todd Willey <todd@ansolabs.com> | 2011-01-17 19:40:35 -0500 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2011-01-17 19:40:35 -0500 |
| commit | 3403e773f5a38c5d415e4ab66799c6e239223a0d (patch) | |
| tree | 3fda3e2053329e1bfbb2e7ca565aae8ccd7309bb /nova/adminclient.py | |
| parent | 8e6684a58eea3ecacdde99e1940d2ae351b8465c (diff) | |
Stubbed-out code for working with provider-firewalls.
Diffstat (limited to 'nova/adminclient.py')
| -rw-r--r-- | nova/adminclient.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nova/adminclient.py b/nova/adminclient.py index b2609c8c4..90ad4d9dd 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -190,6 +190,22 @@ class HostInfo(object): setattr(self, name, value) +class SimpleResponse(object): + def __init__(self, connection=None): + self.connection = connection + self.status = None + self.message = '' + + def __repr__(self): + return 'Status:%s' % self.status + + def startElement(self, name, attrs, connection): + return None + + def endElement(self, name, value, connection): + setattr(self, name.lower(), str(value)) + + class NovaAdminClient(object): def __init__( @@ -373,3 +389,8 @@ class NovaAdminClient(object): def get_hosts(self): return self.apiconn.get_list('DescribeHosts', {}, [('item', HostInfo)]) + + def block_ips(self, cidr): + """Block incoming traffic from specified hosts.""" + return self.apiconn.get_object('BlockExternalAddresses', + {'Cidr': cidr}, SimpleResponse) |
