Methods
These are the operations that can be performed on the Microservices Manager contract.
Read Operations
Retrieves the number (length) of microservices managed by the Microservices Manager.
Retrieves each microservice's data (Microservice
struct).
Pass a range position (start
and offset
) in the function for it to return an array that contains the Microservice
struct for each microservice of the range.
Pass an array of one or more microservice's keys (i.e names) in the function for it to retrieve each microservice's data (Microservice
struct).
Pass an array of one or more microservice's indices in the function for it to retrieve each microservice's data (Microservice
struct).
Pass a microservice key (i.e name) in the function for it to retrieve if the key exists (true)--i.e. the key corresponds to a microservice--or not (false).
Pass a microservice key (i.e name) in the function to retrieve its data (Microservice
struct).
Pass a microservice index in the function to retrieve its data (Microservice
struct).
Write Operations
Pass a Microservice
struct in this function for it add a new microservice to the Microservices Manager.
If the key passed in the struct corresponds to a variable that already exists in the Microservice Manager, it is replaced with the new one. In this case, the function returns the replaced value.
Pass an array of Microservice
structs in this function for it add multiple new microservices to the Microservices Manager.
If the keys passed in the struct correspond to microservices that already exists in the Microservice Manager, they are replaced with the new one. In this case, the function returns the replaced values.
Pass a microservice key in this function for it to remove a microservice from the Microservices Manager. The function returns the removed microservice's value.
Pass an array of microservice keys in this function for it to remove those microservices from the Microservices Manager. The function output returns the removed microservices' values.
Pass an array of microservice indices to remove those microservices from the Microservices Manager. The function output returns the removed microservices' values.
Note
To avoid side effects or undesired transaction reverts, the array of indices must be passed by force in descending order. For example: If you want to delete the variables at indexes 9, 18 and 13, pass the array ordered as [18, 13, 9]. This will ensure the function behavior is respected correctly.
Microservice Code Execution
This function allows a microservice to be executed in read mode.
Pass the microservice key (microservice name) and a payload in the function, which will call the microservice and retrieve its location by key. Even the payload will be passed to microservice location address.
This function allows a microservice to be executed in submit mode.
Pass the microservice key (microservice name) and a payload in the function, which will call the microservice and retrieve its location by key. Even the payload will be passed to microservice location address.
Last updated