A fully working and operational component template to use for starting development of your own component for the elastic.io platform. This component comes with a basic architecture which you can use on the platform.
The component interacts with the petstore sample server.
Our documentation on building components in nodejs has more about each including file and their function.
To use this component you must be registered platform user. Please see our home page at https://www.elastic.io to learn how to register.
To authenticate use secret as an API key. For more details see the Petstore API docs.
Retrieves pets from the Petstore API by given pet status using Dynamic or Static Data Sample. The difference is how these functions are made. However, both can have the following statuses defined by the Petstore API:
Available- select to get all pets with statusAvailable.Pending- select forPending.Sold- select forSold.
Creates a new Pet by making a POST to /pet endpoint of the API. The input fields are:
petId(required) - the Id of the pet.name- the name of the pet.status- the status which can have oneAvailable,PendingandSoldvalues.
The structure of petstore-component-nodejs component is quite flexible. elastic.io platform expects only two files to be present in the main directory. These are the component.json and package.json. Our documentation on how to build a component in node.js has more about each file and their function.