vantage-client 0.0.1.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +111 -0
  4. data/Rakefile +8 -0
  5. data/docs/PingApi.md +53 -0
  6. data/docs/Price.md +14 -0
  7. data/docs/Prices.md +9 -0
  8. data/docs/PricesApi.md +323 -0
  9. data/docs/Product.md +12 -0
  10. data/docs/Products.md +9 -0
  11. data/docs/Provider.md +10 -0
  12. data/docs/Providers.md +9 -0
  13. data/docs/Service.md +11 -0
  14. data/docs/Services.md +9 -0
  15. data/git_push.sh +55 -0
  16. data/lib/vantage-client/api/ping_api.rb +66 -0
  17. data/lib/vantage-client/api/prices_api.rb +323 -0
  18. data/lib/vantage-client/api_client.rb +391 -0
  19. data/lib/vantage-client/api_error.rb +38 -0
  20. data/lib/vantage-client/configuration.rb +209 -0
  21. data/lib/vantage-client/models/price.rb +245 -0
  22. data/lib/vantage-client/models/prices.rb +196 -0
  23. data/lib/vantage-client/models/product.rb +225 -0
  24. data/lib/vantage-client/models/products.rb +196 -0
  25. data/lib/vantage-client/models/provider.rb +204 -0
  26. data/lib/vantage-client/models/providers.rb +196 -0
  27. data/lib/vantage-client/models/service.rb +214 -0
  28. data/lib/vantage-client/models/services.rb +196 -0
  29. data/lib/vantage-client/version.rb +15 -0
  30. data/lib/vantage-client.rb +49 -0
  31. data/spec/api/ping_api_spec.rb +45 -0
  32. data/spec/api/prices_api_spec.rb +103 -0
  33. data/spec/api_client_spec.rb +243 -0
  34. data/spec/configuration_spec.rb +42 -0
  35. data/spec/models/price_spec.rb +77 -0
  36. data/spec/models/prices_spec.rb +47 -0
  37. data/spec/models/product_spec.rb +65 -0
  38. data/spec/models/products_spec.rb +47 -0
  39. data/spec/models/provider_spec.rb +53 -0
  40. data/spec/models/providers_spec.rb +47 -0
  41. data/spec/models/service_spec.rb +59 -0
  42. data/spec/models/services_spec.rb +47 -0
  43. data/spec/spec_helper.rb +111 -0
  44. data/vantage-client-0.0.1.pre.gem +0 -0
  45. data/vantage-client.gemspec +46 -0
  46. metadata +300 -0
