Skip to content

Commit

Permalink
create class/methods to list and [un]deploy IPv4 and IPv6 networks wi…
Browse files Browse the repository at this point in the history
…th for API requests
  • Loading branch information
Marcus Vinicius G. Cesario committed Oct 7, 2015
1 parent a73d9c7 commit 90581c6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
23 changes: 23 additions & 0 deletions networkapiclient/ClientFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
from networkapiclient.Healthcheck import Healthcheck
from networkapiclient.ApiVipRequest import ApiVipRequest
from networkapiclient.ApiInterface import ApiInterfaceRequest
from networkapiclient.ApiNetworkIPv4 import ApiNetworkIPv4
from networkapiclient.ApiNetworkIPv6 import ApiNetworkIPv6
from networkapiclient.Rack import Rack
from networkapiclient.RackServers import RackServers

Expand Down Expand Up @@ -409,6 +411,27 @@ def create_api_interface_request(self):
self.user_ldap
)

def create_api_network_ipv4(self):

"""Get an instance of Api Networkv4 services facade."""

return ApiNetworkIPv4(
self.networkapi_url,
self.user,
self.password,
self.user_ldap
)

def create_api_network_ipv6(self):

"""Get an instance of Api Networkv6 services facade."""

return ApiNetworkIPv6(
self.networkapi_url,
self.user,
self.password,
self.user_ldap
)

def create_rack(self):
"""Get an instance of rack services facade."""
Expand Down
8 changes: 4 additions & 4 deletions networkapiclient/Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,9 @@ def list(self, networkipv4=None, ipv4=None):

uri = "api/dhcprelayv4/?"
if networkipv4:
uri += "networkipv4=%d&" % networkipv4
uri += "networkipv4=%s&" % networkipv4
if ipv4:
uri += "ipv4=%d" % ipv4
uri += "ipv4=%s" % ipv4

return self.get(uri)

Expand Down Expand Up @@ -753,9 +753,9 @@ def list(self, networkipv6=None, ipv6=None):

uri = "api/dhcprelayv6/?"
if networkipv6:
uri += "networkipv6=%d&" % networkipv6
uri += "networkipv6=%s&" % networkipv6
if ipv6:
uri += "ipv6=%d" % ipv6
uri += "ipv6=%s" % ipv6

return self.get(uri)

Expand Down
2 changes: 1 addition & 1 deletion networkapiclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

MAJOR_VERSION = '0'
MINOR_VERSION = '6'
PATCH_VERSION = '7'
PATCH_VERSION = '8'
VERSION = '.'.join((MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION,))

2 changes: 1 addition & 1 deletion networkapiclient/version_control.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CLIENT_VERSION = '0.6.7'
CLIENT_VERSION = '0.6.8'

0 comments on commit 90581c6

Please sign in to comment.