Git Product home page Git Product logo

ngsi-go's Introduction

Let's FIWARE Banner NGSI v2 NGSI LD

FIWARE: Tools License: MIT GitHub all releases Support badge
GitHub top language Lines of code Lint Go Report Card
Build Unit Tests Coverage Status E2E tests
Docs Dockerfile CII Best Practices

The NGSI Go is a command-line interface supporting FIWARE Open APIs for FIWARE developers.

๐Ÿ“š Documentation ๐ŸŽฏ Roadmap

Contents

Details

What is NGSI Go?

"Brave (hero), bearer of the blood of Erdrick, hero of legend! Know that your weapon will not serve to vanquish the Dragonload."

โ€” DRAGON WARRIOR (DRAGON QUEST)

The NGSI Go is a command-line interface supporting FIWARE Open APIs, which simplifies syntax. It's a powerful tool and easy to use. It has various features as shown:

  • Supported FIWARE Open APIs
  • Various convenience commands
    • NGSI commands to manage NGSI Entity, subscription, registration and so on
    • Time series commands to manage historical data
    • IoT Agent commands to manage IoT Agent Provision API
    • Rules commands to manage Context-Aware CEP
    • WireCloud command to manage Application Mashup RESTful API
    • Convenience commands
      • Print version, health-check status and API lists of FIWARE GEs
      • Admin command for FIWARE Orion
      • Copy and remove entities at once
      • Create template of subscription or registration
      • Notification receiver
      • Registration proxy
    • Management commands
      • Broker alias or server alias with API endpoint URL, FIWARE Service and FIWARE ServicePath
      • Manage @context
      • Integrated oauth token management
  • Compatible with a number of traditional UNIX commands for filtering text
  • A single binary program written in Golang

Getting Started with NGSI Go

You register an alias to access the broker.

ngsi broker add --host letsfiware --brokerHost http://localhost:1026 --ngsiType v2

You can get the version by using the alias letsfiware.

ngsi version -h letsfiware
{
"orion" : {
  "version" : "3.1.0",
  "uptime" : "0 d, 0 h, 0 m, 10 s",
  "git_hash" : "260505c911ecf204ebcf0bd31788013c225da6dd",
  "compile_time" : "Wed Jun 9 12:59:59 UTC 2021",
  "compiled_by" : "root",
  "compiled_in" : "e11ec65d5407",
  "release_date" : "Wed Jun 9 12:59:59 UTC 2021",
  "machine" : "x86_64",
  "doc" : "https://fiware-orion.rtfd.io/en/3.1.0/",
  "libversions": {
     "boost": "1_66",
     "libcurl": "libcurl/7.61.1 OpenSSL/1.1.1g zlib/1.2.11 nghttp2/1.33.0",
     "libmicrohttpd": "0.9.70",
     "openssl": "1.1",
     "rapidjson": "1.1.0",
     "mongoc": "1.17.4",
     "bson": "1.17.4"
  }
}
}

Once you access the broker, you can omit to specify the broker.

ngsi version

If you want to check the current settings, you can run the following command.

ngsi settings list

Usage

NAME:
   ngsi - command-line tool for FIWARE NGSI and NGSI-LD

USAGE:
   ngsi [global options] command [command options] [arguments...]

VERSION:
   0.9.0 (git_hash:bfd1ec240a8a8421929e2923f8fb5d3f6cab18ab)

COMMANDS:
   help, h  Shows a list of commands or help for one command
   APPLICATION MASHUP:
     preferences  manage preferences for WireCloud
     macs         manage mashable application components for WireCloud
     workspaces   manage workspaces for WireCloud
     tabs         manage tabs for WireCloud
   CONVENIENCE:
     admin       admin command for FIWARE Orion, Cygnus, Perseo, Scorpio
     apis        print endpoints of API
     cp          copy entities
     wc          print number of entities, subscriptions, registrations or types
     man         print urls of document
     health      print health status
     ls          list entities
     queryproxy  query proxy
     rm          remove entities
     receiver    notification receiver
     regproxy    registration proxy
     template    create template of subscription or registration
     tokenproxy  token proxy
     version     print the version
   Context-Aware CEP:
     rules  rules command for PERSEO
   IoT Agent:
     devices   manage devices for IoT Agent
     services  manage services for IoT Agent
   Keyrock:
     applications   manage applications for Keyrock
     users          manage users for Keyrock
     organizations  manage organizations for Keyrock
     providers      print service providers for Keyrock
   MANAGEMENT:
     broker    manage config for broker
     context   manage @context
     settings  manage settings
     server    manage config for server
     token     manage token
   NGSI:
     append   append attributes
     create   create entity(ies), subscription, registration or ldContext
     delete   delete entity(ies), attribute, subscription, registration or ldContext
     get      get entity(ies), attribute(s), subscription, registration type or ldContext
     list     list types, attributes, entities, tentities, subscriptions or registrations
     replace  replace entities or attributes
     update   update entities, attribute(s) or subscription
     upsert   upsert entity or entities
   PERSISTING CONTEXT DATA:
     namemappings   manage namemappings for Cygnus
     groupingrules  manage groupingrules for Cygnus
   TIME SERIES:
     hdelete  delete historical raw and aggregated time series context information
     hget     get historical raw and aggregated time series context information

GLOBAL OPTIONS:
   --syslog LEVEL        specify logging LEVEL (off, err, info, debug)
   --stderr LEVEL        specify logging LEVEL (off, err, info, debug)
   --config FILE         specify configuration FILE
   --cache FILE          specify cache FILE
   --batch, -B           don't use previous args (batch) (default: false)
   --insecureSkipVerify  TLS/SSL skip certificate verification (default: false)
   --help                show help (default: false)
   --version, -v         print the version (default: false)

COPYRIGHT:
   (c) 2020-2021 Kazuhito Suda

Tutorial

You can try the tutorial to understand how to use the NGSI Go. You need a environment running Docker engine and docker-compose.

Install

Install NGSI Go binary

The NGSI Go binary is installed in /usr/local/bin.

Installation on Linux

curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.9.0/ngsi-v0.9.0-linux-amd64.tar.gz
sudo tar zxvf ngsi-v0.9.0-linux-amd64.tar.gz -C /usr/local/bin

ngsi-v0.9.0-linux-arm.tar.gz and ngsi-v0.9.0-linux-arm64.tar.gz binaries are also available.

Installation on Mac

curl -OL https://github.com/lets-fiware/ngsi-go/releases/download/v0.9.0/ngsi-v0.9.0-darwin-amd64.tar.gz
sudo tar zxvf ngsi-v0.9.0-darwin-amd64.tar.gz -C /usr/local/bin

ngsi-v0.9.0-darwin-arm64.tar.gz binary is also available.

Install bash autocomplete file for NGSI Go

Install ngsi_bash_autocomplete file in /etc/bash_completion.d.

curl -OL https://raw.githubusercontent.com/lets-fiware/ngsi-go/main/autocomplete/ngsi_bash_autocomplete
sudo mv ngsi_bash_autocomplete /etc/bash_completion.d/
source /etc/bash_completion.d/ngsi_bash_autocomplete
echo "source /etc/bash_completion.d/ngsi_bash_autocomplete" >> ~/.bashrc

Third party packages

The NGSI Go makes use of the following package:

Package OSS License
urfave/cli MIT License

The dependencies of dependencies have been omitted from the list.

Copyright and License

Copyright (c) 2020-2021 Kazuhito Suda
Licensed under the MIT License.

ngsi-go's People

Contributors

fisuda avatar github-actions[bot] avatar fgalan avatar modulartaco avatar siedlerchr avatar jason-fox avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.