class Vantage::PricesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/vantage-client/api/prices_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_price(product_id, id, opts = {}) click to toggle source

Returns a price @param product_id @param id @param [Hash] opts the optional parameters @return [Price]

# File lib/vantage-client/api/prices_api.rb, line 27
def get_price(product_id, id, opts = {})
  data, _status_code, _headers = get_price_with_http_info(product_id, id, opts)
  data
end
get_price_with_http_info(product_id, id, opts = {}) click to toggle source

Returns a price @param product_id @param id @param [Hash] opts the optional parameters @return [Array<(Price, Fixnum, Hash)>] Price data, response status code and response headers

# File lib/vantage-client/api/prices_api.rb, line 37
def get_price_with_http_info(product_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PricesApi.get_price ...'
  end
  # verify the required parameter 'product_id' is set
  if @api_client.config.client_side_validation && product_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_id' when calling PricesApi.get_price"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PricesApi.get_price"
  end
  # resource path
  local_var_path = '/v1/products/{product_id}/prices/{id}'.sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Price')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PricesApi#get_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_prices(product_id, opts = {}) click to toggle source

Return available Prices across all Regions for a Product. @param product_id @param [Hash] opts the optional parameters @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Prices]

# File lib/vantage-client/api/prices_api.rb, line 84
def get_prices(product_id, opts = {})
  data, _status_code, _headers = get_prices_with_http_info(product_id, opts)
  data
end
get_prices_with_http_info(product_id, opts = {}) click to toggle source

Return available Prices across all Regions for a Product. @param product_id @param [Hash] opts the optional parameters @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Array<(Prices, Fixnum, Hash)>] Prices data, response status code and response headers

# File lib/vantage-client/api/prices_api.rb, line 95
def get_prices_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PricesApi.get_prices ...'
  end
  # verify the required parameter 'product_id' is set
  if @api_client.config.client_side_validation && product_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_id' when calling PricesApi.get_prices"
  end
  # resource path
  local_var_path = '/v1/products/{product_id}/prices'.sub('{' + 'product_id' + '}', product_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Prices')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PricesApi#get_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_product(id, opts = {}) click to toggle source

Return a product @param id @param [Hash] opts the optional parameters @return [Product]

# File lib/vantage-client/api/prices_api.rb, line 138
def get_product(id, opts = {})
  data, _status_code, _headers = get_product_with_http_info(id, opts)
  data
end
get_product_with_http_info(id, opts = {}) click to toggle source

Return a product @param id @param [Hash] opts the optional parameters @return [Array<(Product, Fixnum, Hash)>] Product data, response status code and response headers

# File lib/vantage-client/api/prices_api.rb, line 147
def get_product_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PricesApi.get_product ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PricesApi.get_product"
  end
  # resource path
  local_var_path = '/v1/products/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Product')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PricesApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_products(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [String] :provider_id Query by Provider to list all Products across all Services for a Provider. e.g. aws @option opts [String] :service_id Query by Service to list all Products for a specific provider service. e.g. aws-ec2 @option opts [String] :name Query by name of the Product to see a list of products which match that name. e.g. m5a.16xlarge @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Products]

# File lib/vantage-client/api/prices_api.rb, line 192
def get_products(opts = {})
  data, _status_code, _headers = get_products_with_http_info(opts)
  data
end
get_products_with_http_info(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [String] :provider_id Query by Provider to list all Products across all Services for a Provider. e.g. aws @option opts [String] :service_id Query by Service to list all Products for a specific provider service. e.g. aws-ec2 @option opts [String] :name Query by name of the Product to see a list of products which match that name. e.g. m5a.16xlarge @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Array<(Products, Fixnum, Hash)>] Products data, response status code and response headers

# File lib/vantage-client/api/prices_api.rb, line 205
def get_products_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PricesApi.get_products ...'
  end
  # resource path
  local_var_path = '/v1/products'

  # query parameters
  query_params = {}
  query_params[:'provider_id'] = opts[:'provider_id'] if !opts[:'provider_id'].nil?
  query_params[:'service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Products')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PricesApi#get_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_providers(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Providers]

# File lib/vantage-client/api/prices_api.rb, line 248
def get_providers(opts = {})
  data, _status_code, _headers = get_providers_with_http_info(opts)
  data
end
get_providers_with_http_info(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Array<(Providers, Fixnum, Hash)>] Providers data, response status code and response headers

# File lib/vantage-client/api/prices_api.rb, line 258
def get_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PricesApi.get_providers ...'
  end
  # resource path
  local_var_path = '/v1/providers'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Providers')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PricesApi#get_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_services(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [String] :provider_id Query services for a specific provider. e.g. aws @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Services]

# File lib/vantage-client/api/prices_api.rb, line 299
def get_services(opts = {})
  data, _status_code, _headers = get_services_with_http_info(opts)
  data
end
get_services_with_http_info(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [String] :provider_id Query services for a specific provider. e.g. aws @option opts [Integer] :page The page of results to return. @option opts [Integer] :limit The amount of results to return. The maximum is 1000 @return [Array<(Services, Fixnum, Hash)>] Services data, response status code and response headers

# File lib/vantage-client/api/prices_api.rb, line 310
def get_services_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PricesApi.get_services ...'
  end
  # resource path
  local_var_path = '/v1/services'

  # query parameters
  query_params = {}
  query_params[:'provider_id'] = opts[:'provider_id'] if !opts[:'provider_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Services')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PricesApi#get_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end