Project

General

Profile

Actions

Feature #25589

open

[RFE] hammer <option> create --input json - possible Foreman clone

Added by Jerry Williams over 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Visibility
Target version:
-
Difficulty:
Triaged:
No
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:
yes

Description

The hammer CLI command has a nice --output json feature that I would like to see the json output be able to be used as the input on another Foreman server.
For example:
hammer --output json domain list >domain.json
hammer --input json domain create --file domain.json or something like that.

In my cause is would like to see something like:
hammer --output json export >export.json
hammer --input json import --file export.json on another server, so now you have a copy of all the metadata, like OS and subnets and partition-tables and provisioning templates and domains and host groups.

I would like to be able to export from one Foreman server and import the configuration into another Foreman server.
It would be nice for any place that the hammer command has the create option to be able to accept the json output from a list command and not need to parse all of the fields, since they are already in the json file.


Related issues 1 (0 open1 closed)

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesClosed

Actions
Actions #1

Updated by Tomáš Strachota over 5 years ago

Actions #2

Updated by Tomáš Strachota over 5 years ago

  • Description updated (diff)
  • Category set to Hammer core

This is a nice feature indeed and I've been thinking about something similar long time ago. We might need to create a special output adapter for that because --json prints data with additional transformations and formatting which can make it more difficult for use as API input.

I'd also consider using STDIN instead of --input to get closer to unix conventions. Eg.

cat host.json | hammer host create

Actions #3

Updated by Shira Maximov over 4 years ago

  • In Kanboard set to yes
Actions #4

Updated by Shira Maximov over 4 years ago

  • Category changed from Hammer core to Visibility
Actions

Also available in: Atom PDF