This article describes the installation of a command-line tool to control Morpheus via its API. A simple example of rebooting a VM is demonstrated.
As a root user, please follow the below steps,
# curl -sSL https://rvm.io/pkuczynski.asc | sudo gpg2 --import -
# curl -sSL https://get.rvm.io | bash -s stable --rails
# source /usr/local/rvm/scripts/rvm
# gem install morpheus-cli
# morpheus remote add
Name: EUM HCMP
URL: https://hcmp.icsi.eumetsat.int
Added remote EUM HCMP
Inspecting remote appliance https://hcmp.icsi.eumetsat.int ...
Status is: READY
Would you like to login now? (yes/no) [yes]: yes
Enter Morpheus Credentials for EUM HCMP - https://hcmp.icsi.eumetsat.int
Username: | USERNAME
Password: | PASSWORD
Success! Logged in to EUM HCMP as USERNAME.
# morpheus login -r 'EUM HCMP' -u 'USERNAME' -p 'PASSWORD'
# morpheus instances restart testvm -y
Restarting instance testvm
# morpheus instances get testvm
Instance Details
==================
ID: 5103
Name: testvm
Description:
Group: VIOGRP
Cloud: GPD
Type: Centos ECMWF
Layout: Centos-ECMWF-RAW
Version: Centos-ECMWF-RAW
Plan: s2.medium.1
Environment:
Tags:
Metadata:
Power Schedule:
Created By: ezzat
Date Created: 02/11/20 10:53 AM
Nodes: 1
Connection: 192.168.0.124:
Status: RESTARTING
Instance Usage
---------------------
CPU:[| ] 0.65%
Memory: [|||||||||||| ] 23.58% 228.10 MiB / 967.37 MiB
Storage: [|||||||||| ] 18.71% 1.87 GiB / 10.00 GiB
Please find the complete CLI documentation here: https://github.com/gomorpheus/morpheus-cli/wiki/CLI-Manual |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|