Skip to content
/ go-cti Public

An implementation of CTI Types & Instances (CTI) specification in Go.

License

Notifications You must be signed in to change notification settings

acronis/go-cti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTI Types & Instances management tool and library

What is CTI Types & Instances?

CTI Types and Instances (CTI) is a technology that provides a unified, vendor-agnostic way to define and uniquely identify types and instances, extend and package them. With CTI, types and instances are identified by CTI Typed Identifier that is associated with a particular entity.

What does this project provide?

The project provides the following:

  • An extensible library that provides interfaces for:
    • A parser for RAMLx files that are extended with CTI specification.
    • CTI package management to work with dependent packages in other Github repositories.
    • A validator for compiled CTI entities.
  • A CLI tool that is ready to use with CTI packages and implements functionality according to the interface.

How the technology is used

CTI Types and Instances (CTI) technology is utilized by Acronis Cyber Application technology that allows third-party ISVs (application vendors) to extend Acronis Cyber Protect Cloud platform (the platform) by:

  • Bringing new object types and APIs to the system.
  • Extending the platform base domain model types (like types of tenants, alerts, events, protection plans) by new inherited types.
  • Enforce granular access to the objects of different types for the API clients.

With CTI Typed Identifier, the following entities become explicitly defined and linked to corresponding entities:

  • Domain object types, i.e. object schemas like tenants, alerts, protection plans, etc.
  • Well-known object instances, like event topics, namespaces, groups.

To describe types and instances that are associated with the CTI identifiers, RAMLx is used.

Installation

Library

go get -u github.com/acronis/go-cti

CLI

go install github.com/acronis/go-cti/cmd/cti@latest

CLI Reference

Note

By default, all commands are executed in the current working directory. You can use the global --working-dir argument to specify the working directory if necessary.

cti init

Initializes a CTI package. Writes index.json and .ramlx folder with CTI specification files for RAMLx.

Example:

cti init

cti pkg get

cti pkg get <git_remote>@<git_ref>

Fetches the package from the specified git remote and append package in the dependencies list of current component.

Example:

cti pkg get github.com/acronis/sample-package@v1

cti validate

Parses and validates the package against RAMLx.

Example:

cti validate

cti pack

Packs the package into a bundle. Valid package should be in current working directory (or directory specified by --working-dir).

Example:

> cti pack --include-source --format zip --prefix output --output=sample-package.cti

> ls output
sample-package.cti

--include-source

Includes the source files into the bundle. By default, the source files are not included. Hidden files (starting with a dot) are not included in the bundle.

--format

The format of the output bundle. Supported formats are zip and tgz. Default is tgz.

--prefix

The directory where the output bundle will be saved. Default is ..

--output

The name of the output bundle. Default is bundle.cti. Please note that the extension is not added automatically.