-
Notifications
You must be signed in to change notification settings - Fork 926
LIBCLOUD-753 MCP 2 coverage dimension data #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
tonybaloney
wants to merge
15
commits into
apache:trunk
from
NTTLimitedRD:LIBCLOUD-753-MCP_2_Coverage_Dimension_Data
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b97168e
Corrected dd-ap 'host'
mingsheng36 51b7845
Merge pull request #2 from mingsheng36/patch-1
tonybaloney d051b58
Merge branch 'trunk' of github.com:DimensionDataCBUSydney/libcloud in…
tonybaloney 4aefd3a
Merge branch 'trunk' of https://github.com/apache/libcloud into trunk
tonybaloney ab6e76a
Merge branch 'trunk' of https://github.com/apache/libcloud into trunk
tonybaloney b0d8626
Merge branch 'trunk' of https://github.com/apache/libcloud into trunk
tonybaloney 2673c9d
Completed network domain functions (get, list, create, edit and delet…
tonybaloney 02bc0c1
Added functionality for VLANs, create, edit, deploy, get and expand
tonybaloney 1ad2d36
Complete IP block functionality
tonybaloney 067983a
Completed functions for firewall rules in network domains, get, list,…
tonybaloney 4355637
Updated load balancer methods to support editing pool, pool member an…
tonybaloney 3987345
Updated server nic functions (add and remove)
tonybaloney 8c65469
Completed flake8 updates and final tweaks to unit tests.
tonybaloney ec32feb
Update with some style and consistency changes
tonybaloney 48cfb04
the field name is still camel cased.
tonybaloney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,11 @@ | |
| DEFAULT_REGION = 'dd-na' | ||
|
|
||
|
|
||
| class NetworkDomainServicePlan(object): | ||
| ESSENTIALS = "ESSENTIALS" | ||
| ADVANCED = "ADVANCED" | ||
|
|
||
|
|
||
| class DimensionDataResponse(XmlResponse): | ||
| def parse_error(self): | ||
| if self.status == httplib.UNAUTHORIZED: | ||
|
|
@@ -282,12 +287,13 @@ class DimensionDataNetworkDomain(object): | |
| DimensionData network domain with location. | ||
| """ | ||
|
|
||
| def __init__(self, id, name, description, location, status): | ||
| def __init__(self, id, name, description, location, status, plan): | ||
| self.id = str(id) | ||
| self.name = name | ||
| self.description = description | ||
| self.location = location | ||
| self.status = status | ||
| self.plan = plan | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataNetworkDomain: id=%s, name=%s,' | ||
|
|
@@ -296,20 +302,126 @@ def __repr__(self): | |
| self.status)) | ||
|
|
||
|
|
||
| class DimensionDataPublicIpBlock(object): | ||
| """ | ||
| DimensionData Public IP Block with location. | ||
| """ | ||
|
|
||
| def __init__(self, id, base_ip, size, location, network_domain, | ||
| status): | ||
| self.id = str(id) | ||
| self.base_ip = base_ip | ||
| self.size = size | ||
| self.location = location | ||
| self.network_domain = network_domain | ||
| self.status = status | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataNetworkDomain: id=%s, base_ip=%s,' | ||
| 'size=%s, location=%s, status=%s>') | ||
| % (self.id, self.base_ip, self.size, self.location, | ||
| self.status)) | ||
|
|
||
|
|
||
| class DimensionDataFirewallRule(object): | ||
| """ | ||
| DimensionData Firewall Rule for a network domain | ||
| """ | ||
|
|
||
| def __init__(self, id, name, action, location, network_domain, | ||
| status, ip_version, protocol, source, destination, | ||
| enabled): | ||
| self.id = str(id) | ||
| self.name = name | ||
| self.action = action | ||
| self.location = location | ||
| self.network_domain = network_domain | ||
| self.status = status | ||
| self.ip_version = ip_version | ||
| self.protocol = protocol | ||
| self.source = source | ||
| self.destination = destination | ||
| self.enabled = enabled | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataNetworkDomain: id=%s, name=%s,' | ||
| 'action=%s, location=%s, status=%s>') | ||
| % (self.id, self.name, self.action, self.location, | ||
| self.status)) | ||
|
|
||
|
|
||
| class DimensionDataFirewallAddress(object): | ||
| """ | ||
| The source or destination model in a firewall rule | ||
| """ | ||
| def __init__(self, any_ip, ip_address, ip_prefix_size, | ||
| port_begin, port_end): | ||
| self.any_ip = any_ip | ||
| self.ip_address = ip_address | ||
| self.ip_prefix_size = ip_prefix_size | ||
| self.port_begin = port_begin | ||
| self.port_end = port_end | ||
|
|
||
|
|
||
| class DimensionDataNatRule(object): | ||
| """ | ||
| An IP NAT rule in a network domain | ||
| """ | ||
| def __init__(self, id, network_domain, internal_ip, external_ip, status): | ||
| self.id = id | ||
| self.network_domain = network_domain | ||
| self.internal_ip = internal_ip | ||
| self.external_ip = external_ip | ||
| self.status = status | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataNatRule: id=%s, status=%s>') | ||
| % (self.id, self.status)) | ||
|
|
||
|
|
||
| class DimensionDataVlan(object): | ||
| """ | ||
| DimensionData VLAN. | ||
| """ | ||
|
|
||
| def __init__(self, id, name, description, location, status): | ||
| def __init__(self, id, name, description, location, status, | ||
| private_ipv4_range_address, private_ipv4_range_size): | ||
| """ | ||
| Initialize an instance of ``DimensionDataVlan`` | ||
|
|
||
| :param id: The ID of the VLAN | ||
| :type id: ``string`` | ||
|
|
||
| :param name: The name of the VLAN | ||
| :type name: ``string`` | ||
|
|
||
| :param description: Plan text description of the VLAN | ||
| :type description: ``string`` | ||
|
|
||
| :param location: The location (data center) of the VLAN | ||
| :type location: ``NodeLocation`` | ||
|
|
||
| :param status: The status of the VLAN | ||
| :type status: ``DimensionDataStatus`` | ||
|
|
||
| :param private_ipv4_range_address: The host address of the VLAN | ||
| IP space | ||
| :type private_ipv4_range_address: ``string`` | ||
|
|
||
| :param private_ipv4_range_address: The size (e.g. '24') of the VLAN | ||
| as a CIDR range size | ||
| :type private_ipv4_range_address: ``string`` | ||
| """ | ||
| self.id = str(id) | ||
| self.name = name | ||
| self.location = location | ||
| self.description = description | ||
| self.status = status | ||
| self.private_ipv4_range_address = private_ipv4_range_address | ||
| self.private_ipv4_range_size = private_ipv4_range_size | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataNetworkDomain: id=%s, name=%s, ' | ||
| return (('<DimensionDataVlan: id=%s, name=%s, ' | ||
| 'description=%s, location=%s, status=%s>') | ||
| % (self.id, self.name, self.description, | ||
| self.location, self.status)) | ||
|
|
@@ -320,11 +432,16 @@ class DimensionDataPool(object): | |
| DimensionData VIP Pool. | ||
| """ | ||
|
|
||
| def __init__(self, id, name, description, status): | ||
| def __init__(self, id, name, description, status, load_balance_method, | ||
| health_monitor_id, service_down_action, slow_ramp_time): | ||
| self.id = str(id) | ||
| self.name = name | ||
| self.description = description | ||
| self.status = status | ||
| self.load_balance_method = load_balance_method | ||
| self.health_monitor_id = health_monitor_id | ||
| self.service_down_action = service_down_action | ||
| self.slow_ramp_time = slow_ramp_time | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataPool: id=%s, name=%s, ' | ||
|
|
@@ -355,11 +472,14 @@ def __repr__(self): | |
|
|
||
|
|
||
| class DimensionDataVIPNode(object): | ||
| def __init__(self, id, name, status, ip): | ||
| def __init__(self, id, name, status, ip, connection_limit='10000', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the limit values are string and not integers? Or just the default values are strings. In any case, would be better if they were integers. |
||
| connection_rate_limit='10000'): | ||
| self.id = str(id) | ||
| self.name = name | ||
| self.status = status | ||
| self.ip = ip | ||
| self.connection_limit = connection_limit | ||
| self.connection_rate_limit = connection_rate_limit | ||
|
|
||
| def __repr__(self): | ||
| return (('<DimensionDataVIPNode: id=%s, name=%s, ' | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
private_ipv4_range_sizeCIDR suffix (e.g. "32" part of ip/32 notation) or something else?In any case, it would be good to add a method docstring which at least documents and explain the arguments which are a bit less self-explanatory.