Revision c06f1783
Added by Thomas McKay over 6 years ago
lib/hammer_cli_csv/containers.rb | ||
---|---|---|
11 | 11 |
ENTRYPOINT = 'Entry Point' |
12 | 12 |
COMMAND = 'Command' |
13 | 13 |
|
14 |
def export |
|
15 |
CSV.open(option_file || '/dev/stdout', 'wb') do |csv| |
|
16 |
csv << [NAME, REGISTRY, REPOSITORY, COMPUTERESOURCE, ATTACH, ENTRYPOINT, COMMAND] |
|
17 |
@api.resource(:containers).call(:index, {'per_page' => 999999})['results'].each do |container| |
|
18 |
csv << [container['name'], |
|
19 |
container['registry_name'], |
|
20 |
"#{container['repository_name']}:#{container['tag']}", |
|
21 |
container['compute_resource_name'], |
|
22 |
export_attach_types(container), |
|
23 |
container['entrypoint'], |
|
24 |
container['command']] |
|
25 |
end |
|
14 |
def export(csv) |
|
15 |
csv << [NAME, REGISTRY, REPOSITORY, COMPUTERESOURCE, ATTACH, ENTRYPOINT, COMMAND] |
|
16 |
@api.resource(:containers).call(:index, {'per_page' => 999999})['results'].each do |container| |
|
17 |
csv << [container['name'], |
|
18 |
container['registry_name'], |
|
19 |
"#{container['repository_name']}:#{container['tag']}", |
|
20 |
container['compute_resource_name'], |
|
21 |
export_attach_types(container), |
|
22 |
container['entrypoint'], |
|
23 |
container['command']] |
|
26 | 24 |
end |
27 | 25 |
end |
28 | 26 |
|
Also available in: Unified diff
fixes #15743 - import and export of subscriptions one-per-line