Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Created March 11, 2014 20:14
Show Gist options
  • Save underscorephil/9494049 to your computer and use it in GitHub Desktop.
Save underscorephil/9494049 to your computer and use it in GitHub Desktop.
from pprint import pprint as pp
import SoftLayer
client = SoftLayer.Client()
mgr = SoftLayer.CCIManager(client)
serverId = 1234
mask = ('mask[monitoringAgents[id,name,statusName]]')
server = mgr.get_instance(serverId, mask=mask)
pp(server)
for monitoringAgent in server['monitoringAgents']:
agentID = monitoringAgent['id']
print ("Deactivating %s" % agentID)
client['Monitoring_Agent'].deactivate(id=agentID)
serverId = 2345
mask = ('mask[monitoringAgents[id,statusName]]')
server = mgr.get_instance(serverId, mask=mask)
pp(server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment