Where should I add code to create annotation for myself datasource plugin in panel?

I want to create update delete the annotation for my datasource plugin by HTTP API not the native annotation.but the datasource.ts`s function annotationQuery just query annotation,I had read the documents http://docs.grafana.org/http_api/annotations/ ,I don’t know where to write code to implement these API to create、update and delete annotation?