Skip to content

Instantly share code, notes, and snippets.

@hassenius
Last active August 29, 2015 13:58
Show Gist options
  • Save hassenius/10416327 to your computer and use it in GitHub Desktop.
Save hassenius/10416327 to your computer and use it in GitHub Desktop.
Upgrade CCI
################################################################################
# upgrade_cci.py
# ©Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
################################################################################
import SoftLayer.API
import datetime
apiUsername = ' set me '
apiKey = ' set me '
virtualGuestId = ' set me '
orderClient = SoftLayer.Client(username=apiUsername, api_key=apiKey)
orderContainer = {}
orderContainer['complexType'] = 'SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade'
orderContainer['virtualGuests'] = [{'id': virtualGuestId}]
orderContainer['prices'] = [
## RAM Upgrades, uncomment the desired one
# {'id': 1644 } # 1 GB RAM
# {'id': 1645 } # 2 GB RAM
# {'id': 1646 } # 4 GB RAM
# {'id': 2238 } # 6 GB RAM
# {'id': 1647 } # 8 GB RAM
# {'id': 2243 } # 12 GB RAM
# {'id': 1927 } # 16 GB RAM
# {'id': 21275 } # 32 GB RAM
# {'id': 22422 } # 48 GB RAM
# {'id': 37042 } # 64 GB RAM
## CPU Upgrades, uncomment the desired one
# {'id': 1962 } # Private 1 x 2.0 GHz Core
# {'id': 1963 } # Private 2 x 2.0 GHz Cores
# {'id': 1964 } # Private 4 x 2.0 GHz Cores
# {'id': 1965 } # Private 8 x 2.0 GHz Cores
# {'id': 2156 } # 1 x 2.0 GHz Internal Core
# {'id': 1640 } # 1 x 2.0 GHz Core
# {'id': 1641 } # 2 x 2.0 GHz Cores
# {'id': 1642 } # 4 x 2.0 GHz Cores
# {'id': 1643 } # 8 x 2.0 GHz Cores
# {'id': 2231 } # 12 x 2.0 GHz Cores
# {'id': 2235 } # 16 x 2.0 GHz Cores
]
orderContainer['properties'] = [{'name': 'MAINTENANCE_WINDOW', 'value': str(datetime.datetime.now())}]
orderClient['Product_Order'].verifyOrder(orderContainer)
#orderClient.placeOrder(orderContainer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment