VM::EC...stance(3pm)
VM::EC2::REST::reserved_instance π
okay bestie, so this is VM::EC2::REST::reserved_instance (the 3pm one, iykyk) and it's literally all about describing, purchasing and using Reserved Instances β¨ no cap.
β¨ SYNOPSIS β¨
use VM::EC2 ':misc'
that's it. that's the whole vibe. π
π METHODS π
so these methods are the main characters for describing, purchasing and using Reserved Instances. slay.
Implemented: β
CancelReservedInstancesListing
DescribeReservedInstances
DescribeReservedInstancesListings
DescribeReservedInstancesModifications
DescribeReservedInstancesOfferings
ModifyReservedInstances
PurchaseReservedInstancesOffering
CreateReservedInstancesListing
Unimplemented: π
(none)
not a single one missing, we ate and left no crumbs fr fr.
@offerings = $ec2->describe_reserved_instances_offerings(@offering_ids)
@offerings = $ec2->describe_reserved_instances_offerings(%args)
This one hands you back a list of the reserved instance offerings that are available to purchase right now. The arguments let you filter the offerings with a whole bunch of filters, okay?
All arguments are optional, bestie. If you don't pass any named arguments, then the arguments get treated as Reserved Instance Offering IDs. π¦
-reserved_instances_offering_idβ A scalar or arrayref of reserved instance offering IDs-instance_typeβ The instance type on which the reserved instance can be used, e.g."c1.medium"-availability_zone,-zoneβ The availability zone in which the reserved instance can be used.-product_descriptionβ The reserved instance description. Valid values are"Linux/UNIX","Linux/UNIX (Amazon VPC)","Windows", and"Windows (Amazon VPC)"-instance_tenancyβ The tenancy of the reserved instance offering, either"default"or"dedicated". (VPC instances only)-offering_typeβ The reserved instance offering type, one of"Heavy Utilization","Medium Utilization", or"Light Utilization".-filterβ A set of filters to apply.
For available filters, see http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesOfferings.html.
The returned objects are of type VM::EC2::ReservedInstance::Offering π
This can be combined with the Offering purchase() method, like this lil combo here:
@offerings = $ec2->describe_reserved_instances_offerings(
{'availability-zone' => 'us-east-1a',
'instance-type' => 'c1.medium',
'product-description' =>'Linux/UNIX',
'duration' => 31536000, # this is 1 year
});
$offerings[0]->purchase(5) and print "Five reserved instances purchased\n";
the # this is 1 year comment is doing so much heavy lifting there, iconic. π₯
$id = $ec2->purchase_reserved_instances_offering($offering_id)
$id = $ec2->purchase_reserved_instances_offering(%args)
Purchase one or more reserved instances based on an offering. πΈ
Arguments:
-reserved_instances_offering_id,-idβ The reserved instance offering ID to purchase (required).-instance_count,-countβ Number of instances to reserve under this offer (optional, defaults to1).
Returns a Reserved Instances Id on success, undef on failure. Also see the purchase() method of VM::EC2::ReservedInstance::Offering. π
@res_instances = $ec2->describe_reserved_instances(@res_instance_ids)
@res_instances = $ec2->describe_reserved_instances(%args)
This method returns a list of the reserved instances that you currently own. The info you get back includes the type of instances that the reservation allows you to launch, the availability zone, and the cost per hour to run those reserved instances. π«Ά
All arguments are optional. If no named arguments are used, then the arguments are treated as Reserved Instance IDs.
-reserved_instances_idβ A scalar or arrayref of reserved instance IDs-filterβ A set of filters to apply.
For available filters, see http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstances.html.
The returned objects are of type VM::EC2::ReservedInstance πΈ
$id = $ec2->modify_reserved_instances(%args)
Modifies the Availability Zone, instance count, instance type, or network platform (EC2-Classic or EC2-VPC) of your Reserved Instances. β¨ The Reserved Instances to be modified must be identical, except for Availability Zone, network platform, and instance type.
Required arguments:
-reserved_instances_idβ The IDs of the Reserved Instances to modify. Can be scalar or arrayref.-target_configurationβ The configuration settings for the Reserved Instances to modify.
Must be a hashref or arrayref of hashes with one or more of the following values:
AvailabilityZone, Platform, InstanceType
The following is also REQUIRED:
InstanceCount
-idβ Alias for-reserved_instances_id
Returns the reserved instances modification ID string. π«
@mods = $ec2->describe_reserved_instances_modifications(@ids)
@mods = $ec2->describe_reserved_instances_modifications(%args)
Describes the modifications made to your Reserved Instances. π§
All arguments are optional. If no named arguments are used, then the arguments are treated as Reserved Instance Modification IDs.
-reserved_instances_modification_idβ A scalar or arrayref of reserved instance modification IDs-filterβ A set of filters to apply.-idβ Alias for-reserved_instances_modification_id
For available filters, see: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesModifications.html
The returned objects are of type VM::EC2::ReservedInstance::Modification β
@list = $ec2->describe_reserved_instances_listings(%args)
Describes the account's Reserved Instance listings in the Reserved Instance Marketplace. ποΈ
All arguments are optional. If no named arguments are used, then the arguments are treated as Reserved Instance Listing IDs.
-reserved_instances_listing_idβ A scalar or arrayref of reserved instance listing IDs-reserved_instances_idβ A scalar or arrayref of reserved instance IDs-filterβ A set of filters to apply.
For available filters, see: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesListings.html
The returned objects are of type VM::EC2::ReservedInstance::Listing π
$listing = $ec2->cancel_reserved_instances_listing(%args)
Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace. π (rip to that listing)
Required arguments:
-reserved_instances_listing_idβ The ID of the Reserved Instance listing to be canceled
Returns an object of type VM::EC2::ReservedInstance::Listing
$listing = $ec2->create_reserved_instances_listing(%args)
Creates a listing for Amazon EC2 Reserved Instances to be sold in the Reserved Instance Marketplace. π° Only one Reserved Instance listing may be created at a time.
Required arguments:
-reserved_instances_idβ The ID of the active Reserved Instance-instance_countβ The number of instances to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified-price_schedulesβ hashref containing term/price pairs for months the Reserved Instance has remaining in its term
For example, with a RI with 11 months to go:
{ 11 => 2.5,
8 => 2.0,
5 => 1.5,
3 => 0.7,
1 => 0.1 }
For months 11,10,9 the price is $2.50, 8,7,6 is $2.00, 5,4 is $1.50, 3,2 is $0.70 and the last month is $0.10.
For more details, see the API docs at: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateReservedInstancesListing.html
-client_tokenβ Unique, case-sensitive identifier to ensure idempotency of listings
Returns an object of type VM::EC2::ReservedInstance::Listing π
π SEE ALSO π
VM::EC2
π«Ά AUTHOR π«Ά
Lincoln Stein <lincoln.stein@gmail.com>.
Lance Kinley <lkinley@loyaltymethods.com>.
Copyright (c) 2011 Ontario Institute for Cancer Research
Copyright (c) 2014 Loyalty Methods, Inc.
This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.
bestie this isperl v5.38.2, dated2024-08-10, and that's the wholeVM::EC2::REST::reserved_instancepage π mwah, go reserve something responsibly, ily π¦β¨
π¦ where this page comes from
- debian trixie: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu resolute: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu stonking: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms