The title says the problem.
I'm requesting a spot instance with boto like so (aws key and secret key are environment vars set in ~/.boto):
import boto
conn = boto.connect_ec2()
type(conn)
> boto.ec2.connection.EC2Connection
response = conn.request_spot_instances(**params)
type(response)
> boto.resultset.ResultSet
params has values for price, image_id, instance_type, and placement.
This is where the library deviates from its documentation. As you can see in the boto docs, request_spot_instances() is supposed to return boto.ec2.spotinstancerequest.SpotInstanceRequest, but it returns boto.resultset.ResultSet.
There are no methods to get the request id for boto.resultset.ResultSet, which is what I'm really after. I dont want to parse the value that's returned from printing response, but I can't find a gooed way to get to it in the docs.
print(response)
> [SpotInstanceRequest:sir-xxxxxxx]
Aucun commentaire:
Enregistrer un commentaire