datahub_mim_cli

package module
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

MIMIRO Data Hub CLI - mim

The MIMIRO Data Hub CLI, known as mim, provides command line control over a MIMIRO data hub instance or any Universal Data Specification (UDA) compliant endpoint.

The mim client can be used to script and interact with MIMIRO to create datasets, load data, register jobs, test and execute transforms and queries.

mim provides an extensive set of command help that can be accessed by typing:

mim help 

and for specific commands:

mim help COMMAND 

e.g.

mim help datasets

More documentation on use can be found in the MIMIRO data hub docs.

Build

Requires Go version 1.15 or later.

make mim

Installation

Use make mim to produce a binary in bin/mim. It is recommended to add the bin folder to your system's PATH so that the mim command is globally available.

Releases

If you want a pre-built binary then this can be obtained from the releases page. Download the correct version, make sure it is renamed to mim locally, and that it is on the path.

Connecting

mim can be used to connect to the MIMIRO data hub, MIMIRO data layers or any other UDA compliant endpoint.

It is recommended to create an alias for each distinct service endpoint you want to connect to. To setup and connection to a local unsecured MIMIRO data hub instance create the following login alias:

mim login add --alias local --server http://localhost:8080 --type unsecured

To see all registered aliases and where they connect to use:

mim login ls

To connect to a service that has been secured with JWT tokens there are two options, either providing the JWT token as part of the alias definition or configuring OAuth authentication. This will depend on the service and you should check with the service documentation on how to connect.

Configuring to use a token directly:

mim login add --alias server1 \ 
              --server="https://my.datahub.server" \
              --token="<valid token>" 

Configuring to use an OAuth Token provider:

mim login add
       --alias local \
       --server "https://datahubapi.example.io" \
       --clientId "<valid clientId>" \
       --clientSecret "<valid clientSecret>" \
       --authorizer "https://auth.example.io/oauth/token" \
       --audience "https://datahubapi.example.io"

An OAuth configured alias will (re)authenticate and retrieve a token when needed.

Contributing

The MIMIRO data hub cli project welcomes contributions and constructive engagement, please read our code of conduct and contributing guidelines before creating issues or making PRs.

Change Log

We try and keep the change log up-to-date.

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "mim",
	Short: "MIMIRO Data Hub CLI",
	Long:  `MIMIRO Data Hub CLI`,
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			cmd.Usage()
			os.Exit(0)
		}
	},
}

rootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Directories

Path Synopsis
cmd
cli
internal
acl
web
pkg
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL