From 27a086409e78fe614e411d83e7d5844370e65244 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Thu, 21 Feb 2013 23:13:01 -0500 Subject: [PATCH] adding ec2 stubs --- moto/ec2/models.py | 33 +++++++++++ moto/ec2/responses/__init__.py | 27 +++++++++ moto/ec2/responses/amazon_dev_pay.py | 10 ++++ moto/ec2/responses/amis.py | 28 +++++++++ .../availability_zonesand_regions.py | 13 +++++ moto/ec2/responses/customer_gateways.py | 16 +++++ moto/ec2/responses/dhcp_options.py | 19 ++++++ moto/ec2/responses/elastic_block_store.py | 58 +++++++++++++++++++ moto/ec2/responses/elastic_ip_addresses.py | 22 +++++++ .../responses/elastic_network_interfaces.py | 31 ++++++++++ moto/ec2/responses/general.py | 10 ++++ moto/ec2/responses/instances.py | 2 +- moto/ec2/responses/internet_gateways.py | 22 +++++++ moto/ec2/responses/ip_addresses.py | 13 +++++ moto/ec2/responses/key_pairs.py | 19 ++++++ moto/ec2/responses/monitoring.py | 13 +++++ moto/ec2/responses/network_acls.py | 28 +++++++++ moto/ec2/responses/placement_groups.py | 16 +++++ moto/ec2/responses/reserved_instances.py | 25 ++++++++ moto/ec2/responses/route_tables.py | 34 +++++++++++ moto/ec2/responses/security_groups.py | 28 +++++++++ moto/ec2/responses/spot_instances.py | 28 +++++++++ moto/ec2/responses/subnets.py | 16 +++++ moto/ec2/responses/tags.py | 2 +- .../ec2/responses/virtual_private_gateways.py | 22 +++++++ moto/ec2/responses/vm_export.py | 16 +++++ moto/ec2/responses/vm_import.py | 19 ++++++ moto/ec2/responses/vpcs.py | 16 +++++ moto/ec2/responses/vpn_connections.py | 16 +++++ moto/ec2/responses/windows.py | 19 ++++++ moto/ec2/utils.py | 12 ++-- tests/test_ec2/test_amazon_dev_pay.py | 9 +++ tests/test_ec2/test_amis.py | 9 +++ .../test_availability_zonesand_regions.py | 9 +++ tests/test_ec2/test_customer_gateways.py | 9 +++ tests/test_ec2/test_dhcp_options.py | 9 +++ tests/test_ec2/test_elastic_block_store.py | 9 +++ tests/test_ec2/test_elastic_ip_addresses.py | 9 +++ .../test_elastic_network_interfaces.py | 9 +++ tests/test_ec2/test_general.py | 9 +++ tests/test_ec2/test_instances.py | 1 - tests/test_ec2/test_internet_gateways.py | 9 +++ tests/test_ec2/test_ip_addresses.py | 9 +++ tests/test_ec2/test_key_pairs.py | 9 +++ tests/test_ec2/test_monitoring.py | 9 +++ tests/test_ec2/test_network_acls.py | 9 +++ tests/test_ec2/test_placement_groups.py | 9 +++ tests/test_ec2/test_reserved_instances.py | 9 +++ tests/test_ec2/test_route_tables.py | 9 +++ tests/test_ec2/test_security_groups.py | 9 +++ tests/test_ec2/test_spot_instances.py | 9 +++ tests/test_ec2/test_subnets.py | 9 +++ tests/test_ec2/test_tags.py | 2 - .../test_ec2/test_virtual_private_gateways.py | 9 +++ tests/test_ec2/test_vm_export.py | 9 +++ tests/test_ec2/test_vm_import.py | 9 +++ tests/test_ec2/test_vpcs.py | 9 +++ tests/test_ec2/test_vpn_connections.py | 9 +++ tests/test_ec2/test_windows.py | 9 +++ 59 files changed, 861 insertions(+), 9 deletions(-) create mode 100644 moto/ec2/responses/amazon_dev_pay.py create mode 100644 moto/ec2/responses/amis.py create mode 100644 moto/ec2/responses/availability_zonesand_regions.py create mode 100644 moto/ec2/responses/customer_gateways.py create mode 100644 moto/ec2/responses/dhcp_options.py create mode 100644 moto/ec2/responses/elastic_block_store.py create mode 100644 moto/ec2/responses/elastic_ip_addresses.py create mode 100644 moto/ec2/responses/elastic_network_interfaces.py create mode 100644 moto/ec2/responses/general.py create mode 100644 moto/ec2/responses/internet_gateways.py create mode 100644 moto/ec2/responses/ip_addresses.py create mode 100644 moto/ec2/responses/key_pairs.py create mode 100644 moto/ec2/responses/monitoring.py create mode 100644 moto/ec2/responses/network_acls.py create mode 100644 moto/ec2/responses/placement_groups.py create mode 100644 moto/ec2/responses/reserved_instances.py create mode 100644 moto/ec2/responses/route_tables.py create mode 100644 moto/ec2/responses/security_groups.py create mode 100644 moto/ec2/responses/spot_instances.py create mode 100644 moto/ec2/responses/subnets.py create mode 100644 moto/ec2/responses/virtual_private_gateways.py create mode 100644 moto/ec2/responses/vm_export.py create mode 100644 moto/ec2/responses/vm_import.py create mode 100644 moto/ec2/responses/vpcs.py create mode 100644 moto/ec2/responses/vpn_connections.py create mode 100644 moto/ec2/responses/windows.py create mode 100644 tests/test_ec2/test_amazon_dev_pay.py create mode 100644 tests/test_ec2/test_amis.py create mode 100644 tests/test_ec2/test_availability_zonesand_regions.py create mode 100644 tests/test_ec2/test_customer_gateways.py create mode 100644 tests/test_ec2/test_dhcp_options.py create mode 100644 tests/test_ec2/test_elastic_block_store.py create mode 100644 tests/test_ec2/test_elastic_ip_addresses.py create mode 100644 tests/test_ec2/test_elastic_network_interfaces.py create mode 100644 tests/test_ec2/test_general.py create mode 100644 tests/test_ec2/test_internet_gateways.py create mode 100644 tests/test_ec2/test_ip_addresses.py create mode 100644 tests/test_ec2/test_key_pairs.py create mode 100644 tests/test_ec2/test_monitoring.py create mode 100644 tests/test_ec2/test_network_acls.py create mode 100644 tests/test_ec2/test_placement_groups.py create mode 100644 tests/test_ec2/test_reserved_instances.py create mode 100644 tests/test_ec2/test_route_tables.py create mode 100644 tests/test_ec2/test_security_groups.py create mode 100644 tests/test_ec2/test_spot_instances.py create mode 100644 tests/test_ec2/test_subnets.py create mode 100644 tests/test_ec2/test_virtual_private_gateways.py create mode 100644 tests/test_ec2/test_vm_export.py create mode 100644 tests/test_ec2/test_vm_import.py create mode 100644 tests/test_ec2/test_vpcs.py create mode 100644 tests/test_ec2/test_vpn_connections.py create mode 100644 tests/test_ec2/test_windows.py diff --git a/moto/ec2/models.py b/moto/ec2/models.py index f0c50c30b..1e1209e22 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -109,3 +109,36 @@ class EC2Backend(BaseBackend, InstanceBackend, TagBackend): ec2_backend = EC2Backend() + + + +{ +#'Instances': ['DescribeInstanceAttribute', 'DescribeInstances', '\n\t\t\tDescribeInstanceStatus\n\t\t', 'ImportInstance', 'ModifyInstanceAttribute', 'RebootInstances', 'ReportInstanceStatus', 'ResetInstanceAttribute', 'RunInstances', 'StartInstances', 'StopInstances', 'TerminateInstances'], +#'Tags': ['CreateTags', 'DeleteTags', 'DescribeTags'], +'IP Addresses': ['AssignPrivateIpAddresses', 'UnassignPrivateIpAddresses'], +'Monitoring': ['MonitorInstances', 'UnmonitorInstances'], +'Reserved Instances': ['CancelReservedInstancesListing', 'CreateReservedInstancesListing', 'DescribeReservedInstances', 'DescribeReservedInstancesListings', 'DescribeReservedInstancesOfferings', 'PurchaseReservedInstancesOffering'], +'VPN Connections (Amazon VPC)': ['CreateVpnConnection', 'DeleteVpnConnection', 'DescribeVpnConnections'], +'DHCP Options (Amazon VPC)': ['AssociateDhcpOptions', 'CreateDhcpOptions', 'DeleteDhcpOptions', 'DescribeDhcpOptions'], +'Network ACLs (Amazon VPC)': ['CreateNetworkAcl', 'CreateNetworkAclEntry', 'DeleteNetworkAcl', 'DeleteNetworkAclEntry', 'DescribeNetworkAcls', 'ReplaceNetworkAclAssociation', 'ReplaceNetworkAclEntry'], +'Elastic Block Store': ['AttachVolume', 'CopySnapshot', 'CreateSnapshot', 'CreateVolume', 'DeleteSnapshot', 'DeleteVolume', 'DescribeSnapshotAttribute', 'DescribeSnapshots', 'DescribeVolumes', 'DescribeVolumeAttribute', 'DescribeVolumeStatus', 'DetachVolume', 'EnableVolumeIO', 'ImportVolume', 'ModifySnapshotAttribute', 'ModifyVolumeAttribute', 'ResetSnapshotAttribute'], +'Customer Gateways (Amazon VPC)': ['CreateCustomerGateway', 'DeleteCustomerGateway', 'DescribeCustomerGateways'], +'Subnets (Amazon VPC)': ['CreateSubnet', 'DeleteSubnet', 'DescribeSubnets'], +'AMIs': ['CreateImage', 'DeregisterImage', 'DescribeImageAttribute', 'DescribeImages', 'ModifyImageAttribute', 'RegisterImage', 'ResetImageAttribute'], +'Virtual Private Gateways (Amazon VPC)': ['AttachVpnGateway', 'CreateVpnGateway', 'DeleteVpnGateway', 'DescribeVpnGateways', 'DetachVpnGateway'], +'Availability Zones and Regions': ['DescribeAvailabilityZones', 'DescribeRegions'], +'VPCs (Amazon VPC)': ['CreateVpc', 'DeleteVpc', 'DescribeVpcs'], +'Windows': ['BundleInstance', 'CancelBundleTask', 'DescribeBundleTasks', 'GetPasswordData'], +'VM Import': ['CancelConversionTask', 'DescribeConversionTasks', 'ImportInstance', 'ImportVolume'], +'Placement Groups': ['CreatePlacementGroup', 'DeletePlacementGroup', 'DescribePlacementGroups'], +'Key Pairs': ['CreateKeyPair', 'DeleteKeyPair', 'DescribeKeyPairs', 'ImportKeyPair'], +'Amazon DevPay': ['ConfirmProductInstance'], +'Internet Gateways (Amazon VPC)': ['AttachInternetGateway', 'CreateInternetGateway', 'DeleteInternetGateway', 'DescribeInternetGateways', 'DetachInternetGateway'], +'Route Tables (Amazon VPC)': ['AssociateRouteTable', 'CreateRoute', 'CreateRouteTable', 'DeleteRoute', 'DeleteRouteTable', 'DescribeRouteTables', 'DisassociateRouteTable', 'ReplaceRoute', 'ReplaceRouteTableAssociation'], +'Elastic Network Interfaces (Amazon VPC)': ['AttachNetworkInterface', 'CreateNetworkInterface', 'DeleteNetworkInterface', 'DescribeNetworkInterfaceAttribute', 'DescribeNetworkInterfaces', 'DetachNetworkInterface', 'ModifyNetworkInterfaceAttribute', 'ResetNetworkInterfaceAttribute'], +'Elastic IP Addresses': ['AllocateAddress', 'AssociateAddress', 'DescribeAddresses', 'DisassociateAddress', 'ReleaseAddress'], +'Security Groups': ['AuthorizeSecurityGroupEgress', 'AuthorizeSecurityGroupIngress', 'CreateSecurityGroup', 'DeleteSecurityGroup', 'DescribeSecurityGroups', 'RevokeSecurityGroupEgress', 'RevokeSecurityGroupIngress'], +'General': ['GetConsoleOutput'], +'VM Export': ['CancelExportTask', 'CreateInstanceExportTask', 'DescribeExportTasks'], +'Spot Instances': ['CancelSpotInstanceRequests', 'CreateSpotDatafeedSubscription', 'DeleteSpotDatafeedSubscription', 'DescribeSpotDatafeedSubscription', 'DescribeSpotInstanceRequests', 'DescribeSpotPriceHistory', 'RequestSpotInstances'] +} \ No newline at end of file diff --git a/moto/ec2/responses/__init__.py b/moto/ec2/responses/__init__.py index 70fe04388..ab034badd 100644 --- a/moto/ec2/responses/__init__.py +++ b/moto/ec2/responses/__init__.py @@ -2,6 +2,33 @@ from urlparse import parse_qs from moto.ec2.utils import camelcase_to_underscores, method_namess_from_class +from .amazon_dev_pay import AmazonDevPay +from .amis import AMIs +from .availability_zonesand_regions import AvailabilityZonesandRegions +from .customer_gateways import CustomerGateways +from .dhcp_options import DHCPOptions +from .elastic_block_store import ElasticBlockStore +from .elastic_ip_addresses import ElasticIPAddresses +from .elastic_network_interfaces import ElasticNetworkInterfaces +from .general import General +from .internet_gateways import InternetGateways +from .ip_addresses import IPAddresses +from .key_pairs import KeyPairs +from .monitoring import Monitoring +from .network_acls import NetworkACLs +from .placement_groups import PlacementGroups +from .reserved_instances import ReservedInstances +from .route_tables import RouteTables +from .security_groups import SecurityGroups +from .spot_instances import SpotInstances +from .subnets import Subnets +from .virtual_private_gateways import VirtualPrivateGateways +from .vm_export import VMExport +from .vm_import import VMImport +from .vpcs import VPCs +from .vpn_connections import VPNConnections +from .windows import Windows + from .instances import InstanceResponse from .tags import TagResponse diff --git a/moto/ec2/responses/amazon_dev_pay.py b/moto/ec2/responses/amazon_dev_pay.py new file mode 100644 index 000000000..1f656c340 --- /dev/null +++ b/moto/ec2/responses/amazon_dev_pay.py @@ -0,0 +1,10 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class AmazonDevPay(object): + def confirm_product_instance(self): + return NotImplemented + diff --git a/moto/ec2/responses/amis.py b/moto/ec2/responses/amis.py new file mode 100644 index 000000000..b7aba665e --- /dev/null +++ b/moto/ec2/responses/amis.py @@ -0,0 +1,28 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class AMIs(object): + def create_image(self): + return NotImplemented + + def deregister_image(self): + return NotImplemented + + def describe_image_attribute(self): + return NotImplemented + + def describe_images(self): + return NotImplemented + + def modify_image_attribute(self): + return NotImplemented + + def register_image(self): + return NotImplemented + + def reset_image_attribute(self): + return NotImplemented + diff --git a/moto/ec2/responses/availability_zonesand_regions.py b/moto/ec2/responses/availability_zonesand_regions.py new file mode 100644 index 000000000..456eac2b2 --- /dev/null +++ b/moto/ec2/responses/availability_zonesand_regions.py @@ -0,0 +1,13 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class AvailabilityZonesandRegions(object): + def describe_availability_zones(self): + return NotImplemented + + def describe_regions(self): + return NotImplemented + diff --git a/moto/ec2/responses/customer_gateways.py b/moto/ec2/responses/customer_gateways.py new file mode 100644 index 000000000..cf260a1f4 --- /dev/null +++ b/moto/ec2/responses/customer_gateways.py @@ -0,0 +1,16 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class CustomerGateways(object): + def create_customer_gateway(self): + return NotImplemented + + def delete_customer_gateway(self): + return NotImplemented + + def describe_customer_gateways(self): + return NotImplemented + diff --git a/moto/ec2/responses/dhcp_options.py b/moto/ec2/responses/dhcp_options.py new file mode 100644 index 000000000..77923ef64 --- /dev/null +++ b/moto/ec2/responses/dhcp_options.py @@ -0,0 +1,19 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class DHCPOptions(object): + def associate_dhcp_options(self): + return NotImplemented + + def create_dhcp_options(self): + return NotImplemented + + def delete_dhcp_options(self): + return NotImplemented + + def describe_dhcp_options(self): + return NotImplemented + diff --git a/moto/ec2/responses/elastic_block_store.py b/moto/ec2/responses/elastic_block_store.py new file mode 100644 index 000000000..3f211fb0a --- /dev/null +++ b/moto/ec2/responses/elastic_block_store.py @@ -0,0 +1,58 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class ElasticBlockStore(object): + def attach_volume(self): + return NotImplemented + + def copy_snapshot(self): + return NotImplemented + + def create_snapshot(self): + return NotImplemented + + def create_volume(self): + return NotImplemented + + def delete_snapshot(self): + return NotImplemented + + def delete_volume(self): + return NotImplemented + + def describe_snapshot_attribute(self): + return NotImplemented + + def describe_snapshots(self): + return NotImplemented + + def describe_volumes(self): + return NotImplemented + + def describe_volume_attribute(self): + return NotImplemented + + def describe_volume_status(self): + return NotImplemented + + def detach_volume(self): + return NotImplemented + + def enable_volume_io(self): + return NotImplemented + + def import_volume(self): + return NotImplemented + + def modify_snapshot_attribute(self): + return NotImplemented + + def modify_volume_attribute(self): + return NotImplemented + + def reset_snapshot_attribute(self): + return NotImplemented + diff --git a/moto/ec2/responses/elastic_ip_addresses.py b/moto/ec2/responses/elastic_ip_addresses.py new file mode 100644 index 000000000..c266697fb --- /dev/null +++ b/moto/ec2/responses/elastic_ip_addresses.py @@ -0,0 +1,22 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class ElasticIPAddresses(object): + def allocate_address(self): + return NotImplemented + + def associate_address(self): + return NotImplemented + + def describe_addresses(self): + return NotImplemented + + def disassociate_address(self): + return NotImplemented + + def release_address(self): + return NotImplemented + diff --git a/moto/ec2/responses/elastic_network_interfaces.py b/moto/ec2/responses/elastic_network_interfaces.py new file mode 100644 index 000000000..3db270f4b --- /dev/null +++ b/moto/ec2/responses/elastic_network_interfaces.py @@ -0,0 +1,31 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class ElasticNetworkInterfaces(object): + def attach_network_interface(self): + return NotImplemented + + def create_network_interface(self): + return NotImplemented + + def delete_network_interface(self): + return NotImplemented + + def describe_network_interface_attribute(self): + return NotImplemented + + def describe_network_interfaces(self): + return NotImplemented + + def detach_network_interface(self): + return NotImplemented + + def modify_network_interface_attribute(self): + return NotImplemented + + def reset_network_interface_attribute(self): + return NotImplemented + diff --git a/moto/ec2/responses/general.py b/moto/ec2/responses/general.py new file mode 100644 index 000000000..7c00d96e5 --- /dev/null +++ b/moto/ec2/responses/general.py @@ -0,0 +1,10 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class General(object): + def get_console_output(self): + return NotImplemented + diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py index d102d79db..0e3ac9a5b 100644 --- a/moto/ec2/responses/instances.py +++ b/moto/ec2/responses/instances.py @@ -1,7 +1,7 @@ from jinja2 import Template from moto.ec2.models import ec2_backend -from moto.ec2.utils import instance_ids_from_querystring, camelcase_to_underscores, method_namess_from_class +from moto.ec2.utils import instance_ids_from_querystring, camelcase_to_underscores class InstanceResponse(object): diff --git a/moto/ec2/responses/internet_gateways.py b/moto/ec2/responses/internet_gateways.py new file mode 100644 index 000000000..70e42b728 --- /dev/null +++ b/moto/ec2/responses/internet_gateways.py @@ -0,0 +1,22 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class InternetGateways(object): + def attach_internet_gateway(self): + return NotImplemented + + def create_internet_gateway(self): + return NotImplemented + + def delete_internet_gateway(self): + return NotImplemented + + def describe_internet_gateways(self): + return NotImplemented + + def detach_internet_gateway(self): + return NotImplemented + diff --git a/moto/ec2/responses/ip_addresses.py b/moto/ec2/responses/ip_addresses.py new file mode 100644 index 000000000..2726f388c --- /dev/null +++ b/moto/ec2/responses/ip_addresses.py @@ -0,0 +1,13 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class IPAddresses(object): + def assign_private_ip_addresses(self): + return NotImplemented + + def unassign_private_ip_addresses(self): + return NotImplemented + diff --git a/moto/ec2/responses/key_pairs.py b/moto/ec2/responses/key_pairs.py new file mode 100644 index 000000000..6e283bd33 --- /dev/null +++ b/moto/ec2/responses/key_pairs.py @@ -0,0 +1,19 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class KeyPairs(object): + def create_key_pair(self): + return NotImplemented + + def delete_key_pair(self): + return NotImplemented + + def describe_key_pairs(self): + return NotImplemented + + def import_key_pair(self): + return NotImplemented + diff --git a/moto/ec2/responses/monitoring.py b/moto/ec2/responses/monitoring.py new file mode 100644 index 000000000..9531d7842 --- /dev/null +++ b/moto/ec2/responses/monitoring.py @@ -0,0 +1,13 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class Monitoring(object): + def monitor_instances(self): + return NotImplemented + + def unmonitor_instances(self): + return NotImplemented + diff --git a/moto/ec2/responses/network_acls.py b/moto/ec2/responses/network_acls.py new file mode 100644 index 000000000..64cc5e140 --- /dev/null +++ b/moto/ec2/responses/network_acls.py @@ -0,0 +1,28 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class NetworkACLs(object): + def create_network_acl(self): + return NotImplemented + + def create_network_acl_entry(self): + return NotImplemented + + def delete_network_acl(self): + return NotImplemented + + def delete_network_acl_entry(self): + return NotImplemented + + def describe_network_acls(self): + return NotImplemented + + def replace_network_acl_association(self): + return NotImplemented + + def replace_network_acl_entry(self): + return NotImplemented + diff --git a/moto/ec2/responses/placement_groups.py b/moto/ec2/responses/placement_groups.py new file mode 100644 index 000000000..39f62ab24 --- /dev/null +++ b/moto/ec2/responses/placement_groups.py @@ -0,0 +1,16 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class PlacementGroups(object): + def create_placement_group(self): + return NotImplemented + + def delete_placement_group(self): + return NotImplemented + + def describe_placement_groups(self): + return NotImplemented + diff --git a/moto/ec2/responses/reserved_instances.py b/moto/ec2/responses/reserved_instances.py new file mode 100644 index 000000000..6a7f62509 --- /dev/null +++ b/moto/ec2/responses/reserved_instances.py @@ -0,0 +1,25 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class ReservedInstances(object): + def cancel_reserved_instances_listing(self): + return NotImplemented + + def create_reserved_instances_listing(self): + return NotImplemented + + def describe_reserved_instances(self): + return NotImplemented + + def describe_reserved_instances_listings(self): + return NotImplemented + + def describe_reserved_instances_offerings(self): + return NotImplemented + + def purchase_reserved_instances_offering(self): + return NotImplemented + diff --git a/moto/ec2/responses/route_tables.py b/moto/ec2/responses/route_tables.py new file mode 100644 index 000000000..ab1a815f6 --- /dev/null +++ b/moto/ec2/responses/route_tables.py @@ -0,0 +1,34 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class RouteTables(object): + def associate_route_table(self): + return NotImplemented + + def create_route(self): + return NotImplemented + + def create_route_table(self): + return NotImplemented + + def delete_route(self): + return NotImplemented + + def delete_route_table(self): + return NotImplemented + + def describe_route_tables(self): + return NotImplemented + + def disassociate_route_table(self): + return NotImplemented + + def replace_route(self): + return NotImplemented + + def replace_route_table_association(self): + return NotImplemented + diff --git a/moto/ec2/responses/security_groups.py b/moto/ec2/responses/security_groups.py new file mode 100644 index 000000000..34afd1e97 --- /dev/null +++ b/moto/ec2/responses/security_groups.py @@ -0,0 +1,28 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class SecurityGroups(object): + def authorize_security_group_egress(self): + return NotImplemented + + def authorize_security_group_ingress(self): + return NotImplemented + + def create_security_group(self): + return NotImplemented + + def delete_security_group(self): + return NotImplemented + + def describe_security_groups(self): + return NotImplemented + + def revoke_security_group_egress(self): + return NotImplemented + + def revoke_security_group_ingress(self): + return NotImplemented + diff --git a/moto/ec2/responses/spot_instances.py b/moto/ec2/responses/spot_instances.py new file mode 100644 index 000000000..d99bd287f --- /dev/null +++ b/moto/ec2/responses/spot_instances.py @@ -0,0 +1,28 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class SpotInstances(object): + def cancel_spot_instance_requests(self): + return NotImplemented + + def create_spot_datafeed_subscription(self): + return NotImplemented + + def delete_spot_datafeed_subscription(self): + return NotImplemented + + def describe_spot_datafeed_subscription(self): + return NotImplemented + + def describe_spot_instance_requests(self): + return NotImplemented + + def describe_spot_price_history(self): + return NotImplemented + + def request_spot_instances(self): + return NotImplemented + diff --git a/moto/ec2/responses/subnets.py b/moto/ec2/responses/subnets.py new file mode 100644 index 000000000..e37b0d177 --- /dev/null +++ b/moto/ec2/responses/subnets.py @@ -0,0 +1,16 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class Subnets(object): + def create_subnet(self): + return NotImplemented + + def delete_subnet(self): + return NotImplemented + + def describe_subnets(self): + return NotImplemented + diff --git a/moto/ec2/responses/tags.py b/moto/ec2/responses/tags.py index 841d99ab3..f2241eeca 100644 --- a/moto/ec2/responses/tags.py +++ b/moto/ec2/responses/tags.py @@ -1,7 +1,7 @@ from jinja2 import Template from moto.ec2.models import ec2_backend -from moto.ec2.utils import resource_ids_from_querystring, camelcase_to_underscores, method_namess_from_class +from moto.ec2.utils import resource_ids_from_querystring class TagResponse(object): diff --git a/moto/ec2/responses/virtual_private_gateways.py b/moto/ec2/responses/virtual_private_gateways.py new file mode 100644 index 000000000..750596dea --- /dev/null +++ b/moto/ec2/responses/virtual_private_gateways.py @@ -0,0 +1,22 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class VirtualPrivateGateways(object): + def attach_vpn_gateway(self): + return NotImplemented + + def create_vpn_gateway(self): + return NotImplemented + + def delete_vpn_gateway(self): + return NotImplemented + + def describe_vpn_gateways(self): + return NotImplemented + + def detach_vpn_gateway(self): + return NotImplemented + diff --git a/moto/ec2/responses/vm_export.py b/moto/ec2/responses/vm_export.py new file mode 100644 index 000000000..def241b38 --- /dev/null +++ b/moto/ec2/responses/vm_export.py @@ -0,0 +1,16 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class VMExport(object): + def cancel_export_task(self): + return NotImplemented + + def create_instance_export_task(self): + return NotImplemented + + def describe_export_tasks(self): + return NotImplemented + diff --git a/moto/ec2/responses/vm_import.py b/moto/ec2/responses/vm_import.py new file mode 100644 index 000000000..577b06b32 --- /dev/null +++ b/moto/ec2/responses/vm_import.py @@ -0,0 +1,19 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class VMImport(object): + def cancel_conversion_task(self): + return NotImplemented + + def describe_conversion_tasks(self): + return NotImplemented + + def import_instance(self): + return NotImplemented + + def import_volume(self): + return NotImplemented + diff --git a/moto/ec2/responses/vpcs.py b/moto/ec2/responses/vpcs.py new file mode 100644 index 000000000..7c5c7e77b --- /dev/null +++ b/moto/ec2/responses/vpcs.py @@ -0,0 +1,16 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class VPCs(object): + def create_vpc(self): + return NotImplemented + + def delete_vpc(self): + return NotImplemented + + def describe_vpcs(self): + return NotImplemented + diff --git a/moto/ec2/responses/vpn_connections.py b/moto/ec2/responses/vpn_connections.py new file mode 100644 index 000000000..128c26fc2 --- /dev/null +++ b/moto/ec2/responses/vpn_connections.py @@ -0,0 +1,16 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class VPNConnections(object): + def create_vpn_connection(self): + return NotImplemented + + def delete_vpn_connection(self): + return NotImplemented + + def describe_vpn_connections(self): + return NotImplemented + diff --git a/moto/ec2/responses/windows.py b/moto/ec2/responses/windows.py new file mode 100644 index 000000000..f652bbdd0 --- /dev/null +++ b/moto/ec2/responses/windows.py @@ -0,0 +1,19 @@ +from jinja2 import Template + +from moto.ec2.models import ec2_backend +from moto.ec2.utils import resource_ids_from_querystring + + +class Windows(object): + def bundle_instance(self): + return NotImplemented + + def cancel_bundle_task(self): + return NotImplemented + + def describe_bundle_tasks(self): + return NotImplemented + + def get_password_data(self): + return NotImplemented + diff --git a/moto/ec2/utils.py b/moto/ec2/utils.py index 9eaa764a2..19ff92297 100644 --- a/moto/ec2/utils.py +++ b/moto/ec2/utils.py @@ -43,11 +43,15 @@ def camelcase_to_underscores(argument): ''' Converts a camelcase param like theNewAttribute to the equivalent python underscore variable like the_new_attribute''' result = '' - for index, char in enumerate(argument): - if char.istitle() and index: - # Only add underscore is char is capital and not first letter + prev_char_title = True + for char in argument: + if char.istitle() and not prev_char_title: + # Only add underscore if char is capital, not first letter, and prev + # char wasn't capital result += "_" - result += char.lower() + prev_char_title = char.istitle() + if not char.isspace(): # Only add non-whitespace + result += char.lower() return result diff --git a/tests/test_ec2/test_amazon_dev_pay.py b/tests/test_ec2/test_amazon_dev_pay.py new file mode 100644 index 000000000..ce011f70e --- /dev/null +++ b/tests/test_ec2/test_amazon_dev_pay.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_amazon_dev_pay(): + pass diff --git a/tests/test_ec2/test_amis.py b/tests/test_ec2/test_amis.py new file mode 100644 index 000000000..ac6e11efa --- /dev/null +++ b/tests/test_ec2/test_amis.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_amis(): + pass diff --git a/tests/test_ec2/test_availability_zonesand_regions.py b/tests/test_ec2/test_availability_zonesand_regions.py new file mode 100644 index 000000000..0449fa584 --- /dev/null +++ b/tests/test_ec2/test_availability_zonesand_regions.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_availability_zonesand_regions(): + pass diff --git a/tests/test_ec2/test_customer_gateways.py b/tests/test_ec2/test_customer_gateways.py new file mode 100644 index 000000000..c7f81133f --- /dev/null +++ b/tests/test_ec2/test_customer_gateways.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_customer_gateways(): + pass diff --git a/tests/test_ec2/test_dhcp_options.py b/tests/test_ec2/test_dhcp_options.py new file mode 100644 index 000000000..bb6d6a17f --- /dev/null +++ b/tests/test_ec2/test_dhcp_options.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_dhcp_options(): + pass diff --git a/tests/test_ec2/test_elastic_block_store.py b/tests/test_ec2/test_elastic_block_store.py new file mode 100644 index 000000000..f63bd503c --- /dev/null +++ b/tests/test_ec2/test_elastic_block_store.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_elastic_block_store(): + pass diff --git a/tests/test_ec2/test_elastic_ip_addresses.py b/tests/test_ec2/test_elastic_ip_addresses.py new file mode 100644 index 000000000..28d8247d7 --- /dev/null +++ b/tests/test_ec2/test_elastic_ip_addresses.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_elastic_ip_addresses(): + pass diff --git a/tests/test_ec2/test_elastic_network_interfaces.py b/tests/test_ec2/test_elastic_network_interfaces.py new file mode 100644 index 000000000..8dba98ec4 --- /dev/null +++ b/tests/test_ec2/test_elastic_network_interfaces.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_elastic_network_interfaces(): + pass diff --git a/tests/test_ec2/test_general.py b/tests/test_ec2/test_general.py new file mode 100644 index 000000000..6d2a9a9cd --- /dev/null +++ b/tests/test_ec2/test_general.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_general(): + pass diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py index 97bb730ee..0c07d48a1 100644 --- a/tests/test_ec2/test_instances.py +++ b/tests/test_ec2/test_instances.py @@ -5,7 +5,6 @@ from sure import expect from moto import mock_ec2 - @mock_ec2 def test_instance_launch_and_terminate(): conn = boto.connect_ec2('the_key', 'the_secret') diff --git a/tests/test_ec2/test_internet_gateways.py b/tests/test_ec2/test_internet_gateways.py new file mode 100644 index 000000000..7d0d28f6b --- /dev/null +++ b/tests/test_ec2/test_internet_gateways.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_internet_gateways(): + pass diff --git a/tests/test_ec2/test_ip_addresses.py b/tests/test_ec2/test_ip_addresses.py new file mode 100644 index 000000000..b4c0f70a9 --- /dev/null +++ b/tests/test_ec2/test_ip_addresses.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_ip_addresses(): + pass diff --git a/tests/test_ec2/test_key_pairs.py b/tests/test_ec2/test_key_pairs.py new file mode 100644 index 000000000..77cb7e0aa --- /dev/null +++ b/tests/test_ec2/test_key_pairs.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_key_pairs(): + pass diff --git a/tests/test_ec2/test_monitoring.py b/tests/test_ec2/test_monitoring.py new file mode 100644 index 000000000..3a802beab --- /dev/null +++ b/tests/test_ec2/test_monitoring.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_monitoring(): + pass diff --git a/tests/test_ec2/test_network_acls.py b/tests/test_ec2/test_network_acls.py new file mode 100644 index 000000000..2cb9da16c --- /dev/null +++ b/tests/test_ec2/test_network_acls.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_network_acls(): + pass diff --git a/tests/test_ec2/test_placement_groups.py b/tests/test_ec2/test_placement_groups.py new file mode 100644 index 000000000..fb7eb9623 --- /dev/null +++ b/tests/test_ec2/test_placement_groups.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_placement_groups(): + pass diff --git a/tests/test_ec2/test_reserved_instances.py b/tests/test_ec2/test_reserved_instances.py new file mode 100644 index 000000000..ef2ca4c2f --- /dev/null +++ b/tests/test_ec2/test_reserved_instances.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_reserved_instances(): + pass diff --git a/tests/test_ec2/test_route_tables.py b/tests/test_ec2/test_route_tables.py new file mode 100644 index 000000000..1ae716471 --- /dev/null +++ b/tests/test_ec2/test_route_tables.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_route_tables(): + pass diff --git a/tests/test_ec2/test_security_groups.py b/tests/test_ec2/test_security_groups.py new file mode 100644 index 000000000..9bba776f9 --- /dev/null +++ b/tests/test_ec2/test_security_groups.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_security_groups(): + pass diff --git a/tests/test_ec2/test_spot_instances.py b/tests/test_ec2/test_spot_instances.py new file mode 100644 index 000000000..727ad64e7 --- /dev/null +++ b/tests/test_ec2/test_spot_instances.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_spot_instances(): + pass diff --git a/tests/test_ec2/test_subnets.py b/tests/test_ec2/test_subnets.py new file mode 100644 index 000000000..bf95d3a9a --- /dev/null +++ b/tests/test_ec2/test_subnets.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_subnets(): + pass diff --git a/tests/test_ec2/test_tags.py b/tests/test_ec2/test_tags.py index fe39c25c2..03365e578 100644 --- a/tests/test_ec2/test_tags.py +++ b/tests/test_ec2/test_tags.py @@ -1,11 +1,9 @@ import boto -from boto.ec2.instance import Reservation, InstanceAttribute from sure import expect from moto import mock_ec2 - @mock_ec2 def test_instance_launch_and_terminate(): conn = boto.connect_ec2('the_key', 'the_secret') diff --git a/tests/test_ec2/test_virtual_private_gateways.py b/tests/test_ec2/test_virtual_private_gateways.py new file mode 100644 index 000000000..0267a7978 --- /dev/null +++ b/tests/test_ec2/test_virtual_private_gateways.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_virtual_private_gateways(): + pass diff --git a/tests/test_ec2/test_vm_export.py b/tests/test_ec2/test_vm_export.py new file mode 100644 index 000000000..7683e4203 --- /dev/null +++ b/tests/test_ec2/test_vm_export.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_vm_export(): + pass diff --git a/tests/test_ec2/test_vm_import.py b/tests/test_ec2/test_vm_import.py new file mode 100644 index 000000000..193cf6e34 --- /dev/null +++ b/tests/test_ec2/test_vm_import.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_vm_import(): + pass diff --git a/tests/test_ec2/test_vpcs.py b/tests/test_ec2/test_vpcs.py new file mode 100644 index 000000000..d74a0ad15 --- /dev/null +++ b/tests/test_ec2/test_vpcs.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_vpcs(): + pass diff --git a/tests/test_ec2/test_vpn_connections.py b/tests/test_ec2/test_vpn_connections.py new file mode 100644 index 000000000..645f4aa2c --- /dev/null +++ b/tests/test_ec2/test_vpn_connections.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_vpn_connections(): + pass diff --git a/tests/test_ec2/test_windows.py b/tests/test_ec2/test_windows.py new file mode 100644 index 000000000..f705e4f62 --- /dev/null +++ b/tests/test_ec2/test_windows.py @@ -0,0 +1,9 @@ +import boto +from sure import expect + +from moto import mock_ec2 + + +@mock_ec2 +def test_windows(): + pass