mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Add support for storage command and crawler output
Partially addresses issue #3 by adding a simple `magellan list devices` command to list storage devices. To close the issue, this PR still requires including storage device information in the `crawler`'s output. Reviewed-on: towk/magellan-ng#5
This commit is contained in:
parent
6deb292494
commit
12969adf25
20 changed files with 448 additions and 53 deletions
|
|
@ -97,6 +97,7 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams, store secret
|
|||
var (
|
||||
systems []crawler.InventoryDetail
|
||||
managers []crawler.Manager
|
||||
storage []crawler.Storage
|
||||
config = crawler.CrawlerConfig{
|
||||
URI: uri,
|
||||
CredentialStore: params.SecretStore,
|
||||
|
|
@ -116,6 +117,11 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams, store secret
|
|||
log.Error().Err(err).Str("uri", uri).Msg("failed to crawl BMC for managers")
|
||||
}
|
||||
|
||||
storage, err = crawler.CrawlBMCForStorage(config)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("uri", uri).Msg("failed to crawl BMC for storage")
|
||||
}
|
||||
|
||||
// we didn't find anything so do not proceed
|
||||
if util.IsEmpty(systems) && util.IsEmpty(managers) {
|
||||
continue
|
||||
|
|
@ -144,6 +150,7 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams, store secret
|
|||
"RediscoverOnUpdate": false,
|
||||
"Systems": systems,
|
||||
"Managers": managers,
|
||||
"Storage": storage,
|
||||
"SchemaVersion": 1,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue