cloud.py (ec2-api-14.0.1) | : | cloud.py (ec2-api-15.0.0) | ||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
""" | """ | |||
Cloud Controller: Implementation of EC2 REST API calls, which are | Cloud Controller: Implementation of EC2 REST API calls, which are | |||
dispatched to other nodes via AMQP RPC. State is via distributed | dispatched to other nodes via AMQP RPC. State is via distributed | |||
datastore. | datastore. | |||
""" | """ | |||
import collections | import collections | |||
from oslo_config import cfg | from oslo_config import cfg | |||
from oslo_log import log as logging | from oslo_log import log as logging | |||
import six | ||||
import six.moves | ||||
from ec2api.api import address | from ec2api.api import address | |||
from ec2api.api import availability_zone | from ec2api.api import availability_zone | |||
from ec2api.api import customer_gateway | from ec2api.api import customer_gateway | |||
from ec2api.api import dhcp_options | from ec2api.api import dhcp_options | |||
from ec2api.api import image | from ec2api.api import image | |||
from ec2api.api import instance | from ec2api.api import instance | |||
from ec2api.api import internet_gateway | from ec2api.api import internet_gateway | |||
from ec2api.api import key_pair | from ec2api.api import key_pair | |||
from ec2api.api import network_interface | from ec2api.api import network_interface | |||
skipping to change at line 61 | skipping to change at line 59 | |||
def module_and_param_types(module, *args, **kwargs): | def module_and_param_types(module, *args, **kwargs): | |||
"""Decorator to check types and call function.""" | """Decorator to check types and call function.""" | |||
param_types = args | param_types = args | |||
def wrapped(func): | def wrapped(func): | |||
def func_wrapped(*args, **kwargs): | def func_wrapped(*args, **kwargs): | |||
impl_func = getattr(module, func.__name__) | impl_func = getattr(module, func.__name__) | |||
context = args[1] | context = args[1] | |||
params = collections.OrderedDict(six.moves.zip( | params = collections.OrderedDict(zip( | |||
func.__code__.co_varnames[2:], param_types)) | func.__code__.co_varnames[2:], param_types)) | |||
param_num = 0 | param_num = 0 | |||
mandatory_params_num = (func.__code__.co_argcount - 2 - | mandatory_params_num = (func.__code__.co_argcount - 2 - | |||
len(func.__defaults__ or [])) | len(func.__defaults__ or [])) | |||
for param_name, param_type in params.items(): | for param_name, param_type in params.items(): | |||
param_value = kwargs.get(param_name) | param_value = kwargs.get(param_name) | |||
if param_value is not None: | if param_value is not None: | |||
validator = module.Validator(param_name, func.__name__, | validator = module.Validator(param_name, func.__name__, | |||
params) | params) | |||
validation_func = getattr(validator, param_type) | validation_func = getattr(validator, param_type) | |||
skipping to change at line 1970 | skipping to change at line 1968 | |||
Args: | Args: | |||
context (RequestContext): The request context. | context (RequestContext): The request context. | |||
vpn_gateway_id (list of str): One or more virtual private gateway | vpn_gateway_id (list of str): One or more virtual private gateway | |||
IDs. | IDs. | |||
filter (list of filter dict): One or more filters. | filter (list of filter dict): One or more filters. | |||
Returns: | Returns: | |||
Information about one or more virtual private gateways. | Information about one or more virtual private gateways. | |||
""" | """ | |||
@module_and_param_types(customer_gateway, 'ip', 'vpn_connection_type', | @module_and_param_types(customer_gateway, 'vpn_connection_type', | |||
'int') | 'int', 'ip', 'ip') | |||
def create_customer_gateway(self, context, ip_address, type, | def create_customer_gateway(self, context, type, | |||
bgp_asn=None): | bgp_asn=None, ip_address=None, public_ip=None): | |||
"""Provides information to EC2 API about VPN customer gateway device. | """Provides information to EC2 API about VPN customer gateway device. | |||
Args: | Args: | |||
context (RequestContext): The request context. | context (RequestContext): The request context. | |||
ip_address (str): The Internet-routable IP address for the | ip_address (str): The Internet-routable IP address for the | |||
customer gateway's outside interface. | customer gateway's outside interface. | |||
type (str): The type of VPN connection that this customer gateway | type (str): The type of VPN connection that this customer gateway | |||
supports (ipsec.1). | supports (ipsec.1). | |||
bgp_asn (int): For devices that support BGP, | bgp_asn (int): For devices that support BGP, | |||
the customer gateway's BGP ASN (65000 otherwise). | the customer gateway's BGP ASN (65000 otherwise). | |||
End of changes. 3 change blocks. | ||||
7 lines changed or deleted | 5 lines changed or added |