#NEWLINE# def delete( device_id ) : #NEWLINE# #INDENT# "\n    Delete a device from Server Density. For more information, see the `API\n    docs`__.\n\n    .. __: https://apidocs.serverdensity.com/Inventory/Devices/Deleting\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' serverdensity_device.delete 51f7eafcdba4bb235e000ae4\n    " #NEWLINE# api_response = requests . delete ( ( 'https://api.serverdensity.io/inventory/devices/' + device_id ) , params = { #NEWLINE# #INDENT# 'token' : get_sd_auth ( 'api_token' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# log . debug ( 'Server Density API Response: {0}' . format ( device_id ) ) #NEWLINE# log . debug ( 'Server Density API Response content: {0}' . format ( api_response . content ) ) #NEWLINE# if ( api_response . status_code == 200 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return json . loads ( api_response . content ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# log . error ( 'Could not parse API Response content: {0}' . format ( api_response . content ) ) #NEWLINE# raise CommandExecutionError ( 'Failed to create, API Response: {0}' . format ( api_response ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return None