7.3.3 • Published 6 years ago

muon-cli v7.3.3

Weekly downloads
215
License
-
Repository
github
Last release
6 years ago

|=== | Master Build | Stable | Snapshots | image:https://img.shields.io/teamcity/http/teamcity.simplicityitself.com/e/OpenSource_MuonReleases_TransportsDiscoveries_CliSnapshot.svg[Status] | image:https://img.shields.io/github/tag/muoncore/muon-cli.svg[] | image:https://img.shields.io/npm/v/muon-cli/next.svg[NPM] |===

Muon CLI

installs a command line tool to interact with Muon systems

Getting Started

The CLI is currently hardcoded to include the link:http://github.com/muoncore/muon-amqp[AMQP transport/ discovery]

sudo npm install -g muon-cli@next
export MUON_URL=<your muon trasnport url, eg: amqp://muon:microservices@localhost:5672>
muon discover

And, if you've got the MUON_URL variable set correctly to a RabbitMQ hosting a muon instance, you should see something like this:

user@machine ~ $ export MUON_URL=amqp://muon:microservices@localhost:5672
user@machine ~ $ muon discover     [ or muon d ]
OK: muon cli connected: amqp://muon:microservices@localhost:5672
┌──────────────────────────────┬──────────────────────────────┬──────────────────────────────┐
│ SERVICE NAME                 │ TAGS                         │ CONTENT/TYPE                 │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ muon-dev-tools               │ node,muon-dev-tools          │ application/json             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ muon-cli-99040de5-f948-48f3… │ node,muon-cli-99040de5-f948… │ application/json             │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
user@machine ~ $

Muon RPC from the cli

As provided by the link:http://github.com/muoncore/stack-rpc[RPC Stack]

first, run the muon-node examples service. To do this, checkout the muon-node github project:

git clone https://github.com/microserviceux/muon-node.git
cd muon-node
./examples/run-dev-tools-server.sh

Now run some rpc commands against the examples service:

muon rpc rpc://muon-dev-tools/echo "I LOVE muon"
OK: muon cli connected: amqp://muon:microservices@localhost:5672
┌────────────┬──────────────────────────────┬────────────────────────────────────────────────────────────┐
│ STATUS     │ CONTENT/TYPE                 │ BODY                                                       │
├────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────┤
│ 200        │ application/json             │ I LOVE muon                                                │
└────────────┴──────────────────────────────┴────────────────────────────────────────────────────────────┘
user@machine ~ $
muon rpc rpc://muon-dev-tools/ping "ping"
OK: muon cli connected: amqp://muon:microservices@localhost:5672
┌────────────┬──────────────────────────────┬────────────────────────────────────────────────────────────┐
│ STATUS     │ CONTENT/TYPE                 │ BODY                                                       │
├────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────┤
│ 200        │ application/json             │ pong                                                       │
└────────────┴──────────────────────────────┴────────────────────────────────────────────────────────────┘
muon rpc rpc://muon-dev-tools/uuid
OK: muon cli connected: amqp://muon:microservices@localhost:5672
┌────────────┬──────────────────────────────┬────────────────────────────────────────────────────────────┐
│ STATUS     │ CONTENT/TYPE                 │ BODY                                                       │
├────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────┤
│ 200        │ application/json             │ 1233a532-6216-481b-816b-7fab09802072                       │
└────────────┴──────────────────────────────┴────────────────────────────────────────────────────────────┘
muon rpc rpc://muon-dev-tools/random
OK: muon cli connected: amqp://muon:microservices@localhost:5672
┌────────────┬──────────────────────────────┬────────────────────────────────────────────────────────────┐
│ STATUS     │ CONTENT/TYPE                 │ BODY                                                       │
├────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────┤
│ 200        │ application/json             │ 61249                                                      │
└────────────┴──────────────────────────────┴────────────────────────────────────────────────────────────┘

Introspection

Introspection is a feature in Muon Core. It enables you to connect to a remote service and query its capabilities int erms of the protocol stacks available, the endpoints they provide and the schemas you can use to interact with them.

If you have an instance of photon connected to your muon transport, you can query the photon service like so:

muon i photon
OK: muon cli connected: amqp://tfadmin:techfutu13@msg.cistechfutures.net
{ serviceName: 'photon',
  protocols:
   [ { protocolScheme: 'rpc',
       protocolName: 'Request/ Response Protocol',
       description: 'Make a single request, get a single response',
       operations: [Object] },
     { protocolScheme: 'introspect',
       protocolName: 'Introspection Protocol',
       description: 'Provides the ability to introspect services to derive their capabilities. Built into most Muon implementations',
       operations: [] },
     { protocolScheme: 'reactive-stream',
       protocolName: 'Reactive Streaming',
       description: 'Provides the semantics of the Reactive Stream API over a muon event protocol',
       operations: [Object] },
     { protocolScheme: 'event',
       protocolName: 'Event Sink Protocol',
       description: 'Provides a discoverable sink for events to flow into without needing explicit service endpoints',
       operations: [] } ] }

License

All code is Copyright (c) Muon Core Ltd 2017.

Muon is Free Software, licensed under the terms of the LGPLv3 license as included in link:LICENSE[]

Muon has a commercial-friendly license allowing private forks and closed modifications of all projects, alongside enterprise support and extended support for enterprise technologies and patterns.

This will enable you to use Muon in any situation where your legal team will not accept a Free Software license.

Please see http://muoncore.io/pro/ for more detail. You can find the commercial license terms in COMM-LICENSE.

7.3.3

6 years ago

7.3.1-30

6 years ago

7.3.1-29

6 years ago

7.3.1-28

7 years ago

7.3.1-27

7 years ago

7.3.1-25

7 years ago

7.3.1-24

7 years ago

7.3.1-23

7 years ago

7.3.1-22

7 years ago

7.3.1-21

7 years ago

7.3.1-20

7 years ago

7.3.1-19

7 years ago

7.3.1-18

7 years ago

7.3.1-17

7 years ago

7.3.1-16

7 years ago

7.3.1-15

7 years ago

7.3.1-14

7 years ago

7.3.1-13

7 years ago

7.3.1-12

7 years ago

7.3.1-11

7 years ago

7.3.1-10

7 years ago

7.3.1-9

7 years ago

7.3.1-8

7 years ago

7.3.1-7

7 years ago

7.3.1-6

7 years ago

7.3.1-5

7 years ago

7.3.1-4

7 years ago

7.3.1-3

7 years ago

7.3.1-2

7 years ago

7.3.1-1

7 years ago

7.3.1-0

7 years ago

7.2.5

7 years ago

7.2.4

7 years ago

7.2.3

7 years ago

7.1.22

7 years ago

7.1.18

7 years ago

7.1.16

7 years ago

7.1.5

8 years ago

7.1.4

8 years ago

7.1.3

8 years ago

7.1.1

8 years ago

7.0.34

8 years ago

7.0.33

8 years ago

7.0.19

8 years ago

7.0.18

8 years ago

7.0.17

8 years ago

7.0.10

8 years ago

7.0.8

8 years ago

7.0.6

8 years ago

7.0.5

8 years ago

7.0.3

8 years ago

7.0.2

8 years ago

7.0.1

8 years ago