Skip to content

Commit

Permalink
Revert ":sparkles: IF-7067 add security group rules api (#90)" (#95)
Browse files Browse the repository at this point in the history
This reverts commit b8ca37e.
  • Loading branch information
sugimo-s authored Feb 17, 2022
1 parent c5b99e1 commit 1edbfbc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 204 deletions.
100 changes: 1 addition & 99 deletions ecl/network/v2/_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from ecl.network.v2 import quota as _quota
from ecl.network.v2 import reserved_address as _reserved_address
from ecl.network.v2 import security_group as _security_group
from ecl.network.v2 import security_group_rule as _security_group_rule
from ecl.network.v2 import firewall as _firewall
from ecl.network.v2 import firewall_interface as _firewall_if
from ecl.network.v2 import firewall_plan as _firewall_plan
Expand Down Expand Up @@ -570,7 +569,7 @@ def delete_security_group(self, security_group, ignore_missing=False):
:param security_group: The value can be either the ID of
a security-group or
a :class:`~ecl.network.v2.security_group.SecurityGroup` instance.
a :class:`~ecl.network.v2.port.Port` instance.
:param bool ignore_missing: When set to ``False`` :class:
`~ecl.exceptions.ResourceNotFound` will
be raised when the security-group does
Expand All @@ -582,103 +581,6 @@ def delete_security_group(self, security_group, ignore_missing=False):
self._delete(_security_group.SecurityGroup, security_group,
ignore_missing=ignore_missing)

def security_group_rules(self, **query):
""" List all visible security-group-rules.
:param query: Query parameters to select results
:return: A list of security-group-rule objects
:rtype: :class:`~ecl.network.v2.security_group_rule.SecurityGroupRule`
"""
return list(self._list(_security_group_rule.SecurityGroupRule,
paginated=False, **query))

def create_security_group_rule(self, security_group_id, direction,
description=None, ethertype=None,
port_range_max=None, port_range_min=None,
protocol=None, remote_group_id=None,
remote_ip_prefix=None, tenant_id=None):
"""Create security-group-rule.
:param string security_group_id: Security group id.
:param string direction: Direction in which the security group rule
is applied.
:param string description: Security group rule description.
:param string ethertype: Addresses represented in CIDR must match
the ingress or egress rules.
:param int port_range_max: The maximum port number in the range that
is matched by the security group rule.
:param int port_range_min: The minimum port number in the range that
is matched by the security group rule.
:param string protocol: Protocol name or number in string format.
e.g. "ICMP" or "1"
:param string remote_group_id: The remote group UUID to associate
with this security group rule. Only
either one of remote_group_id and
remote_ip_prefix have to be specified.
:param string remote_ip_prefix: The IP address prefix to associate
with this security group rule. Only
either one of remote_group_id and
remote_ip_prefix have to be specified.
:param string tenant_id: The owner name of security group rule.
:returns: The results of security-group-rule creation
:rtype: :class:`~ecl.network.v2.security_group_rule.SecurityGroupRule`
"""
body = {
"security_group_id": security_group_id,
"direction": direction
}
if description:
body["description"] = description
if ethertype:
body["ethertype"] = ethertype
if port_range_max is not None:
body["port_range_max"] = port_range_max
if port_range_min is not None:
body["port_range_min"] = port_range_min
if protocol:
body["protocol"] = protocol
if remote_group_id:
body["remote_group_id"] = remote_group_id
if remote_ip_prefix:
body["remote_ip_prefix"] = remote_ip_prefix
if tenant_id:
body["tenant_id"] = tenant_id

return self._create(_security_group_rule.SecurityGroupRule, **body)

def get_security_group_rule(self, security_group_rule):
"""Show details for security-group-rule.
:param security_group_rule: The value can be the ID of
a security-group-rule or
a :class:`~ecl.network.v2.security_group_rule.SecurityGroupRule`
instance.
:returns: :class:`~ecl.network.v2.security_group_rule.SecurityGroupRule`
:raises: :class:`~ecl.exceptions.ResourceNotFound`
when no resource can be found.
"""
return self._get(_security_group_rule.SecurityGroupRule,
security_group_rule)

def delete_security_group_rule(self, security_group_rule,
ignore_missing=False):
"""Delete security-group-rule.
:param security_group_rule: The value can be either the ID of
a security-group-rule or
a :class:`~ecl.network.v2.security_group_rule.SecurityGroupRule`
instance.
:param bool ignore_missing: When set to ``False`` :class:
`~ecl.exceptions.ResourceNotFound` will
be raised when the security-group-rule does
not exist. When set to ``True``,
no exception will be set when attempting
to delete a nonexistent security-group-rule.
:returns: ``None``
"""
self._delete(_security_group_rule.SecurityGroupRule,
security_group_rule, ignore_missing=ignore_missing)

def firewalls(self, **query):
"""
List all visible firewalls.
Expand Down
46 changes: 0 additions & 46 deletions ecl/network/v2/security_group_rule.py

This file was deleted.

59 changes: 0 additions & 59 deletions ecl/tests/unit/network/v2/test_security_group_rule.py

This file was deleted.

0 comments on commit 1edbfbc

Please sign in to comment.