"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ec2api/api/network_interface.py" between
ec2-api-12.0.0.tar.gz and ec2-api-13.0.0.tar.gz

About: OpenStack EC2 API provides a standalone EC2 (and VPC) API service.
The "Xena" series (latest release).

network_interface.py  (ec2-api-12.0.0):network_interface.py  (ec2-api-13.0.0)
skipping to change at line 45 skipping to change at line 45
"""Network interface related API implementation """Network interface related API implementation
""" """
Validator = common.Validator Validator = common.Validator
def create_network_interface(context, subnet_id, def create_network_interface(context, subnet_id,
private_ip_address=None, private_ip_address=None,
private_ip_addresses=None, private_ip_addresses=None,
secondary_private_ip_address_count=None, secondary_private_ip_address_count=None,
description=None, description=None,
security_group_id=None): security_group_id=None,
client_token=None):
if client_token:
result = describe_network_interfaces(context,
filter=[{'name': 'client-token',
'value': [client_token]}])
if result['networkInterfaceSet']:
if len(result['networkInterfaceSet']) > 1:
LOG.error('describe_network_interfaces returns %s '
'network_interfaces, but 1 is expected.',
len(result['networkInterfaceSet']))
LOG.error('Requested client token: %s', client_token)
LOG.error('Result: %s', result)
return result['networkInterfaceSet'][0]
subnet = ec2utils.get_db_item(context, subnet_id) subnet = ec2utils.get_db_item(context, subnet_id)
if subnet is None: if subnet is None:
raise exception.InvalidSubnetIDNotFound(id=subnet_id) raise exception.InvalidSubnetIDNotFound(id=subnet_id)
neutron = clients.neutron(context) neutron = clients.neutron(context)
os_subnet = neutron.show_subnet(subnet['os_id'])['subnet'] os_subnet = neutron.show_subnet(subnet['os_id'])['subnet']
# NOTE(Alex): Combine and check ip addresses. Neutron will accept # NOTE(Alex): Combine and check ip addresses. Neutron will accept
# ip_address as a parameter for specified address and subnet_id for # ip_address as a parameter for specified address and subnet_id for
# address to auto-allocate. # address to auto-allocate.
# TODO(Alex): Implement better diagnostics. # TODO(Alex): Implement better diagnostics.
subnet_ipnet = netaddr.IPNetwork(os_subnet['cidr']) subnet_ipnet = netaddr.IPNetwork(os_subnet['cidr'])
skipping to change at line 202 skipping to change at line 217
'association.public-ip': ('association', 'publicIp'), 'association.public-ip': ('association', 'publicIp'),
'attachment.attachment-id': ('attachment', 'attachmentId'), 'attachment.attachment-id': ('attachment', 'attachmentId'),
'attachment.instance-id': ('attachment', 'instanceId'), 'attachment.instance-id': ('attachment', 'instanceId'),
'attachment.instance-owner-id': ('attachment', 'attachment.instance-owner-id': ('attachment',
'instanceOwnerId'), 'instanceOwnerId'),
'attachment.device-index': ('attachment', 'deviceIndex'), 'attachment.device-index': ('attachment', 'deviceIndex'),
'attachment.status': ('attachment', 'status'), 'attachment.status': ('attachment', 'status'),
'attachment.attach.time': ('attachment', 'attachTime'), 'attachment.attach.time': ('attachment', 'attachTime'),
'attachment.delete-on-termination': ('attachment', 'attachment.delete-on-termination': ('attachment',
'deleteOnTermination'), 'deleteOnTermination'),
'client-token': 'clientToken',
'description': 'description', 'description': 'description',
'group-id': ['groupSet', 'groupId'], 'group-id': ['groupSet', 'groupId'],
'group-name': ['groupSet', 'groupName'], 'group-name': ['groupSet', 'groupName'],
'mac-address': 'macAddress', 'mac-address': 'macAddress',
'network-interface-id': 'networkInterfaceId', 'network-interface-id': 'networkInterfaceId',
'owner-id': 'ownerId', 'owner-id': 'ownerId',
'private-ip-address': 'privateIpAddress', 'private-ip-address': 'privateIpAddress',
'requester-managed': 'requesterManaged', 'requester-managed': 'requesterManaged',
'source-dest-check': 'sourceDestCheck', 'source-dest-check': 'sourceDestCheck',
'status': 'status', 'status': 'status',
 End of changes. 2 change blocks. 
1 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)