@@ -0,0 +1,66 @@
1
+ =begin
2
+ #Vantage
3
+
4
+ #Vantage API
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: support@vantage.sh
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module Vantage
16
+ class PingApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # This is a health check endpoint that can be used to determine Vantage API healthiness. It will return a 200 success with the raw text of \"pong\" if everything is running smoothly.
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [nil]
25
+ def ping(opts = {})
26
+ ping_with_http_info(opts)
27
+ nil
28
+ end
29
+
30
+ # This is a health check endpoint that can be used to determine Vantage API healthiness. It will return a 200 success with the raw text of \"pong\" if everything is running smoothly.
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
33
+ def ping_with_http_info(opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: PingApi.ping ...'
36
+ end
37
+ # resource path
38
+ local_var_path = '/v1/ping'
39
+
40
+ # query parameters
41
+ query_params = {}
42
+
43
+ # header parameters
44
+ header_params = {}
45
+ # HTTP header 'Accept' (if needed)
46
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
47
+
48
+ # form parameters
49
+ form_params = {}
50
+
51
+ # http body (model)
52
+ post_body = nil
53
+ auth_names = ['oauth2']
54
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
55
+ :header_params => header_params,
56
+ :query_params => query_params,
57
+ :form_params => form_params,
58
+ :body => post_body,
59
+ :auth_names => auth_names)
60
+ if @api_client.config.debugging
61
+ @api_client.config.logger.debug "API called: PingApi#ping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
62
+ end
63
+ return data, status_code, headers
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,323 @@
1
+ =begin
2
+ #Vantage
3
+
4
+ #Vantage API
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: support@vantage.sh
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module Vantage
16
+ class PricesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Returns a price
23
+ # @param product_id
24
+ # @param id Unique identifier of the price e.g. aws-ec2-m5d_16xlarge-eu_central_1-on_demand-linux_enterprise
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Price]
27
+ def get_price(product_id, id, opts = {})
28
+ data, _status_code, _headers = get_price_with_http_info(product_id, id, opts)
29
+ data
30
+ end
31
+
32
+ # Returns a price
33
+ # @param product_id
34
+ # @param id Unique identifier of the price e.g. aws-ec2-m5d_16xlarge-eu_central_1-on_demand-linux_enterprise
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Price, Fixnum, Hash)>] Price data, response status code and response headers
37
+ def get_price_with_http_info(product_id, id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: PricesApi.get_price ...'
40
+ end
41
+ # verify the required parameter 'product_id' is set
42
+ if @api_client.config.client_side_validation && product_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling PricesApi.get_price"
44
+ end
45
+ # verify the required parameter 'id' is set
46
+ if @api_client.config.client_side_validation && id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricesApi.get_price"
48
+ end
49
+ # resource path
50
+ local_var_path = '/v1/products/{product_id}/prices/{id}'.sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'id' + '}', id.to_s)
51
+
52
+ # query parameters
53
+ query_params = {}
54
+
55
+ # header parameters
56
+ header_params = {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = {}
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = ['oauth2']
66
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'Price')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: PricesApi#get_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ # Return available Prices across all Regions for a Product.
79
+ # @param product_id The Product ID that you wish to query prices for.
80
+ # @param [Hash] opts the optional parameters
81
+ # @return [Prices]
82
+ def get_prices(product_id, opts = {})
83
+ data, _status_code, _headers = get_prices_with_http_info(product_id, opts)
84
+ data
85
+ end
86
+
87
+ # Return available Prices across all Regions for a Product.
88
+ # @param product_id The Product ID that you wish to query prices for.
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [Array<(Prices, Fixnum, Hash)>] Prices data, response status code and response headers
91
+ def get_prices_with_http_info(product_id, opts = {})
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug 'Calling API: PricesApi.get_prices ...'
94
+ end
95
+ # verify the required parameter 'product_id' is set
96
+ if @api_client.config.client_side_validation && product_id.nil?
97
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling PricesApi.get_prices"
98
+ end
99
+ # resource path
100
+ local_var_path = '/v1/products/{product_id}/prices'.sub('{' + 'product_id' + '}', product_id.to_s)
101
+
102
+ # query parameters
103
+ query_params = {}
104
+
105
+ # header parameters
106
+ header_params = {}
107
+ # HTTP header 'Accept' (if needed)
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
109
+
110
+ # form parameters
111
+ form_params = {}
112
+
113
+ # http body (model)
114
+ post_body = nil
115
+ auth_names = ['oauth2']
116
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
117
+ :header_params => header_params,
118
+ :query_params => query_params,
119
+ :form_params => form_params,
120
+ :body => post_body,
121
+ :auth_names => auth_names,
122
+ :return_type => 'Prices')
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug "API called: PricesApi#get_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
125
+ end
126
+ return data, status_code, headers
127
+ end
128
+ # Return a product
129
+ # @param id Unique identifier of the product e.g. aws-ec2-m5d_16xlarge
130
+ # @param [Hash] opts the optional parameters
131
+ # @return [Product]
132
+ def get_product(id, opts = {})
133
+ data, _status_code, _headers = get_product_with_http_info(id, opts)
134
+ data
135
+ end
136
+
137
+ # Return a product
138
+ # @param id Unique identifier of the product e.g. aws-ec2-m5d_16xlarge
139
+ # @param [Hash] opts the optional parameters
140
+ # @return [Array<(Product, Fixnum, Hash)>] Product data, response status code and response headers
141
+ def get_product_with_http_info(id, opts = {})
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug 'Calling API: PricesApi.get_product ...'
144
+ end
145
+ # verify the required parameter 'id' is set
146
+ if @api_client.config.client_side_validation && id.nil?
147
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricesApi.get_product"
148
+ end
149
+ # resource path
150
+ local_var_path = '/v1/products/{id}'.sub('{' + 'id' + '}', id.to_s)
151
+
152
+ # query parameters
153
+ query_params = {}
154
+
155
+ # header parameters
156
+ header_params = {}
157
+ # HTTP header 'Accept' (if needed)
158
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
159
+
160
+ # form parameters
161
+ form_params = {}
162
+
163
+ # http body (model)
164
+ post_body = nil
165
+ auth_names = ['oauth2']
166
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
167
+ :header_params => header_params,
168
+ :query_params => query_params,
169
+ :form_params => form_params,
170
+ :body => post_body,
171
+ :auth_names => auth_names,
172
+ :return_type => 'Product')
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug "API called: PricesApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
175
+ end
176
+ return data, status_code, headers
177
+ end
178
+ # Return available Products for a Service. For example, with a Provider of AWS and a Service of EC2, Products will be a list of all EC2 Instances. By default, this endpoint returns all Products across all Services and Providers but has optional query parameters for filtering listed below.
179
+ # @param [Hash] opts the optional parameters
180
+ # @option opts [String] :provider_id Query by Provider to list all Products across all Services for a Provider. e.g. aws
181
+ # @option opts [String] :service_id Query by Service to list all Products for a specific provider service. e.g. aws-ec2
182
+ # @option opts [String] :name Query by name of the Product to see a list of products which match that name. e.g. m5a.16xlarge
183
+ # @return [Products]
184
+ def get_products(opts = {})
185
+ data, _status_code, _headers = get_products_with_http_info(opts)
186
+ data
187
+ end
188
+
189
+ # Return available Products for a Service. For example, with a Provider of AWS and a Service of EC2, Products will be a list of all EC2 Instances. By default, this endpoint returns all Products across all Services and Providers but has optional query parameters for filtering listed below.
190
+ # @param [Hash] opts the optional parameters
191
+ # @option opts [String] :provider_id Query by Provider to list all Products across all Services for a Provider. e.g. aws
192
+ # @option opts [String] :service_id Query by Service to list all Products for a specific provider service. e.g. aws-ec2
193
+ # @option opts [String] :name Query by name of the Product to see a list of products which match that name. e.g. m5a.16xlarge
194
+ # @return [Array<(Products, Fixnum, Hash)>] Products data, response status code and response headers
195
+ def get_products_with_http_info(opts = {})
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug 'Calling API: PricesApi.get_products ...'
198
+ end
199
+ # resource path
200
+ local_var_path = '/v1/products'
201
+
202
+ # query parameters
203
+ query_params = {}
204
+ query_params[:'provider_id'] = opts[:'provider_id'] if !opts[:'provider_id'].nil?
205
+ query_params[:'service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?
206
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
207
+
208
+ # header parameters
209
+ header_params = {}
210
+ # HTTP header 'Accept' (if needed)
211
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
212
+
213
+ # form parameters
214
+ form_params = {}
215
+
216
+ # http body (model)
217
+ post_body = nil
218
+ auth_names = ['oauth2']
219
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
220
+ :header_params => header_params,
221
+ :query_params => query_params,
222
+ :form_params => form_params,
223
+ :body => post_body,
224
+ :auth_names => auth_names,
225
+ :return_type => 'Products')
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: PricesApi#get_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+ # Providers are cloud infrastructure and service providers from which all cloud prices are derived. You can think of example Providers as being AWS, GCP, Cloudflare or Datadog. Currently, Vantage only supports a single provider of AWS but over time more will be added. Use this endpoint to retrieve a provider id for other API calls.
232
+ # @param [Hash] opts the optional parameters
233
+ # @return [Providers]
234
+ def get_providers(opts = {})
235
+ data, _status_code, _headers = get_providers_with_http_info(opts)
236
+ data
237
+ end
238
+
239
+ # Providers are cloud infrastructure and service providers from which all cloud prices are derived. You can think of example Providers as being AWS, GCP, Cloudflare or Datadog. Currently, Vantage only supports a single provider of AWS but over time more will be added. Use this endpoint to retrieve a provider id for other API calls.
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Array<(Providers, Fixnum, Hash)>] Providers data, response status code and response headers
242
+ def get_providers_with_http_info(opts = {})
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug 'Calling API: PricesApi.get_providers ...'
245
+ end
246
+ # resource path
247
+ local_var_path = '/v1/providers'
248
+
249
+ # query parameters
250
+ query_params = {}
251
+
252
+ # header parameters
253
+ header_params = {}
254
+ # HTTP header 'Accept' (if needed)
255
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
256
+
257
+ # form parameters
258
+ form_params = {}
259
+
260
+ # http body (model)
261
+ post_body = nil
262
+ auth_names = ['oauth2']
263
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => 'Providers')
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug "API called: PricesApi#get_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
+ end
273
+ return data, status_code, headers
274
+ end
275
+ # Return all Services. Examples of Services are EC2 for AWS. This endpoint will return all Services by default but you have the ability to filter Services by Provider using the optional query parameter documented below.
276
+ # @param [Hash] opts the optional parameters
277
+ # @option opts [String] :provider_id Query services for a specific provider. e.g. aws
278
+ # @return [Services]
279
+ def get_services(opts = {})
280
+ data, _status_code, _headers = get_services_with_http_info(opts)
281
+ data
282
+ end
283
+
284
+ # Return all Services. Examples of Services are EC2 for AWS. This endpoint will return all Services by default but you have the ability to filter Services by Provider using the optional query parameter documented below.
285
+ # @param [Hash] opts the optional parameters
286
+ # @option opts [String] :provider_id Query services for a specific provider. e.g. aws
287
+ # @return [Array<(Services, Fixnum, Hash)>] Services data, response status code and response headers
288
+ def get_services_with_http_info(opts = {})
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug 'Calling API: PricesApi.get_services ...'
291
+ end
292
+ # resource path
293
+ local_var_path = '/v1/services'
294
+
295
+ # query parameters
296
+ query_params = {}
297
+ query_params[:'provider_id'] = opts[:'provider_id'] if !opts[:'provider_id'].nil?
298
+
299
+ # header parameters
300
+ header_params = {}
301
+ # HTTP header 'Accept' (if needed)
302
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
303
+
304
+ # form parameters
305
+ form_params = {}
306
+
307
+ # http body (model)
308
+ post_body = nil
309
+ auth_names = ['oauth2']
310
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
311
+ :header_params => header_params,
312
+ :query_params => query_params,
313
+ :form_params => form_params,
314
+ :body => post_body,
315
+ :auth_names => auth_names,
316
+ :return_type => 'Services')
317
+ if @api_client.config.debugging
318
+ @api_client.config.logger.debug "API called: PricesApi#get_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
319
+ end
320
+ return data, status_code, headers
321
+ end
322
+ end
323
+ end