def delete_resource(resource_name, key, identifier_fields, profile='pagerduty', subdomain=None, api_key=None):
 resource = get_resource(resource_name, key, identifier_fields, profile, subdomain, api_key)
 if resource:
  if __opts__['test']:
   return 'would delete'
  del __context__['pagerduty_util.resource_cache'][resource_name]
  resource_id = _get_resource_id(resource)
  return _query(method='DELETE', action='{0}/{1}'.format(resource_name, resource_id), profile=profile, subdomain=subdomain, api_key=api_key)
 else:
  return True

def delete_resource ( resource_name , key , identifier_fields , profile = 'pagerduty' , subdomain = None , api_key = None ) : resource = get_resource ( resource_name , key , identifier_fields , profile , subdomain , api_key ) if resource : if __opts__ [ 'test' ] : return 'would delete' del __context__ [ 'pagerduty_util.resource_cache' ] [ resource_name ] resource_id = _get_resource_id ( resource ) return _query ( method = 'DELETE' , action = '{0}/{1}' . format ( resource_name , resource_id ) , profile = profile , subdomain = subdomain , api_key = api_key ) else : return True
delete any pagerduty resource helper method for absent() example: delete_resource # delete by id or name or email .