1111
1212CATEGORY_MASK = '''id,
1313 isRequired,
14- itemCategory[
15- id,
16- name,
17- categoryCode
18- ]
14+ itemCategory[id, name, categoryCode]
1915 '''
2016
21- ITEM_MASK = '''id,
22- keyName,
23- description
24- '''
17+ ITEM_MASK = '''id, keyName, description'''
2518
26- PACKAGE_MASK = '''id,
27- name,
28- keyName,
29- isActive
30- '''
19+ PACKAGE_MASK = '''id, name, keyName, isActive'''
3120
32- PRESET_MASK = '''id,
33- name,
34- keyName,
35- description
36- '''
21+ PRESET_MASK = '''id, name, keyName, description'''
3722
3823
3924class OrderingManager (object ):
@@ -102,7 +87,7 @@ def get_only_active_packages(packages):
10287 If a package is active, it is eligible for ordering
10388 This will inspect the 'isActive' property on the provided packages
10489
105- :param packages Dictionary of packages, isActive key must be present
90+ :param packages: Dictionary of packages, isActive key must be present
10691 """
10792
10893 active_packages = []
@@ -121,8 +106,7 @@ def get_package_by_type(self, package_type, mask=None):
121106 one returned by the API.
122107 If no packages are found, returns None
123108
124- :param package_type string representing the package type key name
125- we are interested in
109+ :param string package_type: representing the package type key name we are interested in
126110 """
127111 packages = self .get_packages_of_type ([package_type ], mask )
128112 if len (packages ) == 0 :
@@ -133,9 +117,8 @@ def get_package_by_type(self, package_type, mask=None):
133117 def get_package_id_by_type (self , package_type ):
134118 """Return the package ID of a Product Package with a given type.
135119
136- :param package_type string representing the package type key name
137- we are interested in
138- :raises ValueError when no package of the given type is found
120+ :param string package_type: representing the package type key name we are interested in
121+ :raises ValueError: when no package of the given type is found
139122 """
140123
141124 mask = "mask[id, name, description, isActive, type[keyName]]"
@@ -148,7 +131,7 @@ def get_package_id_by_type(self, package_type):
148131 def get_quotes (self ):
149132 """Retrieve a list of quotes.
150133
151- :return a list of SoftLayer_Billing_Order_Quote
134+ :returns: a list of SoftLayer_Billing_Order_Quote
152135 """
153136
154137 quotes = self .client ['Account' ].getActiveQuotes ()
@@ -157,7 +140,7 @@ def get_quotes(self):
157140 def get_quote_details (self , quote_id ):
158141 """Retrieve quote details.
159142
160- :param quote_id ID number of target quote
143+ :param quote_id: ID number of target quote
161144 """
162145
163146 quote = self .client ['Billing_Order_Quote' ].getObject (id = quote_id )
@@ -166,7 +149,7 @@ def get_quote_details(self, quote_id):
166149 def get_order_container (self , quote_id ):
167150 """Generate an order container from a quote object.
168151
169- :param quote_id ID number of target quote
152+ :param quote_id: ID number of target quote
170153 """
171154
172155 quote = self .client ['Billing_Order_Quote' ]
@@ -196,8 +179,7 @@ def generate_order_template(self, quote_id, extra, quantity=1):
196179 product_type = 'hardware'
197180
198181 if len (extra ) != quantity :
199- raise ValueError ("You must specify extra for each server in the "
200- "quote" )
182+ raise ValueError ("You must specify extra for each server in the quote" )
201183
202184 container [product_type ] = []
203185 for extra_details in extra :
@@ -236,8 +218,7 @@ def get_package_by_key(self, package_keyname, mask=None):
236218
237219 If no packages are found, returns None
238220
239- :param package_keyname string representing the package key name
240- we are interested in.
221+ :param package_keyname: string representing the package key name we are interested in.
241222 :param string mask: Mask to specify the properties we want to retrieve
242223 """
243224 _filter = {
@@ -394,16 +375,15 @@ def verify_order(self, package_keyname, location, item_keynames, complex_type=No
394375 possible keynames for a package, use list_items()
395376 (or `slcli order item-list`)
396377 :param str complex_type: The complex type to send with the order. Typically begins
397- with ' SoftLayer_Container_Product_Order_' .
378+ with ` SoftLayer_Container_Product_Order_` .
398379 :param bool hourly: If true, uses hourly billing, otherwise uses monthly billing
399380 :param string preset_keyname: If needed, specifies a preset to use for that package.
400381 To see a list of possible keynames for a package, use
401382 list_preset() (or `slcli order preset-list`)
402383 :param dict extras: The extra data for the order in dictionary format.
403384 Example: A VSI order requires hostname and domain to be set, so
404385 extras will look like the following:
405- {'virtualGuests': [{'hostname': 'test',
406- 'domain': 'softlayer.com'}]}
386+ 'virtualGuests': [{'hostname': 'test', 'domain': 'softlayer.com'}]}
407387 :param int quantity: The number of resources to order
408388
409389 """
@@ -425,16 +405,15 @@ def place_order(self, package_keyname, location, item_keynames, complex_type=Non
425405 possible keynames for a package, use list_items()
426406 (or `slcli order item-list`)
427407 :param str complex_type: The complex type to send with the order. Typically begins
428- with ' SoftLayer_Container_Product_Order_' .
408+ with ` SoftLayer_Container_Product_Order_` .
429409 :param bool hourly: If true, uses hourly billing, otherwise uses monthly billing
430410 :param string preset_keyname: If needed, specifies a preset to use for that package.
431411 To see a list of possible keynames for a package, use
432412 list_preset() (or `slcli order preset-list`)
433413 :param dict extras: The extra data for the order in dictionary format.
434414 Example: A VSI order requires hostname and domain to be set, so
435415 extras will look like the following:
436- {'virtualGuests': [{'hostname': 'test',
437- 'domain': 'softlayer.com'}]}
416+ {'virtualGuests': [{'hostname': 'test', domain': 'softlayer.com'}]}
438417 :param int quantity: The number of resources to order
439418
440419 """
@@ -457,16 +436,15 @@ def generate_order(self, package_keyname, location, item_keynames, complex_type=
457436 possible keynames for a package, use list_items()
458437 (or `slcli order item-list`)
459438 :param str complex_type: The complex type to send with the order. Typically begins
460- with ' SoftLayer_Container_Product_Order_' .
439+ with ` SoftLayer_Container_Product_Order_` .
461440 :param bool hourly: If true, uses hourly billing, otherwise uses monthly billing
462441 :param string preset_keyname: If needed, specifies a preset to use for that package.
463442 To see a list of possible keynames for a package, use
464443 list_preset() (or `slcli order preset-list`)
465444 :param dict extras: The extra data for the order in dictionary format.
466445 Example: A VSI order requires hostname and domain to be set, so
467446 extras will look like the following:
468- {'virtualGuests': [{'hostname': 'test',
469- 'domain': 'softlayer.com'}]}
447+ {'virtualGuests': [{'hostname': 'test', 'domain': 'softlayer.com'}]}
470448 :param int quantity: The number of resources to order
471449
472450 """
0 commit comments