softlayer_api 3.0.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.textile +3 -0
- data/lib/softlayer/Account.rb +85 -8
- data/lib/softlayer/AccountPassword.rb +49 -49
- data/lib/softlayer/BareMetalServer.rb +33 -43
- data/lib/softlayer/BareMetalServerOrder.rb +17 -8
- data/lib/softlayer/BareMetalServerOrder_Package.rb +25 -7
- data/lib/softlayer/Client.rb +7 -7
- data/lib/softlayer/Config.rb +105 -49
- data/lib/softlayer/Datacenter.rb +10 -2
- data/lib/softlayer/DynamicAttribute.rb +1 -1
- data/lib/softlayer/ImageTemplate.rb +44 -61
- data/lib/softlayer/ModelBase.rb +2 -2
- data/lib/softlayer/NetworkComponent.rb +25 -3
- data/lib/softlayer/NetworkMessageDelivery.rb +25 -5
- data/lib/softlayer/NetworkMonitor.rb +333 -0
- data/lib/softlayer/NetworkService.rb +6 -4
- data/lib/softlayer/NetworkStorage.rb +42 -29
- data/lib/softlayer/NetworkStorageAllowedHost.rb +9 -3
- data/lib/softlayer/NetworkStorageCredential.rb +44 -29
- data/lib/softlayer/NetworkStorageGroup.rb +42 -10
- data/lib/softlayer/ObjectFilter.rb +54 -4
- data/lib/softlayer/ObjectMaskParser.rb +1 -1
- data/lib/softlayer/ProductItemCategory.rb +34 -5
- data/lib/softlayer/ProductPackage.rb +11 -7
- data/lib/softlayer/Server.rb +77 -5
- data/lib/softlayer/ServerFirewall.rb +12 -11
- data/lib/softlayer/Service.rb +1 -1
- data/lib/softlayer/Software.rb +35 -50
- data/lib/softlayer/SoftwarePassword.rb +92 -107
- data/lib/softlayer/Ticket.rb +37 -28
- data/lib/softlayer/UserCustomer.rb +56 -13
- data/lib/softlayer/UserCustomerExternalBinding.rb +18 -5
- data/lib/softlayer/VLANFirewall.rb +40 -9
- data/lib/softlayer/VLANFirewallOrder.rb +1 -1
- data/lib/softlayer/VirtualDiskImage.rb +38 -10
- data/lib/softlayer/VirtualServer.rb +75 -48
- data/lib/softlayer/VirtualServerOrder.rb +15 -8
- data/lib/softlayer/VirtualServerOrder_Package.rb +25 -7
- data/lib/softlayer/VirtualServerUpgradeOrder.rb +1 -1
- data/lib/softlayer/base.rb +1 -1
- data/lib/softlayer/object_mask_helpers.rb +1 -1
- data/lib/softlayer_api.rb +2 -0
- metadata +4 -3
@@ -84,6 +84,12 @@ module SoftLayer
|
|
84
84
|
attr_accessor :private_vlan_id
|
85
85
|
|
86
86
|
# String, The URI of a post provisioning script to run on this server once it is created
|
87
|
+
attr_accessor :provision_script_uri
|
88
|
+
|
89
|
+
# String, The URI of a post provisioning script to run on this server once it is created
|
90
|
+
#
|
91
|
+
# DEPRECATION WARNING: This attribute is deprecated in favor of provision_script_uri
|
92
|
+
# and will be removed in the next major release.
|
87
93
|
attr_accessor :provision_script_URI
|
88
94
|
|
89
95
|
# Integer, The id of the public VLAN this server should join
|
@@ -102,7 +108,7 @@ module SoftLayer
|
|
102
108
|
# Corresponds to +primaryBackendNetworkComponent.networkVlan.id+ in the +createObject+ documentation
|
103
109
|
attr_accessor :user_metadata
|
104
110
|
|
105
|
-
# Create a new order that works
|
111
|
+
# Create a new order that works through the given client connection
|
106
112
|
def initialize (client = nil)
|
107
113
|
@softlayer_client = client || Client.default_client
|
108
114
|
raise "#{__method__} requires a client but none was given and Client::default_client is not set" if !@softlayer_client
|
@@ -156,13 +162,14 @@ module SoftLayer
|
|
156
162
|
template['dedicatedAccountHostOnlyFlag'] = true if @dedicated_host_only
|
157
163
|
template['privateNetworkOnlyFlag'] = true if @private_network_only
|
158
164
|
|
159
|
-
template['datacenter']
|
160
|
-
template['userData']
|
161
|
-
template['networkComponents']
|
162
|
-
template['postInstallScriptUri']
|
163
|
-
template['
|
164
|
-
template['primaryNetworkComponent']
|
165
|
+
template['datacenter'] = {"name" => @datacenter.name} if @datacenter
|
166
|
+
template['userData'] = [{'value' => @user_metadata}] if @user_metadata
|
167
|
+
template['networkComponents'] = [{'maxSpeed'=> @max_port_speed}] if @max_port_speed
|
168
|
+
template['postInstallScriptUri'] = @provision_script_URI.to_s if @provision_script_URI
|
169
|
+
template['postInstallScriptUri'] = @provision_script_uri.to_s if @provision_script_uri
|
170
|
+
template['primaryNetworkComponent'] = { "networkVlan" => { "id" => @public_vlan_id.to_i } } if @public_vlan_id
|
165
171
|
template['primaryBackendNetworkComponent'] = { "networkVlan" => {"id" => @private_vlan_id.to_i } } if @private_vlan_id
|
172
|
+
template['sshKeys'] = @ssh_key_ids.collect { |ssh_key_id| {'id'=> ssh_key_id.to_i } } if @ssh_key_ids
|
166
173
|
|
167
174
|
if @image_template
|
168
175
|
template['blockDeviceTemplateGroup'] = {"globalIdentifier" => @image_template.global_id}
|
@@ -232,7 +239,7 @@ module SoftLayer
|
|
232
239
|
end
|
233
240
|
|
234
241
|
##
|
235
|
-
# Returns a list of the valid :
|
242
|
+
# Returns a list of the valid :os_reference_codes
|
236
243
|
def self.os_reference_code_options(client = nil)
|
237
244
|
create_object_options(client)['operatingSystems'].collect { |os_spec| os_spec['template']['operatingSystemReferenceCode'] }.uniq.sort!
|
238
245
|
end
|
@@ -42,14 +42,14 @@ module SoftLayer
|
|
42
42
|
# The domain of the server being created (i.e. 'softlayer.com' is the domain of sldn.softlayer.com)
|
43
43
|
attr_accessor :domain
|
44
44
|
|
45
|
-
# The value of this property should be a hash. The keys of the hash are
|
45
|
+
# The value of this property should be a hash. The keys of the hash are ProductItemCategory
|
46
46
|
# codes (like 'os' and 'ram') while the values may be Integers or Objects. The Integer values
|
47
47
|
# should be the +id+ of a +SoftLayer_Product_Item_Price+ representing the configuration option
|
48
48
|
# chosen for that category. Objects must respond to the +price_id+ message and return an integer
|
49
49
|
# that is the +id+ of a +SoftLayer_Product_Item_Price+. Instances of the ProductConfigurationOption
|
50
50
|
# class behave this way.
|
51
51
|
#
|
52
|
-
# At a minimum, the
|
52
|
+
# At a minimum, the configuration_options should include entries for each of the categories
|
53
53
|
# required by the package (i.e. those returned from ProductPackage#required_categories)
|
54
54
|
attr_accessor :configuration_options
|
55
55
|
|
@@ -65,8 +65,23 @@ module SoftLayer
|
|
65
65
|
# be installed on the server.
|
66
66
|
attr_accessor :image_template
|
67
67
|
|
68
|
+
# Integer, The id of the public VLAN this server should join
|
69
|
+
# Corresponds to +primaryNetworkComponent.networkVlan.id+ in the +createObject+ documentation
|
70
|
+
attr_accessor :public_vlan_id
|
71
|
+
|
72
|
+
# Integer, The id of the private VLAN this server should join
|
73
|
+
# Corresponds to +primaryBackendNetworkComponent.networkVlan.id+ in the +createObject+ documentation
|
74
|
+
attr_accessor :private_vlan_id
|
75
|
+
|
76
|
+
# The URI of a script to execute on the server after it has been provisioned. This may be
|
77
|
+
# any object which accepts the to_s message. The resulting string will be passed to SoftLayer API.
|
78
|
+
attr_accessor :provision_script_uri
|
79
|
+
|
68
80
|
# The URI of a script to execute on the server after it has been provisioned. This may be
|
69
81
|
# any object which accepts the to_s message. The resulting string will be passed to SoftLayer API.
|
82
|
+
#
|
83
|
+
# DEPRECATION WARNING: This attribute is deprecated in favor of provision_script_uri
|
84
|
+
# and will be removed in the next major release.
|
70
85
|
attr_accessor :provision_script_URI
|
71
86
|
|
72
87
|
# An array of the ids of SSH keys to install on the server upon provisioning
|
@@ -139,11 +154,14 @@ module SoftLayer
|
|
139
154
|
|
140
155
|
#Note that the use of image_template and SoftLayer::ProductPackage os/guest_diskX configuration category
|
141
156
|
#item prices is mutually exclusive.
|
142
|
-
product_order['imageTemplateGlobalIdentifier']
|
143
|
-
product_order['location']
|
144
|
-
product_order['provisionScripts']
|
145
|
-
product_order['
|
146
|
-
product_order['
|
157
|
+
product_order['imageTemplateGlobalIdentifier'] = @image_template.global_id if @image_template
|
158
|
+
product_order['location'] = @datacenter.id if @datacenter
|
159
|
+
product_order['provisionScripts'] = [@provision_script_URI.to_s] if @provision_script_URI
|
160
|
+
product_order['provisionScripts'] = [@provision_script_uri.to_s] if @provision_script_uri
|
161
|
+
product_order['sshKeys'] = [{ 'sshKeyIds' => @ssh_key_ids }] if @ssh_key_ids
|
162
|
+
product_order['virtualGuests'][0]['userData'] = @user_metadata if @user_metadata
|
163
|
+
product_order['primaryNetworkComponent'] = { "networkVlan" => { "id" => @public_vlan_id.to_i } } if @public_vlan_id
|
164
|
+
product_order['primaryBackendNetworkComponent'] = { "networkVlan" => {"id" => @private_vlan_id.to_i } } if @private_vlan_id
|
147
165
|
|
148
166
|
product_order['prices'] = @configuration_options.collect do |key, value|
|
149
167
|
if value.respond_to?(:price_id)
|
@@ -108,7 +108,7 @@ module SoftLayer
|
|
108
108
|
end
|
109
109
|
|
110
110
|
##
|
111
|
-
# Searches through the upgrade items
|
111
|
+
# Searches through the upgrade items prices known to this server for the one that is in a particular category
|
112
112
|
# and whose capacity matches the value given. Returns the item_price or nil
|
113
113
|
#
|
114
114
|
def _item_price_with_capacity(which_category, capacity)
|
data/lib/softlayer/base.rb
CHANGED
@@ -12,7 +12,7 @@ require 'rubygems'
|
|
12
12
|
module SoftLayer
|
13
13
|
# The version number (including major, minor, and bugfix numbers)
|
14
14
|
# This should change in accordance with the concept of Semantic Versioning
|
15
|
-
VERSION = "3.0
|
15
|
+
VERSION = "3.1.0" # version history in the CHANGELOG.textile file at the root of the source
|
16
16
|
|
17
17
|
# The base URL of the SoftLayer API available to the public internet.
|
18
18
|
API_PUBLIC_ENDPOINT = 'https://api.softlayer.com/xmlrpc/v3/'
|
@@ -68,7 +68,7 @@ end
|
|
68
68
|
# object masks
|
69
69
|
class Array
|
70
70
|
# Returns a string representing the object mask content represented by the
|
71
|
-
# Array. Each value in the array is converted to its object mask
|
71
|
+
# Array. Each value in the array is converted to its object mask equivalent
|
72
72
|
# This routine is an implementation detail used in the conversion of hashes
|
73
73
|
# to object mask strings. You should not have to call this method directly.
|
74
74
|
def _to_sl_object_mask_property()
|
data/lib/softlayer_api.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
#++
|
6
6
|
|
7
7
|
# requirements from the core libraries
|
8
|
+
require 'date'
|
8
9
|
require 'time'
|
9
10
|
|
10
11
|
# Requirements for the Foundation Layer
|
@@ -23,6 +24,7 @@ require 'softlayer/Datacenter'
|
|
23
24
|
require 'softlayer/DynamicAttribute'
|
24
25
|
require 'softlayer/Account'
|
25
26
|
require 'softlayer/AccountPassword'
|
27
|
+
require 'softlayer/NetworkMonitor'
|
26
28
|
require 'softlayer/Server'
|
27
29
|
require 'softlayer/BareMetalServer'
|
28
30
|
require 'softlayer/BareMetalServerOrder'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: softlayer_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SoftLayer Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configparser
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- lib/softlayer/ModelBase.rb
|
131
131
|
- lib/softlayer/NetworkComponent.rb
|
132
132
|
- lib/softlayer/NetworkMessageDelivery.rb
|
133
|
+
- lib/softlayer/NetworkMonitor.rb
|
133
134
|
- lib/softlayer/NetworkService.rb
|
134
135
|
- lib/softlayer/NetworkStorage.rb
|
135
136
|
- lib/softlayer/NetworkStorageAllowedHost.rb
|
@@ -182,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
183
|
version: '0'
|
183
184
|
requirements: []
|
184
185
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.4.6
|
186
187
|
signing_key:
|
187
188
|
specification_version: 4
|
188
189
|
summary: Library for accessing the SoftLayer API
|