Этот код C # предоставит вам список зарезервированных вами экземпляров:
AmazonEC2 ec2 = AWSClientFactory.CreateAmazonEC2Client(
accessKey,
secretAccessKey
);
DescribeReservedInstancesRequest request = new DescribeReservedInstancesRequest();
try
{
DescribeReservedInstancesResponse response = ec2.DescribeReservedInstances(request);
foreach (ReservedInstances ri in response.DescribeReservedInstancesResult.ReservedInstances)
{
Console.WriteLine(ri.ReservedInstancesId + "\t" + ri.InstanceType + "\t" + ri.InstanceCount.ToString() + "\t" + ri.PurchaseState);
}
}
catch (AmazonEC2Exception ex)
{
Console.WriteLine("Caught Exception: " + ex.Message);
Console.WriteLine("Response Status Code: " + ex.StatusCode);
Console.WriteLine("Error Code: " + ex.ErrorCode);
Console.WriteLine("Error Type: " + ex.ErrorType);
Console.WriteLine("Request ID: " + ex.RequestId);
Console.WriteLine("XML: " + ex.XML);
}