-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_DescribeReservedInstancesOfferings.go
273 lines (234 loc) · 10.7 KB
/
api_op_DescribeReservedInstancesOfferings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Contains the parameters for DescribeReservedInstancesOfferings.
type DescribeReservedInstancesOfferingsInput struct {
_ struct{} `type:"structure"`
// The Availability Zone in which the Reserved Instance can be used.
AvailabilityZone *string `type:"string"`
// Checks whether you have the required permissions for the action, without
// actually making the request, and provides an error response. If you have
// the required permissions, the error response is DryRunOperation. Otherwise,
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
// One or more filters.
//
// * availability-zone - The Availability Zone where the Reserved Instance
// can be used.
//
// * duration - The duration of the Reserved Instance (for example, one year
// or three years), in seconds (31536000 | 94608000).
//
// * fixed-price - The purchase price of the Reserved Instance (for example,
// 9800.0).
//
// * instance-type - The instance type that is covered by the reservation.
//
// * marketplace - Set to true to show only Reserved Instance Marketplace
// offerings. When this filter is not used, which is the default behavior,
// all offerings from both AWS and the Reserved Instance Marketplace are
// listed.
//
// * product-description - The Reserved Instance product platform description.
// Instances that include (Amazon VPC) in the product platform description
// will only be displayed to EC2-Classic account holders and are for use
// with Amazon VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux |
// SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise
// Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL
// Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows
// with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows
// with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon
// VPC))
//
// * reserved-instances-offering-id - The Reserved Instances offering ID.
//
// * scope - The scope of the Reserved Instance (Availability Zone or Region).
//
// * usage-price - The usage price of the Reserved Instance, per hour (for
// example, 0.84).
Filters []Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// Include Reserved Instance Marketplace offerings in the response.
IncludeMarketplace *bool `type:"boolean"`
// The tenancy of the instances covered by the reservation. A Reserved Instance
// with a tenancy of dedicated is applied to instances that run in a VPC on
// single-tenant hardware (i.e., Dedicated Instances).
//
// Important: The host value cannot be used with this parameter. Use the default
// or dedicated values only.
//
// Default: default
InstanceTenancy Tenancy `locationName:"instanceTenancy" type:"string" enum:"true"`
// The instance type that the reservation will cover (for example, m1.small).
// For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
// in the Amazon Elastic Compute Cloud User Guide.
InstanceType InstanceType `type:"string" enum:"true"`
// The maximum duration (in seconds) to filter when searching for offerings.
//
// Default: 94608000 (3 years)
MaxDuration *int64 `type:"long"`
// The maximum number of instances to filter when searching for offerings.
//
// Default: 20
MaxInstanceCount *int64 `type:"integer"`
// The maximum number of results to return for the request in a single page.
// The remaining results of the initial request can be seen by sending another
// request with the returned NextToken value. The maximum is 100.
//
// Default: 100
MaxResults *int64 `locationName:"maxResults" type:"integer"`
// The minimum duration (in seconds) to filter when searching for offerings.
//
// Default: 2592000 (1 month)
MinDuration *int64 `type:"long"`
// The token to retrieve the next page of results.
NextToken *string `locationName:"nextToken" type:"string"`
// The offering class of the Reserved Instance. Can be standard or convertible.
OfferingClass OfferingClassType `type:"string" enum:"true"`
// The Reserved Instance offering type. If you are using tools that predate
// the 2011-11-01 API version, you only have access to the Medium Utilization
// Reserved Instance offering type.
OfferingType OfferingTypeValues `locationName:"offeringType" type:"string" enum:"true"`
// The Reserved Instance product platform description. Instances that include
// (Amazon VPC) in the description are for use with Amazon VPC.
ProductDescription RIProductDescription `type:"string" enum:"true"`
// One or more Reserved Instances offering IDs.
ReservedInstancesOfferingIds []string `locationName:"ReservedInstancesOfferingId" type:"list"`
}
// String returns the string representation
func (s DescribeReservedInstancesOfferingsInput) String() string {
return awsutil.Prettify(s)
}
// Contains the output of DescribeReservedInstancesOfferings.
type DescribeReservedInstancesOfferingsOutput struct {
_ struct{} `type:"structure"`
// The token to use to retrieve the next page of results. This value is null
// when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
// A list of Reserved Instances offerings.
ReservedInstancesOfferings []ReservedInstancesOffering `locationName:"reservedInstancesOfferingsSet" locationNameList:"item" type:"list"`
}
// String returns the string representation
func (s DescribeReservedInstancesOfferingsOutput) String() string {
return awsutil.Prettify(s)
}
const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings"
// DescribeReservedInstancesOfferingsRequest returns a request value for making API operation for
// Amazon Elastic Compute Cloud.
//
// Describes Reserved Instance offerings that are available for purchase. With
// Reserved Instances, you purchase the right to launch instances for a period
// of time. During that time period, you do not receive insufficient capacity
// errors, and you pay a lower usage rate than the rate charged for On-Demand
// instances for the actual time used.
//
// If you have listed your own Reserved Instances for sale in the Reserved Instance
// Marketplace, they will be excluded from these results. This is to ensure
// that you do not purchase your own Reserved Instances.
//
// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// // Example sending a request using DescribeReservedInstancesOfferingsRequest.
// req := client.DescribeReservedInstancesOfferingsRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings
func (c *Client) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) DescribeReservedInstancesOfferingsRequest {
op := &aws.Operation{
Name: opDescribeReservedInstancesOfferings,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeReservedInstancesOfferingsInput{}
}
req := c.newRequest(op, input, &DescribeReservedInstancesOfferingsOutput{})
return DescribeReservedInstancesOfferingsRequest{Request: req, Input: input, Copy: c.DescribeReservedInstancesOfferingsRequest}
}
// DescribeReservedInstancesOfferingsRequest is the request type for the
// DescribeReservedInstancesOfferings API operation.
type DescribeReservedInstancesOfferingsRequest struct {
*aws.Request
Input *DescribeReservedInstancesOfferingsInput
Copy func(*DescribeReservedInstancesOfferingsInput) DescribeReservedInstancesOfferingsRequest
}
// Send marshals and sends the DescribeReservedInstancesOfferings API request.
func (r DescribeReservedInstancesOfferingsRequest) Send(ctx context.Context) (*DescribeReservedInstancesOfferingsResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &DescribeReservedInstancesOfferingsResponse{
DescribeReservedInstancesOfferingsOutput: r.Request.Data.(*DescribeReservedInstancesOfferingsOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// NewDescribeReservedInstancesOfferingsRequestPaginator returns a paginator for DescribeReservedInstancesOfferings.
// Use Next method to get the next page, and CurrentPage to get the current
// response page from the paginator. Next will return false, if there are
// no more pages, or an error was encountered.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over pages.
// req := client.DescribeReservedInstancesOfferingsRequest(input)
// p := ec2.NewDescribeReservedInstancesOfferingsRequestPaginator(req)
//
// for p.Next(context.TODO()) {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func NewDescribeReservedInstancesOfferingsPaginator(req DescribeReservedInstancesOfferingsRequest) DescribeReservedInstancesOfferingsPaginator {
return DescribeReservedInstancesOfferingsPaginator{
Pager: aws.Pager{
NewRequest: func(ctx context.Context) (*aws.Request, error) {
var inCpy *DescribeReservedInstancesOfferingsInput
if req.Input != nil {
tmp := *req.Input
inCpy = &tmp
}
newReq := req.Copy(inCpy)
newReq.SetContext(ctx)
return newReq.Request, nil
},
},
}
}
// DescribeReservedInstancesOfferingsPaginator is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type DescribeReservedInstancesOfferingsPaginator struct {
aws.Pager
}
func (p *DescribeReservedInstancesOfferingsPaginator) CurrentPage() *DescribeReservedInstancesOfferingsOutput {
return p.Pager.CurrentPage().(*DescribeReservedInstancesOfferingsOutput)
}
// DescribeReservedInstancesOfferingsResponse is the response type for the
// DescribeReservedInstancesOfferings API operation.
type DescribeReservedInstancesOfferingsResponse struct {
*DescribeReservedInstancesOfferingsOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// DescribeReservedInstancesOfferings request.
func (r *DescribeReservedInstancesOfferingsResponse) SDKResponseMetdata() *aws.Response {
return r.response
}