November 23, 2017


get_schedules.py

get_schedules.py
"""
Get all the schedules configured in the endurance storage.

Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage/getSchedules

License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
"""
import SoftLayer

USERNAME = 'set me'
API_KEY = 'set me'

# The endurance storage id from where you wish to get the schedules
enduranceStorageId = 6548079

# Declares the API client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
storageService = client['SoftLayer_Network_Storage']

try:
    result = storageService.getSchedules(id=enduranceStorageId)
    print(result)
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to get the Schedules. faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))

Feedback?

If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue