-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package get | ||
|
||
import ( | ||
"log" | ||
|
||
mctl "github.com/metal-toolbox/mctl/cmd" | ||
"github.com/metal-toolbox/mctl/internal/app" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type getBomInfoByAocMacAddressFlags struct { | ||
macAddr string | ||
} | ||
|
||
var ( | ||
flagsGetBomByAocMacAddress *getBomInfoByAocMacAddressFlags | ||
) | ||
|
||
var getBomInfoByAocMacAddress = &cobra.Command{ | ||
Use: "aocmacaddress", | ||
Short: "Get bom object by aocMacAddr", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
theApp := mctl.MustCreateApp(cmd.Context()) | ||
|
||
client, err := app.NewServerserviceClient(cmd.Context(), theApp.Config.Serverservice, theApp.Reauth) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
bomInfo, _, err := client.GetBomInfoByAOCMacAddr(cmd.Context(), flagsGetBomByAocMacAddress.macAddr) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
writeResults(bomInfo) | ||
}, | ||
} | ||
|
||
func init() { | ||
flagsGetBomByAocMacAddress = &getBomInfoByAocMacAddressFlags{} | ||
|
||
getBomInfoByAocMacAddress.PersistentFlags().StringVar(&flagsGetBomByAocMacAddress.macAddr, "get-bom-by-aoc-mac-address", "", "get bom info by aocMacAddr") | ||
|
||
if err := getBomInfoByAocMacAddress.MarkPersistentFlagRequired("get-bom-by-aoc-mac-address"); err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package get | ||
|
||
import ( | ||
"log" | ||
|
||
mctl "github.com/metal-toolbox/mctl/cmd" | ||
"github.com/metal-toolbox/mctl/internal/app" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type getBomInfoByBmcMacAddressFlags struct { | ||
macAddr string | ||
} | ||
|
||
var ( | ||
flagsGetBomByBmcMacAddress *getBomInfoByBmcMacAddressFlags | ||
) | ||
|
||
var getBomInfoByBmcMacAddress = &cobra.Command{ | ||
Use: "bmcmacaddress", | ||
Short: "Get bom object by bmcMacAddr", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
theApp := mctl.MustCreateApp(cmd.Context()) | ||
|
||
client, err := app.NewServerserviceClient(cmd.Context(), theApp.Config.Serverservice, theApp.Reauth) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
bomInfo, _, err := client.GetBomInfoByBMCMacAddr(cmd.Context(), flagsGetBomByBmcMacAddress.macAddr) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
writeResults(bomInfo) | ||
}, | ||
} | ||
|
||
func init() { | ||
flagsGetBomByBmcMacAddress = &getBomInfoByBmcMacAddressFlags{} | ||
|
||
getBomInfoByBmcMacAddress.PersistentFlags().StringVar(&flagsGetBomByBmcMacAddress.macAddr, "get-bom-by-bmc-mac-address", "", "get bom info by bmcMacAddr") | ||
|
||
if err := getBomInfoByBmcMacAddress.MarkPersistentFlagRequired("get-bom-by-bmc-mac-address"); err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[Auto generated by spf13/cobra]: <> | ||
|
||
## mctl get aocmacaddress | ||
|
||
Get bom object by aocMacAddr | ||
|
||
``` | ||
mctl get aocmacaddress [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--get-bom-by-aoc-mac-address string get bom info by aocMacAddr | ||
-h, --help help for aocmacaddress | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string config file (default is $XDG_CONFIG_HOME/mctl/config.yml) | ||
-o, --output string {json|text} (default "json") | ||
--reauth re-authenticate with oauth services | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [mctl get](mctl_get.md) - Get resource | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[Auto generated by spf13/cobra]: <> | ||
|
||
## mctl get bmcmacaddr | ||
|
||
Gets bom object by bmcMacAddr | ||
|
||
``` | ||
mctl get bmcmacaddr [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--get-bom-by-bmc-mac-address string get bom info by bmcMacAddr | ||
-h, --help help for bmcmacaddr | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string config file (default is $XDG_CONFIG_HOME/mctl/config.yml) | ||
-o, --output string {json|text} (default "json") | ||
--reauth re-authenticate with oauth services | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [mctl get](mctl_get.md) - Get resource | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[Auto generated by spf13/cobra]: <> | ||
|
||
## mctl get bmcmacaddress | ||
|
||
Get bom object by bmcMacAddr | ||
|
||
``` | ||
mctl get bmcmacaddress [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--get-bom-by-bmc-mac-address string get bom info by bmcMacAddr | ||
-h, --help help for bmcmacaddress | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string config file (default is $XDG_CONFIG_HOME/mctl/config.yml) | ||
-o, --output string {json|text} (default "json") | ||
--reauth re-authenticate with oauth services | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [mctl get](mctl_get.md) - Get resource | ||
|