Resource Service

Build Status Dependencies Coverage Status

A microservice for resource management part of the Restorecommerce.

Features

  • Persists resources in a database instance, each of them bound with its own separate collection.

  • Exposes a graph traversal operation (further documented in resource-base-interface).

Configuration

The list of resource names should be specified in the resources configuration in the config.json file, in order to create them in the database. Such names should have a matching Protocol Buffers file in the protos folder where all the fields of resources are defined.

API

This microservice exposes the following gRPC endpoints:

CRUD Operations

The microservice exposes the below CRUD operations for creating or modifying resources.

Method Name Request Type Response Type Description

Create

io.restorecommerce.<resource>.<resourceName>

io.restorecommerce.<resource>.<resourceName>

List of \<resourceName> to be created

Read

io.restorecommerce.resourcebase.ReadRequest

io.restorecommerce.<resource>.<resourceName>

List of \<resourceName>

Update

io.restorecommerce.<resource>.<resourceName>

io.restorecommerce.<resource>.<resourceName>

List of \<resourceName> to be updated

Upsert

io.restorecommerce.<resource>.<resourceName>

io.restorecommerce.<resource>.<resourceName>

List of \<resourceName> to be created or updated

Delete

io.restorecommerce.resourcebase.DeleteRequest

google.protobuf.Empty

List of resource IDs to be deleted

For detailed fields of protobuf messages io.restorecommerce.resourcebase.ReadRequest and io.restorecommerce.resourcebase.DeleteRequest refer resource-base-interface.

Graph Operations

Method Name Request Type Response Type Description

Traversal

io.restorecommerce.graph.TraversalRequest

io.restorecommerce.graph.TraversalResponse

List of vertices and edges data traversed through the graph

For detailed fields of protobuf messages io.restorecommerce.graph.TraversalRequest and io.restorecommerce.graph.TraversalResponse refer resource-base-interface.

Events

Emitted

List of events emitted by this microservice for below topics:

Topic Name Event Name Description

io.restorecommerce.command

restoreResponse

system restore response

resetResponse

system reset response

healthCheckResponse

system health check response

versionResponse

system version response

Consumed

This microservice consumes messages for the following events by topic:

Topic Name Event Name Description

io.restorecommerce.command

restoreCommand

for triggering for system restore

resetCommand

for triggering system reset

healthCheckCommand

to get system health check

versionCommand

to get system version