Luna 2 CLI is a part of the Luna 2 Project.
Luna 2 CLI is a Command Line Interface, And used to interact with Luna 2 Daemon over Microservices.
It will use REST API's to communicate to the daemon.
Luna2 CLI's Prime location is Cluster, but also can be installed on the nodes.
pip install luna
- -h or --help can be run anywhere to see the required parameters.
 - -R or --raw will be useful to see the data in json while using list or show arguments.
 - -V or --version will be useful to see the current version of Luna.
 - -V or --version will be useful to see the current version of Luna.
 - -v or --verbose will be useful for debugging purpose.
 - Log File location -> /var/log/luna/luna2-cli.log
 
- Detailed view of cluster and controllers
 
luna cluster
- Make change in Cluster information.
 
luna cluster change -n {Cluster Name} -u {Cluster User} -ntp {NTP Server IP} -o {Create Node On Demand} -ns {Name_Server IP} -fs {Forward_Server IP} -c {Technical Contact} -pm {Provision Method} -pf {Provision Fallback} -s {Security} -d {Debug Mode}
- List of all configured networks
 
luna network list
- Detailed view of a network
 
luna network show {Network Name}
- Add a network.
 
luna network add {Network Name} -N {Network} -g {Gateway} -nsip {NS IP} -ntp {NTP Server IP} -dhcp {DHCP} -ds {DHCP Range Start} -de {DHCP Range End} -c {Comment}
- Make change in network information.
 
luna network change {Network Name} -N {Network} -g {Gateway} -nsip {NS IP} -ntp {NTP Server IP} -dhcp {DHCP} -ds {DHCP Range Start} -de {DHCP Range End} -c {Comment}
- Clone a network.
 
luna network clone {Network Name} {New Network Name} -N {Network} -g {Gateway} -nsip {NS IP} -ntp {NTP Server IP} -dhcp {DHCP} -ds {DHCP Range Start} -de {DHCP Range End} -c {Comment}
- Rename a network.
 
luna network rename {Network Name} {New Network Name}
- Remove a network.
 
luna network remove {Network Name} 
- Get a Information of an IP, such as it is free or taken.
 
luna network ipinfo {Network Name} {IP Address}
- Get next available IP on the network.
 
luna network nextip {Network Name}
- List of all os images
 
luna osimage list
- Detailed view of a os images
 
luna osimage show {OSImage Name}
- Add a os images.
 
luna osimage add {OSImage Name} -dm {Dracut Modules} -gf {Grab Filesystem} -ge {Grab Filesystem} -rd {InitRD File} -k {Kernel File} -m {Kernel Modules} -o {Kernel Options} -var {Kernel Version} -p {Path Of Image} -tar {Tarball UUID} -t {Torrent UUID} -D {Distribution} -c {Comment}
- Make change in a os images.
 
luna osimage change {OSImage Name} -dm {Dracut Modules} -gf {Grab Filesystem} -ge {Grab Filesystem} -rd {InitRD File} -k {Kernel File} -m {Kernel Modules} -o {Kernel Options} -var {Kernel Version} -p {Path Of Image} -tar {Tarball UUID} -t {Torrent UUID} -D {Distribution} -c {Comment}
- Clone a os images.
 
luna osimage clone {OSImage Name} {New OSImage Name} -dm {Dracut Modules} -gf {Grab Filesystem} -ge {Grab Filesystem} -rd {InitRD File} -k {Kernel File} -m {Kernel Modules} -o {Kernel Options} -var {Kernel Version} -p {Path Of Image} -tar {Tarball UUID} -t {Torrent UUID} -D {Distribution} -c {Comment}
- Rename a os images.
 
luna osimage rename {OSImage Name} {New OSImage Name} 
- Remove a os images.
 
luna osimage remove {OSImage Name} 
- Pack a os images.
 
luna osimage pack {OSImage Name}
- Change Kernel in an os images.
 
luna osimage kernel {OSImage Name}  -rd {InitRD File} -k {Kernel File} -ver {Kernel Version}
- OS Image used by nodes.
 
luna osimage member {OSImage Name}
- List of all configured BMC Setup
 
luna bmcsetup list
- Detailed view of a BMC Setup
 
luna bmcsetup show {BMC Setup Name}
- Add a BMC Setup.
 
luna bmcsetup add {BMC Setup Name} -uid {User ID} -u {Username} -p {Password} -nt {Network Channel} -mt {Management Channel} -ubu {Unmanaged BMC Users} -c {Comment}
- Make change in BMC Setup.
 
luna bmcsetup change {BMC Setup Name} -uid {User ID} -u {Username} -p {Password} -nt {Network Channel} -mt {Management Channel} -ubu {Unmanaged BMC Users} -c {Comment}
- Clone a BMC Setup.
 
luna bmcsetup clone {BMC Setup Name} {New BMC Setup Name} -uid {User ID} -u {Username} -p {Password} -nt {Network Channel} -mt {Management Channel} -ubu {Unmanaged BMC Users} -c {Comment}
- Rename a BMC Setup.
 
luna bmcsetup rename {BMC Setup Name} {New BMC Setup Name}
- Remove a BMC Setup.
 
luna bmcsetup remove {BMC Setup Name} 
- BMC Setup used by nodes.
 
luna bmcsetup member {BMC Setup Name}
- List of all configured Switch
 
luna switch list
- Detailed view of a Switch
 
luna switch show {Switch Name}
- Add a Switch.
 
luna switch add {Switch Name} -N {Network} -ip {IP Address} -m {MAC Address} -r {Read Community} -w {Write Community} -o {OID} -c {Comment}
- Make change in a Switch.
 
luna switch change {Switch Name} -N {Network} -ip {IP Address} -m {MAC Address} -r {Read Community} -w {Write Community} -o {OID} -c {Comment}
- Clone a Switch.
 
luna switch clone {Switch Name} {New Switch Name} -N {Network} -ip {IP Address} -m {MAC Address} -r {Read Community} -w {Write Community} -o {OID} -c {Comment}
- Rename a Switch.
 
luna switch rename {Switch Name} {New Switch Name}
- Remove a Switch.
 
luna switch remove {Switch Name}
- List of all configured Other Devices
 
luna otherdev list
- Detailed view of a Other Device
 
luna otherdev show {Other Device Name}
- Add a Other Device.
 
luna otherdev add {Other Device Name} -N {Network} -ip {IP Address} -m {Mac Address} -c {Comment}
- Make change in a Other Device.
 
luna otherdev change {Other Device Name} -N {Network} -ip {IP Address} -m {Mac Address} -c {Comment}
- Clone a Other Device.
 
luna otherdev clone {Other Device Name} {New Other Device Name} -N {Network} -ip {IP Address} -m {Mac Address} -c {Comment}
- Rename a Other Device.
 
luna otherdev rename {Other Device Name} {New Other Device Name}
- Delete a Other Device.
 
luna otherdev delete {Other Device Name}
- List of all configured Group
 
luna group list
- Detailed view of a Group
 
luna group show {Group Name}
- Add a Group.
 
luna group add {Group Name} -b {BMC Setup} -bmc {BMC Setup Name} -D {Domain Name} -o {OS Image Name} -pre {Pre Script} -part {Part Script} -post {Post Script} -nb {Network Boot} -li {Local Install} -bm {Boot Menu} -pi {Provision Interface} -pm {Provision Method} -fb {Provision Fallback} -ubu {Unmanaged BMC Users} -if {Interface Name} -N {Interface Network Name} -O {Interface Options} -c {Comment}
- Make change in a Group.
 
luna group change {Group Name} -b {BMC Setup} -bmc {BMC Setup Name} -D {Domain Name} -o {OS Image Name} -pre {Pre Script} -part {Part Script} -post {Post Script} -nb {Network Boot} -li {Local Install} -bm {Boot Menu} -pi {Provision Interface} -pm {Provision Method} -fb {Provision Fallback} -ubu {Unmanaged BMC Users} -if {Interface Name} -N {Interface Network Name} -O {Interface Options} -c {Comment}
- Clone a Group.
 
luna group clone {Group Name} {New Group Name} -b {BMC Setup} -bmc {BMC Setup Name} -D {Domain Name} -o {OS Image Name} -pre {Pre Script} -part {Part Script} -post {Post Script} -nb {Network Boot} -li {Local Install} -bm {Boot Menu} -pi {Provision Interface} -pm {Provision Method} -fb {Provision Fallback} -ubu {Unmanaged BMC Users} -if {Interface Name} -N {Interface Network Name} -O {Interface Options} -c {Comment}
- Rename a Group.
 
luna group rename {Group Name} {New Group Name}
- Remove a Group.
 
luna group remove {Group Name}
- Get a list of all Group Interfaces of a group.
 
luna group listinterface {Group Name}
- Get a Detail of a Interface of a group.
 
luna group showinterface {Group Name} {Interface Name}
- Make change in a Group Interface.
 
luna group changeinterface {Group Name} {Interface Name} -N {Network Name} -O {Interface Options}
- Remove a Group Interface.
 
luna group removeinterface {Group Name} {Interface Name}
- Group used by nodes.
 
luna group member {Group Name}
- List of all configured Node
 
luna node list
- Detailed view of a Node
 
luna node show {Node Name}
- Add a Node.
 
