Orbital CLI Project
This project is a utility to assist with the deployment and implementation of the Orbital Bus constructed by Foci Solutions. Using this project, you can generate template files and ultimately actual code libraries necessary for the deployment of an Orbital agent module.
How to create a service
Create a Service
Open a terminal where you want to create your service.
orbital create:service ServiceName
This will create a directory with the name provided,
ServiceName, and a
.orbital file that will look like.
If the addresses and/or ports for Consul or RabbitMQ are different from the above, change them.
Create an Operation
Now is the time to create an operation. For the purpose of this example we will create just one operation.
Go to the
ServiceName folder and run the following command
orbital create:operation OperationName -a Adapter.Rest -s
It will create the following folder structure
ServiceName |___ OperationName | |__adapterConfigurations | |__adapterConfig.json | |__schemas | |__request.json | |__response.json | |__translations | |__translation.js |___.orbital
OperationName folder, we will modify the following:
adapterConfigurations, you will open
adapterConfig.json and should look like this:
Here you will write in the
uri section to indicate the endpoint you want to reach and add or modify other sections to comply with the requisits the endpoint asks to be able to get a response back.
response.json schema should look like this:
You will accomodate the schemas to the properties you need to receive or send.
translations looks like:
Build the Service
Still inside the
ServiceName folder, you will write the following command:
This command will create a
bin folder with a
ServiceDefinition.json file. This file will be used by the Agent to know about the services you create.
Publish the Service
Finally you will run the following command to publish your new service to Consul and RabbitMQ:
you can check out Consul to verify that your
ServiceName service and
orbital.ServiceName.definition K/V are there.
Orbital CLI is licensed under the 3-Clause BSD license for open-source software. Please see the LICENSE file for more information.
For inquiries about the project, please e-mail us at firstname.lastname@example.org.