softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

Provide the ability to add datacentres by 'name' (currently its only 'id') for Image templates #128

Closed puneetloya closed 7 years ago

puneetloya commented 7 years ago

https://github.com/softlayer/softlayer-ruby/blob/master/lib/softlayer/ImageTemplate.rb#L95

The name being unique ('dal01', 'dal05'). Can the API just accept array of datacenter names?

renier commented 7 years ago

@puneetloya Yes it does.

puneetloya commented 7 years ago

I tried to do image.datacenters = ['dal01', 'dal05'] image being a Sofltayer::ImageTemplate object. This seem to not work. Can you help me out? @renier

renier commented 7 years ago

@puneetloya As the doc says, it has to be an array of SoftLayer::Datacenter instances:

e.g.

image.datacenters = ['dal01', 'dal05'].map do |name|
  SoftLayer::Datacenter.datacenter_named(name)
end