Delete a resource.

        Supports batch delete.
963546
async def delete(self, request, resource=None, **kwargs):
        
        if resource:
            resources = [resource]
        else:
            data = await self.parse(request)
            if data:
                resources = list(self.collection.where(self.meta.model_pk << data))

        if not resources:
            raise RESTNotFound(reason='Resource not found')

        for resource in resources:
            resource.delete_instance()
1134580
def delete(self, raise_exc=True, headers=None, files=None):
        ''''''

        return self._request(DELETE, None, raise_exc, headers, files)
90587
def delete_service(self, name):
    
    return services.delete_service(self._get_resource_root(), name, self.name)
1312970
def delete(self, *, auto_commit=False):
        
        try:
            db.session.delete(self.resource)
            if auto_commit:
                db.session.commit()
        except SQLAlchemyError:
            self.log.exception('Failed deleting resource: {}'.format(self.id))
            db.session.rollback()
1010169
def delete_resource(uri)
      clear
      uri = URI.parse(uri)
      @req = Net::HTTP::Delete.new uri.request_uri
      set_common_info(@req)
      @http_class.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
        @res = http.request(@req)
        case @res
          when Net::HTTPSuccess
            #warn "Bad Status Code: #{@res.code}" unless @res.class == Net::HTTPOK || @res.class == Net::HTTPNoContent
          else
            raise RequestError, "Failed to delete resource. #{@res.code}"
          end
      end
    end
653177
def delete_resource(self, transaction, path):
        

        resource = transaction.resource
        method = getattr(resource, 'render_DELETE', None)

        try:
            ret = method(request=transaction.request)
        except NotImplementedError:
            try:
                method = getattr(transaction.resource, "render_DELETE_advanced", None)
                ret = method(request=transaction.request, response=transaction.response)
                if isinstance(ret, tuple) and len(ret) == 2 and isinstance(ret[1], Response) \
                        and isinstance(ret[0], bool):
                    # Advanced handler
                    delete, response = ret
                    if delete:
                        del self._parent.root[path]
                    transaction.response = response
                    if transaction.response.code is None:
                        transaction.response.code = defines.Codes.DELETED.number
                    return transaction
                elif isinstance(ret, tuple) and len(ret) == 3 and isinstance(ret[1], Response) \
                        and isinstance(ret[0], Resource):
                    # Advanced handler separate
                    resource, response, callback = ret
                    ret = self._handle_separate_advanced(transaction, callback)
                    if not isinstance(ret, tuple) or \
                            not (isinstance(ret[0], bool) and isinstance(ret[1], Response)):  # pragma: no cover
                        transaction.response.code = defines.Codes.INTERNAL_SERVER_ERROR.number
                        return transaction
                    delete, response = ret
                    if delete:
                        del self._parent.root[path]
                    transaction.response = response
                    if transaction.response.code is None:
                        transaction.response.code = defines.Codes.DELETED.number
                    return transaction
                else:
                    raise NotImplementedError
            except NotImplementedError:
                transaction.response.code = defines.Codes.METHOD_NOT_ALLOWED.number
                return transaction

        if isinstance(ret, bool):
            pass
        elif isinstance(ret, tuple) and len(ret) == 2:
            resource, callback = ret
            ret = self._handle_separate(transaction, callback)
            if not isinstance(ret, bool):  # pragma: no cover
                transaction.response.code = defines.Codes.INTERNAL_SERVER_ERROR.number
                return transaction
        else:  # pragma: no cover
            # Handle error
            transaction.response.code = defines.Codes.INTERNAL_SERVER_ERROR.number
            return transaction
        if ret:
            del self._parent.root[path]
            transaction.response.code = defines.Codes.DELETED.number
            transaction.response.payload = None
            transaction.resource.deleted = True
        else:  # pragma: no cover
            transaction.response.code = defines.Codes.INTERNAL_SERVER_ERROR.number

        return transaction
1327955
public static base_response delete(nitro_service client, nd6 resource) throws Exception {
		nd6 deleteresource = new nd6();
		deleteresource.neighbor = resource.neighbor;
		deleteresource.vlan = resource.vlan;
		deleteresource.td = resource.td;
		return deleteresource.delete_resource(client);
	}
1338164
def delete(options = {})
      return each({ match: '*', count: 500, max_iterations: 1_000_000, batch_size: 500 }.merge(options)) do |keys|
        @connection.del(*keys)
      end
    end
425462
def delete(self):
        """"""
        r = self._h._http_resource(
            method='DELETE',
            resource=('user', 'keys', self.id)
        )

        r.raise_for_status()
88440
def delete(method, hmc, uri, uri_parms, logon_required):
        """"""
        try:
            resource = hmc.lookup_by_uri(uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        resource.manager.remove(resource.oid)
450185
def delete(self):
        
        session = self._session
        url = session._build_url(self._resource_path(), self.id)
        return session.delete(url, CB.boolean(204))
496075
def remove_resources(self, resources):
    

    resources_to_delete = self._build_resource_dictionary(resources)
    for email in resources_to_delete.keys():
      if email in self._resources:
        del self._resources[email]

    self._dirty_attributes.add(u'resources')
1059319
def _delete(self, **kwargs):
        """"""
        path = self._construct_path_to_item()
        return self._http.delete(path)
350153
def resource_collection_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/resource_collections/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
646757
def delete_resource(self, session, data, api_type, obj_id):
        
        resource = self._fetch_resource(session, api_type, obj_id,
                                        Permissions.VIEW)
        self._check_instance_relationships_for_delete(resource)

        session.delete(resource)
        session.commit()

        response = JSONAPIResponse()
        response.status_code = 204

        return response
949139
def delete(self, force=False, volumes=False):
        
        try:
            self.image.rmi()
        except ConuException as ime:
            if not force:
                raise ime
            else:
                pass
463463
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'
        # flush the resource_cache, because we're modifying a resource
        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