Edge Infrastructure Manager API
Table of Contents
Overview
This sub-repository contains the implementation of the Northbound APIs for Edge Infrastructure Manager, the OpenAPI
definitions and the auto-generated golang code which can be used in other components as well as external projects to
do API calls using native golang code.
Additionally, the repo contains the Edge Infrastructure Manager Integration Tests which are used as sanity tests to
evaluate a new release.
Features
- REST APIs with Role based access control (RBAC);
- Stateless service with the capability to be horizontally scaled;
- Adapts user oriented abstractions to/from Protobuf resources which are consumed by
Inventory and by other Edge Infrastructure Manager components;
- Built with the support for Multitenancy;
- Flexible deployments that span from a standalone binary to container-based orchestrations.
Get Started
Instructions on how to install and set up the API on your development machine.
Dependencies
Firstly, please verify that all dependencies have been installed.
# Return errors if any dependency is missing
make dependency-check
This code requires the following tools to be installed on your development machine:
You can install Go dependencies by running make go-dependency.
Build the Binary
Build the project as follows:
# Build go binary
make build
The binary is installed in the $OUT_DIR folder.
Usage
NOTE: This guide shows how to deploy API for local development or testing. For production deployments use the
Edge Infrastructure Manager charts.
make run
# Or
make go-run
See the documentation if you want to learn more about using Edge Orchestrator.
Contribute
To learn how to contribute to the project, see the contributor's guide. The project will
accept contributions through Pull-Requests (PRs). PRs must be built successfully by the CI pipeline, pass linters
verifications and the unit tests.
There are several convenience make targets to support developer activities, you can use help to see a list of makefile
targets. The following is a list of makefile targets that support developer activities:
generate to generate the API definitions and Golang bindings
lint to run a list of linting targets
test to run the API unit test
go-tidy to update the Go dependencies and regenerate the go.sum file
build to build the project and generate executable files
docker-build to build the API Docker container
See the docs for advanced development topics:
To learn more about internals and software architecture, see
Edge Infrastructure Manager developer documentation.
Using API
To use API code as library in other applications check the folder pkg, it contains the list of the
exported packages.
API auto-generated clients are available under pkg/api/v0. Other bindings can be generated using
the OAPI definition, see the documentation for your
language of preference.
Integration tests
To run the integration tests for API, please refer to this README. We also provide useful make
targets to run the integration tests (int-test*).