In this article I am going to explain how to use the Schema Registry API to Create and Delete a Schema Entity.
I am working on a Use Case for creating schemas with over 500 columns on the fly within a NiFi Data Flow. In order to complete this task I needed to figure out how to create, and update the schemas from outside of the Schema Registry UI. While testing I also needed to delete the test schemas since there is no way to delete them from within the UI.
First, to get the artifacts I need (API urls, and post formats), I use the Schema Registry UI in Chrome with my Developer Tools open to capture what happens when the UI buttons are clicked. When I add a test schema, I notice 2 POST calls.
Creates the Schema Entity (without an actual Schema)
Posts the Schema to the newly created Entity
Using the information in Developer Tools, I then create 2 Postman api calls to duplicate, debug, and validate they will work externally.
** Note: I am working in a single node sandbox (hdf.cloudera.com) hdf cluster without any authorization. If your cluster is secured you will need to satisfy access, authorization, and ssl requirements.
The information above should be enough to get you started using the Schema Registry API via command line, curl, or any other method you prefer. In my next article, I will go into deeper detail in how I fit these concepts into my NiFi Flow.