-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Revert ":sparkles: IF-6816 add security groups api (#89)" (#96)" This reverts commit a77f2df. * Revert "Revert ":sparkles: IF-7067 add security group rules api (#90)" (#95)" This reverts commit 1edbfbc. * Revert "Revert ":bug: IF-7068 fix existing api (#91)" (#94)" This reverts commit c5b99e1. * ✨ IF-7192 security groups api query support (#93) - List Security Group API - List Security Group Rule API Co-authored-by: a-oi-xon <atsushi_oizaki@xon.jp> Co-authored-by: a-oi-xon <91597807+a-oi-xon@users.noreply.github.com>
- Loading branch information
1 parent
fc7f45c
commit d98580f
Showing
9 changed files
with
426 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from ecl.network import network_service | ||
from ecl import resource2 | ||
|
||
|
||
class SecurityGroup(resource2.Resource): | ||
"""SecurityGroup Resource""" | ||
resource_key = 'security_group' | ||
resources_key = 'security_groups' | ||
service = network_service.NetworkService("v2.0") | ||
base_path = '/' + service.version + '/security-groups' | ||
|
||
# query parameter names | ||
_query_mapping = resource2.QueryParameters( | ||
'description', 'id', 'name', 'status', 'tenant_id') | ||
|
||
# capabilities | ||
allow_list = True | ||
allow_create = True | ||
allow_get = True | ||
allow_update = True | ||
allow_delete = True | ||
|
||
# Properties | ||
# Security group description. | ||
description = resource2.Body('description') | ||
# Security group unique id. | ||
id = resource2.Body('id') | ||
# Security group name. | ||
name = resource2.Body('name') | ||
# Security group status. | ||
status = resource2.Body('status') | ||
# Security Group tags. | ||
tags = resource2.Body('tags') | ||
# The owner name of security group. | ||
tenant_id = resource2.Body('tenant_id') | ||
# Security group rules | ||
security_group_rules = resource2.Body('security_group_rules', type=list) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from ecl.network import network_service | ||
from ecl import resource2 | ||
|
||
|
||
class SecurityGroupRule(resource2.Resource): | ||
"""SecurityGroupRule Resource""" | ||
resource_key = 'security_group_rule' | ||
resources_key = 'security_group_rules' | ||
service = network_service.NetworkService("v2.0") | ||
base_path = '/' + service.version + '/security-group-rules' | ||
|
||
# query parameter names | ||
_query_mapping = resource2.QueryParameters( | ||
'description', 'direction', 'ethertype', 'id', 'port_range_max', | ||
'port_range_min', 'protocol', 'remote_group_id', 'remote_ip_prefix', | ||
'security_group_id', 'tenant_id') | ||
|
||
# capabilities | ||
allow_list = True | ||
allow_create = True | ||
allow_get = True | ||
allow_delete = True | ||
|
||
# Properties | ||
# Security group rule description. | ||
description = resource2.Body('description') | ||
# Direction in which the security group rule is applied. | ||
direction = resource2.Body('direction') | ||
# Addresses represented in CIDR must match the ingress or egress rules. | ||
ethertype = resource2.Body('ethertype') | ||
# Security group rule unique id. | ||
id = resource2.Body('id') | ||
# The maximum port number in the range that is matched | ||
# by the security group rule. | ||
port_range_max = resource2.Body('port_range_max', type=int) | ||
# The minimum port number in the range that is matched | ||
# by the security group rule. | ||
port_range_min = resource2.Body('port_range_min', type=int) | ||
# Protocol name or number in string format. e.g. "ICMP" or "1" | ||
protocol = resource2.Body('protocol') | ||
# 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. | ||
remote_group_id = resource2.Body('remote_group_id') | ||
# 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. | ||
remote_ip_prefix = resource2.Body('remote_ip_prefix') | ||
# Security group id. | ||
security_group_id = resource2.Body('security_group_id') | ||
# The owner name of security group rule. | ||
tenant_id = resource2.Body('tenant_id') |
This file contains 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
Oops, something went wrong.