def delete(device_id):
    '''
    Delete a device from Server Density. For more information, see the `API
    docs`__.

    .. __: https://apidocs.serverdensity.com/Inventory/Devices/Deleting

    CLI Example:

    .. code-block:: bash

        salt '*' serverdensity_device.delete 51f7eafcdba4bb235e000ae4
    '''
    api_response = requests.delete(
        'https://api.serverdensity.io/inventory/devices/' + device_id,
        params={'token': get_sd_auth('api_token')}
    )
    log.debug('Server Density API Response: %s', api_response)
    log.debug('Server Density API Response content: %s', api_response.content)
    if api_response.status_code == 200:
        try:
            return salt.utils.json.loads(api_response.content)
        except ValueError:
            log.error('Could not parse API Response content: %s', api_response.content)
            raise CommandExecutionError(
                'Failed to create, API Response: {0}'.format(api_response)
            )
    else:
        return None
def delete ( device_id ) : api_response = requests . delete ( 'https://api.serverdensity.io/inventory/devices/' + device_id , params = { 'token' : get_sd_auth ( 'api_token' ) } ) log . debug ( 'Server Density API Response: %s' , api_response ) log . debug ( 'Server Density API Response content: %s' , api_response . content ) if api_response . status_code == 200 : try : return salt . utils . json . loads ( api_response . content ) except ValueError : log . error ( 'Could not parse API Response content: %s' , api_response . content ) raise CommandExecutionError ( 'Failed to create, API Response: {0}' . format ( api_response ) ) else : return None
Delete a device from Server Density. For more information, see the `API
    docs`__.

    .. __: https://apidocs.serverdensity.com/Inventory/Devices/Deleting

    CLI Example:

    .. code-block:: bash

        salt '*' serverdensity_device.delete 51f7eafcdba4bb235e000ae4