luna node add {Node Name} -host {Hostname} -g {Group Name} -o {OSImage Name} -b {BMC Setup} -bmc {BMC Setup Name} -sw {Switch Name} -sp {Switch Port} -pre {Pre Script} -part {Part Script} -post {Post Script} -pi {Provision Interface} -pm {Provision Method} -fb {Provision Fallback} -nb {Network Boot} -li {Local Install} -bm {Boot Menu} -lb {Local Boot} -s {Status} -tid {TPM UUID} -tkey {TPM Public Key} -tsha {TPM SHA256} -ubu {Unmanaged BMC Users} -c {Comment}-if {Interface Name} -N {Interface Network Name} -I {Interface IP Address} -M {Interface MAC Address} -O {Interface Options}
- Make change in a Node.
 
luna node change {Node Name} -host {Hostname} -g {Group Name} -o {OSImage Name} -b {BMC Setup} -bmc {BMC Setup Name} -sw {Switch Name} -sp {Switch Port} -pre {Pre Script} -part {Part Script} -post {Post Script} -pi {Provision Interface} -pm {Provision Method} -fb {Provision Fallback} -nb {Network Boot} -li {Local Install} -bm {Boot Menu} -lb {Local Boot} -s {Status} -tid {TPM UUID} -tkey {TPM Public Key} -tsha {TPM SHA256} -ubu {Unmanaged BMC Users} -c {Comment}-if {Interface Name} -N {Interface Network Name} -I {Interface IP Address} -M {Interface MAC Address} -O {Interface Options}
- Clone a Node.
 
luna node clone {Node Name} {New Node Name} -host {Hostname} -g {Group Name} -o {OSImage Name} -b {BMC Setup} -bmc {BMC Setup Name} -sw {Switch Name} -sp {Switch Port} -pre {Pre Script} -part {Part Script} -post {Post Script} -pi {Provision Interface} -pm {Provision Method} -fb {Provision Fallback} -nb {Network Boot} -li {Local Install} -bm {Boot Menu} -lb {Local Boot} -s {Status} -tid {TPM UUID} -tkey {TPM Public Key} -tsha {TPM SHA256} -ubu {Unmanaged BMC Users} -c {Comment}-if {Interface Name} -N {Interface Network Name} -I {Interface IP Address} -M {Interface MAC Address} -O {Interface Options}
- Rename a Node.
 
luna node rename {Node Name} {New Node Name}
- Remove a Node.
 
luna node remove {Node Name}
- Get a list of all Node Interfaces of a node.
 
luna node listinterface {Node Name}
- Get a Detail of a Interface of a node.
 
luna node showinterface {Node Name} {Interface Name}
- Make change in a Node Interface.
 
luna node changeinterface {Node Name} {Interface Name} -N {Network Name} -I {IP Address} -M {MAC Address} -O {Interface Options}
- Remove a Node Interface.
 
luna node removeinterface {Node Name} {Interface Name}
- List of all Secrets
 
luna secrets list
- List of all Node Secrets OR One Secret by name
 
luna secrets list node {Node Name} -s {Secret Name}
- List of all Group Secrets OR One Secret by name
 
luna secrets list group {Group Name} -s {Secret Name}
- Details of all Node Secrets OR One Secret by name
 
luna secrets show node {Node Name} -s {Secret Name}
- Details of all Group Secrets OR One Secret by name
 
luna secrets show group {Group Name} -s {Secret Name}
- Change of all Node Secrets OR One Secret by name
 
luna secrets change node {Node Name} -s {Secret Name} -c {Content} -p {Path}
- Change of all Group Secrets OR One Secret by name
 
luna secrets change group {Group Name} -s {Secret Name} -c {Content} -p {Path}
- Clone a Node Secret.
 
luna secrets clone node {Node Name} {Secret Name} {New Secret Name} -c {Content} -p {Path}
- Clone a Group Secret.
 
luna secrets clone group {Group Name} {Secret Name} {New Secret Name} -c {Content} -p {Path}
- Delete a Node Secret.
 
luna secrets delete node {Node Name} {Secret Name}
- Delete a Group Secret.
 
luna secrets delete group {Group Name} {Secret Name} 
- Perform action on DHCP Service
 
luna service dhcp {start/stop/restart/reload/status}
- Perform action on DNS Service
 
luna service dns {start/stop/restart/reload/status}
- Perform action on Luna 2 Daemon Service
 
luna service luna2 {start/stop/restart/reload/status}
- Check Node(s) power status
 
luna control power status {NodeName OR NodeList}
- Power ON Node(s)
 
luna control power on {NodeName OR NodeList}
- Power OFF Node(s)
 
luna control power off {NodeName OR NodeList}