Coder Social home page Coder Social logo

Comments (3)

huskercane avatar huskercane commented on July 28, 2024

Scott thank you for the help.

did U fix the problem or U want me to make change?

Since I do not call any of this method

this is the code that runs into this error
require 'softlayer_api'
require 'pp'

@client = SoftLayer::Client.new
packages = SoftLayer::ProductPackage.bare_metal_server_packages(@client)

packages.each { |package| puts "#{package.id}\t#{package.name}" }

package_ids = packages.map &:id # { |pacakge| pacakge.id }

server and ram

File.open('/tmp/prices.txt', 'w') do |f|
package_ids.each do |packageid|
f.puts "\n============================"
f.puts packageid
f.puts '============================'
# packageid = package.id

sl_bm_package = SoftLayer::ProductPackage.package_with_id(packageid, @client)

# Now we need to now what ProductItemCategories are required to
# configure a server in that package. This code prints out a table
# of the required category codes with a description of each
f.puts "\nRequired Categories for '#{sl_bm_package.name}':"
required_categories = sl_bm_package.configuration.select { |x| x.name.to_s.downcase == 'server' || x.name.to_s.downcase == 'ram' }
# puts required_categories.size()
# pp required_categories

required_categories.each do |category|
  config_options = category.configuration_options
  f.puts "\nConfiguration options in the '#{category.name}' category:"
  config_options.each { |option| f.printf "%5s\t#{option.description}\n", option.price_id }
end
f.fsync

end
end

code print out all packages and cpu/ram details

from softlayer-ruby.

SLsthompson avatar SLsthompson commented on July 28, 2024

I apologize. I had responded while looking at an older version of the code. Then I realized my mistake and deleted my comment. Then I fixed the problem and released a 3.1.1 release with the fix. If you gem update softlayer_api, you should get the 3.1.1 build with the bug fix.

from softlayer-ruby.

huskercane avatar huskercane commented on July 28, 2024

As always you are great

yep it did fix problem that I encountered. Thank you

from softlayer-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.