Skip to content

Commit 66f42c3

Browse files
kramimusYingchao Huang
authored andcommitted
Dedicated host cancellation is pretty similar to bare metal
Copied in the bare metal cancellation code and moves some fields around in the request to get it to work with the API
1 parent 32679d3 commit 66f42c3

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

SoftLayer/managers/dedicated_host.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,27 @@ def list_instances(self, tags=None, cpus=None, memory=None, hostname=None,
227227
kwargs['filter'] = _filter.to_dict()
228228
return self.account.getDedicatedHosts(**kwargs)
229229

230+
231+
def get_cancellation_reasons(self):
232+
"""Returns a dictionary of valid cancellation reasons.
233+
234+
These can be used when cancelling a dedicated server
235+
via :func:`cancel_host`.
236+
"""
237+
return {
238+
'unneeded': 'No longer needed',
239+
'closing': 'Business closing down',
240+
'cost': 'Server / Upgrade Costs',
241+
'migrate_larger': 'Migrating to larger server',
242+
'migrate_smaller': 'Migrating to smaller server',
243+
'datacenter': 'Migrating to a different SoftLayer datacenter',
244+
'performance': 'Network performance / latency',
245+
'support': 'Support response / timing',
246+
'sales': 'Sales process / upgrades',
247+
'moving': 'Moving to competitor',
248+
}
249+
250+
230251
def get_host(self, host_id, **kwargs):
231252
"""Get details about a dedicated host.
232253

0 commit comments

Comments
 (0)