o ckF[x@sPdZddlmZddlmZGdddeZGdddeZGdd d eZd S) z) Represents an EC2 Spot Instance Request )TaggedEC2Object)LaunchSpecificationc@2eZdZdZd ddZddZddZd d ZdS) SpotInstanceStateFaultz The fault codes for the Spot Instance request, if any. :ivar code: The reason code for the Spot Instance state change. :ivar message: The message for the Spot Instance state change. NcCs||_||_dSNcodemessage)selfrr r >/usr/lib/python3/dist-packages/boto/ec2/spotinstancerequest.py__init__'s zSpotInstanceStateFault.__init__cCsd|j|jfS)Nz(%s, %s)rr r r r __repr__+szSpotInstanceStateFault.__repr__cCdSrr r nameattrs connectionr r r startElement.z#SpotInstanceStateFault.startElementcCs.|dkr||_n|dkr||_t|||dS)Nrr )rr setattrr rvaluerr r r endElement1s z!SpotInstanceStateFault.endElement)NN__name__ __module__ __qualname____doc__r rrrr r r r rs   rc@r) SpotInstanceStatusz Contains the status of a Spot Instance Request. :ivar code: Status code of the request. :ivar message: The description for the status code for the Spot request. :ivar update_time: Time the status was stated. NcCs||_||_||_dSr)r update_timer )r rr!r r r r r Bs zSpotInstanceStatus.__init__cC d|jS)Nz )rrr r r rG zSpotInstanceStatus.__repr__cCrrr rr r r rJrzSpotInstanceStatus.startElementcCs:|dkr ||_dS|dkr||_dS|dkr||_dSdS)Nrr updateTime)rr r!rr r r rMs   zSpotInstanceStatus.endElement)NNNrr r r r r 9s   r csHeZdZdZdfdd ZddZfddZd d Zdd d ZZ S)SpotInstanceRequesta :ivar id: The ID of the Spot Instance Request. :ivar price: The maximum hourly price for any Spot Instance launched to fulfill the request. :ivar type: The Spot Instance request type. :ivar state: The state of the Spot Instance request. :ivar fault: The fault codes for the Spot Instance request, if any. :ivar valid_from: The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled. :ivar valid_until: The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached. :ivar launch_group: The instance launch group. Launch groups are Spot Instances that launch together and terminate together. :ivar launched_availability_zone: foo :ivar product_description: The Availability Zone in which the bid is launched. :ivar availability_zone_group: The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone. :ivar create_time: The time stamp when the Spot Instance request was created. :ivar launch_specification: Additional information for launching instances. :ivar instance_id: The instance ID, if an instance has been launched to fulfill the Spot Instance request. :ivar status: The status code and status message describing the Spot Instance request. Ncsntt||d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_dSr)superr%r idpricetypestatefault valid_from valid_until launch_grouplaunched_availability_zoneproduct_descriptionavailability_zone_group create_timelaunch_specification instance_idstatus)r r __class__r r r zs  zSpotInstanceRequest.__init__cCr")NzSpotInstanceRequest:%s)r'rr r r rr#zSpotInstanceRequest.__repr__cshtt||||}|dur|S|dkrt||_|jS|dkr't|_|jS|dkr2t|_|jSdS)NlaunchSpecificationr+r5) r&r%rrr3rr+r r5)r rrrretvalr6r r rs z SpotInstanceRequest.startElementcCs|dkr ||_dS|dkrt||_dS|dkr||_dS|dkr&||_dS|dkr/||_dS|dkr8||_dS|dkrA||_dS|dkrJ||_dS|d krS||_ dS|d kr\||_ dS|d kre||_ dS|d krn||_ dSt |||dS) NspotInstanceRequestId spotPricer)r* validFrom validUntil launchGroupavailabilityZoneGrouplaunchedAvailabilityZone instanceId createTimeproductDescription)r'floatr(r)r*r,r-r.r1r/r4r2r0rrr r r rs2           zSpotInstanceRequest.endElementFcCs|jj|jg|ddS)N)dry_run)rcancel_spot_instance_requestsr')r rEr r r cancels zSpotInstanceRequest.cancelr)F) rrrrr rrrrG __classcell__r r r6r r%Vs# r%N) rboto.ec2.ec2objectrboto.ec2.launchspecificationrobjectrr r%r r r r s