ó ¡ôXc@s„ddlZddlZddlmZmZddlmZddlm Z m Z m Z ddl m Z de fd„ƒYZdS(iÿÿÿÿN(tArgtMutuallyExclusiveArgList(t ArgumentError(tec2_block_device_mappingt flexible_boolt vpc_interface(t EC2Requestt RunInstancesc"Bs˜eZdZedddddƒedddd dd d d d dddƒeddddd gd dddƒeddddddddƒeeddddd dddƒedddd dddƒedd dd!d ddd"ƒƒed#dd$d%d‚dd(ƒed)d*dd+dd,ƒed-d.dd/dd0ƒed1dd2dd3dd4ƒed5dd6dd7dd8ƒed9d:dd;dd<ddd=ed gdd>ƒed?d@ddAddBdCdDddEƒedFddGddBdCdDddHƒedIddJd%dƒddMƒedNddOddPddQƒedRddSd%d„ddUƒedVddWddXddYƒedZd[dd\d ddd]ƒed^d=ed ddd_ƒed`ddad dddbƒeedcddddaddd dddeƒedfdgddhd=ed dddiƒƒedjdkddlddmddd=e ddnƒedodpddqd dddrƒedsddtddBdCdDdduƒgZ dvdwdxdydzd{d|d}gZ d~„Z d„Z d€„ZRS(…s#Launch instances of a machine imagetImageIdtmetavartIMAGEthelps)ID of the image to instantiate (required)s-ns--instance-counttdesttcounts MIN[-MAX]tdefaultt1troute_tosGnumber of instances to launch. If this number of instances cannot be launched, no instances will launch. If specified as a range (min-max), the server will attempt to launch the maximum number, but no fewer than the minimum number.s-gs--grouptactiontappends2security group(s) in which to launch the instancess-ks--keytKeyNametKEYPAIRsname of the key pair to uses-ds --user-datatDATAsXuser data to make available to instances in this reservations--user-data-forcesdsame as -d/--user-data, but without checking if a file by that name exists firsts-fs--user-data-filetFILEsdfile containing user data to make available to the instances in this reservations --addressingtAddressingTypetchoicestpublictprivates¨[Eucalyptus only, non-VPC only] addressing scheme to launch the instance with. Use "private" to run an instance with no public address.s-ts--instance-typet InstanceTypestype of instance to launchs-zs--availability-zonetZONEsPlacement.AvailabilityZones--kerneltKernelIdtKERNELs/ID of the kernel to launch the instance(s) withs --ramdiskt RamdiskIdtRAMDISKs0ID of the ramdisk to launch the instance(s) withs-bs--block-device-mappings DEVICE=MAPPEDtBlockDeviceMappingttypesãdefine a block device mapping for the instances, in the form DEVICE=MAPPED, where "MAPPED" is "none", "ephemeral(0-3)", or "[SNAP-ID]:[GiB]:[true|false]:[standard|VOLTYPE[:IOPS]]"s-ms --monitorsMonitoring.Enabledt store_consttconstttrues.enable detailed monitoring for the instance(s)s--disable-api-terminationtDisableApiTerminations2prevent API users from terminating the instance(s)s&--instance-initiated-shutdown-behaviort!InstanceInitiatedShutdownBehaviortstopt terminatesJwhether to "stop" (default) or terminate EBS instances when they shut downs--placement-groupsPlacement.GroupNametPLGROUPs8name of a placement group to launch intos --tenancysPlacement.Tenancyt dedicatedsG[VPC only] "dedicated" to run on single-tenant hardwares--client-tokent ClientTokentTOKENs/unique identifier to ensure request idempotencys-ss--subnettSUBNETsO[VPC only] subnet to create the instance's network interface ins--associate-public-ip-addresssh[VPC only] whether or not to assign a public address to the instance's network interfaces--private-ip-addresstADDRESSsb[VPC only] assign a specific primary private IP address to an instance's interfaces--secondary-addresss--secondary-private-ip-addresssÂ[VPC only] assign a specific secondary private IP address to an instance's network interface. Use this option multiple times to add additional addresses.s--secondary-counts$--secondary-private-ip-address-counttCOUNTsž[VPC only] automatically assign a specific number of secondary private IP addresses to an instance's network interfaces-as--network-interfacetNetworkInterfacet INTERFACEsn[VPC only] add a network interface to the new instance. If the interface already exists, supply its ID and a numeric index for it, separated by ":", in the form "eni-NNNNNNNN:INDEX". To create a new interface, supply a numeric index and subnet ID for it, along with (in order) an optional description, a primary private IP address, a list of security group IDs to associate with the interface, whether to delete the interface upon instance termination ("true" or "false"), a number of secondary private IP addresses to create automatically, and a list of secondary private IP addresses to assign to the interface, separated by ":", in the form ":INDEX:SUBNET:[DESCRIPTION]:[PRIV_IP]:[GROUP1,GROUP2,...]:[true|false]:[SEC_IP_COUNT|:SEC_IP1,SEC_IP2,...]". You cannot specify both of the latter two. This option may be used multiple times. Each adds another network interface.s-ps --iam-profiletIPROFILEs]name or ARN of the IAM instance profile to associate with the new instance(s)s--ebs-optimizedt EbsOptimizeds(optimize the new instance(s) for EBS I/OtreservationSett instancesSettgroupSetttagSettblockDeviceMappingt productCodestnetworkInterfaceSettprivateIpAddressesSetcCs@tj|ƒ|jjdƒrgtjj|jdƒrGtdƒ‚qætj |jdƒ|j d MaxCount; swappingt iam_profilesarn:sIamInstanceProfile.ArnsIamInstanceProfile.NametsubnetR1tassociate_public_ip_addresstgroupssg-sBargument -g/--group: groups must be specified by ID when using VPCtSecurityGroupIdtAssociatePublicIpAddresstprivate_ip_addresstPrivateIpAddressR%tPrimarytPrivateIpAddressestsecondary_addresstsecondary_counttSecondaryPrivateIpAddressCounttSubnetIdt DeviceIndexs-built network interface from CLI options: {0}t SecurityGroup(RBtsplittlentintRIt ValueErrorRROtdebugtupdateRCt startswithRLt setdefaultRtextendtformat(RQtcountstiprofilet cli_ifaceRYtaddrtsec_ipst sec_ip_count((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/runinstances.pyt preprocess´s€   &$$     cCs|j|ƒdS(N(tprint_reservation(RQtresult((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/runinstances.pyt print_result sN(RR(sstopR)(RR+(t__name__t __module__t DESCRIPTIONRRLRRRRhRtARGSt LIST_TAGSRARvRy(((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/runinstances.pyR%sœ                V(RGtos.pathRDtrequestbuilderRRtrequestbuilder.exceptionsRteuca2ools.commands.argtypesRRRteuca2ools.commands.ec2RR(((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/runinstances.pyts