SoftLayer.ticket

Ticket Manager/helpers

license

MIT, see LICENSE for more details.

class SoftLayer.managers.ticket.TicketManager(client)[source]

Manages SoftLayer support tickets.

See product information here: https://www.ibm.com/cloud/support

Parameters

client (SoftLayer.API.BaseClient) – the client instance

attach_hardware(ticket_id=None, hardware_id=None)[source]

Attach hardware to a ticket.

Parameters
  • ticket_id (integer) – the id of the ticket to attach to

  • hardware_id (integer) – the id of the hardware to attach

Returns

dict – The new ticket attachment

attach_virtual_server(ticket_id=None, virtual_id=None)[source]

Attach a virtual server to a ticket.

Parameters
  • ticket_id (integer) – the id of the ticket to attach to

  • virtual_id (integer) – the id of the virtual server to attach

Returns

dict – The new ticket attachment

create_ticket(title=None, body=None, subject=None, priority=None)[source]

Create a new ticket.

Parameters
  • title (string) – title for the new ticket

  • body (string) – body for the new ticket

  • subject (integer) – id of the subject to be assigned to the ticket

  • priority (integer) – Value from 1 (highest) to 4 (lowest)

detach_hardware(ticket_id=None, hardware_id=None)[source]

Detach hardware from a ticket.

Parameters
  • ticket_id – the id of the ticket to detach from

  • hardware_id – the id of the hardware to detach

Returns

bool – Whether the detachment was successful

detach_virtual_server(ticket_id=None, virtual_id=None)[source]

Detach a virtual server from a ticket.

Parameters
  • ticket_id – the id of the ticket to detach from

  • virtual_id – the id of the virtual server to detach

Returns

bool – Whether the detachment was successful

get_ticket(ticket_id)[source]

Get details about a ticket.

Parameters

ticket_id (integer) – the ticket ID

Returns

dict – information about the specified ticket

list_subjects()[source]

List all ticket subjects.

list_tickets(open_status=True, closed_status=True)[source]

List all tickets.

Parameters
  • open_status (boolean) – include open tickets

  • closed_status (boolean) – include closed tickets

resolve_ids(identifier)

Takes a string and tries to resolve to a list of matching ids.

What exactly ‘identifier’ can be depends on the resolvers

Parameters

identifier (string) – identifying string

Returns list

update_ticket(ticket_id=None, body=None)[source]

Update a ticket.

Parameters
  • ticket_id (integer) – the id of the ticket to update

  • body (string) – entry to update in the ticket

upload_attachment(ticket_id=None, file_path=None, file_name=None)[source]

Upload an attachment to a ticket.

Parameters
  • ticket_id (integer) – the id of the ticket to upload the attachment to

  • file_path (string) – The path of the attachment to be uploaded

  • file_name (string) – The name of the attachment shown in the ticket

Returns

dict – The uploaded attachment