Project

General

Profile

Download (26.2 KB) Statistics
| Branch: | Tag: | Revision:

hammer-cli-csv / README.md @ 74968aff

1
# hammer-cli-csv ![Travis # Status](https://travis-ci.org/Katello/hammer-cli-csv.svg?branch=master)
2

    
3
## Introduction
4

    
5
[Hammer](https://github.com/theforeman/hammer-cli/blob/master/README.md) is a command line interface (CLI) framework which provides a core to which modules may be added. This module, hammer-cli-csv, adds commands to interact with the following products: [Foreman](https://theforeman.org) standalone, [Katello](http://www.katello.org/), Red Hat's Satellite-6, and Red Hat's Subscription Asset Manager (SAM).
6

    
7
The purpose of this module's commands are to allow a convenient mechanism to both export to and import from CSV files (comma separated values). Each of the server's supported resource types, such as organizations and users, are handled.
8

    
9
Some possible uses include
10

    
11
* Import demo or development data easily and consistently
12
* Export another server's data and then import into elsewhere for testing and debug
13
* Export for backup and auditing
14
* Export from SAM-1.4 to import into Satellite-6
15

    
16
The following sections will cover installation, usage, and examples. All of the resource types are follow in the order which generally is required for dependency resolution (eg. roles must exist to assign to users so the role section comes first).
17

    
18
## Installation
19

    
20
```bash
21
gem install hammer_cli_csv
22
gem install hammer_cli_katello
23

    
24
mkdir -p ~/.hammer/cli.modules.d/
25

    
26
cat <<EOQ > ~/.hammer/cli.modules.d/csv.yml
27
:csv:
28
  :enable_module: true
29
EOQ
30

    
31
# to confirm things work, this should return useful output
32
hammer csv --help
33

    
34
```
35

    
36
## Usage
37

    
38
| Option | Description |
39
| ---------------:| :--------------|
40
| --csv-export | If not specified will run import. |
41
| --csv-file FILE_NAME | File to import from or export to. If not specified reads or writes to/from stdin and stdout. Note: On ruby-1.8.7 this option is required. |
42
| --prefix PREFIX | Convenience method to add a prefix to all Count substituted values. See examples below. |
43
| --server SERVER | The server to run against. Overrides any config file value. |
44
| --username USERNAME | Username for server. Overrides any config file value. |
45
| --password PASSWORD | Password for user. Overrides any config file value. |
46
| --verbose | Display verbose progress information during import. |
47

    
48
## Count Substitution
49

    
50
Some columns of input data have a special syntax available termed "Count substitution" below.
51

    
52
This hammer module started out as a way to generate large amounts of test data. As such, it was convenient to be able to add a single row to an input CSV file and have it generate multiple records.
53

    
54
Take this Organization CSV as an example:
55

    
56
```
57
Name, Count, Label, Description
58
# Start a row with a # to indicate a comment, a row to be skipped
59
Organization %d, 4, testorg%d, A test organization
60
```
61

    
62
The single row, with a Count value of four, would generate four organizations ("Organization 0", "Organization 1", "Organization 2", and "Organization 3"). Notice that the Label column, which must be unique, also has the Count column substition.
63

    
64
During export, the Count column will always be one (1).
65

    
66
## Examples
67

    
68
## Organizations
69

    
70
**Overview**
71
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=organizations&state=open)
72
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/organizations_test.rb)
73
* Sample data
74
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/organizations.csv)
75
* Supported products and version
76
  * Foreman-1.5, Foreman-nightly
77
  * Katello-nightly
78
  * Satellite-6.0
79
  * SAM-1.4
80

    
81
**CSV Columns**
82

    
83
*Note: % column indicates Count substituion*
84

    
85
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
86
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
87
| Name         | Name of the organization to update or create | x | x | x | x | x |
88
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x | x |
89
| Label | Unique organization label | x |   | x | x | x |
90
| Description | Organization description |   | x | x | x | x |
91

    
92
**Examples**
93

    
94
Here is an example of a CSV file to create an organization
95

    
96
```
97
Name, Count, Label, Description
98
# Start a row with a # to indicate a comment, a row to be skipped
99
Mega Corporation, 1, megacorp, The number one mega company in the world!
100
```
101

    
102
If above is saved to a file such as **megacorp/organizations.csv** the following command will run import to create or update the organization.
103

    
104
```
105
$ hammer csv organizations --version --csv-file megacorp/organizations.csv
106
Updating organization 'Mega Corporation'... done
107

    
108
$ hammer csv organizations --csv-export
109
"Name","Count","Label","Description"
110
"Mega Corporation","1","megacorp","The number one mega company in the world!"
111

    
112
# Import but prefix all substitution columns with a string
113
$ hammer csv organizations --verbose --csv-file test/data/organizations.csv --prefix xyz
114
Creating organization 'xyzMega Corporation'... done
115

    
116
# Export and pipe to import with a new prefix
117
$ hammer csv organizations --csv-export | hammer csv organizations --verbose --csv-file test/data/organizations.csv --prefix abc
118
Creating organization 'abcMega Corporation'... done
119
```
120

    
121
## Locations
122

    
123
**Overview**
124
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=locations&state=open)
125
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/locations_test.rb)
126
* Sample data
127
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/locations.csv)
128
* Supported products and version
129
  * Foreman-1.5, Foreman-nightly
130
  * Katello-nightly
131
  * Satellite-6.0
132

    
133
**CSV Columns**
134

    
135
*Note: % column indicates Count substituion*
136

    
137
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
138
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
139
| Name         | Name of the location to update or create | x | x | x | x |   |
140
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
141
| Parent Location | Parent location |   | x | x | x |   |
142

    
143
## Puppet Environments
144

    
145
**Overview**
146
* Due to the implications of removing a puppet environment from an organization or location, this column only adds to what is present already.
147
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=puppet-environments&state=open)
148
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/puppet_environments_test.rb)
149
* Sample data
150
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/puppet-environments.csv)
151
* Supported products and version
152
  * Foreman-1.5, Foreman-nightly
153
  * Katello-nightly
154
  * Satellite-6.0
155
  * SAM-1.4
156

    
157
**CSV Columns**
158

    
159
*Note: % column indicates Count substituion*
160

    
161
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
162
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
163
| Name         | Name of the puppet environments to update or create | x | x | x | x |   |
164
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
165
| Organizations | Comma separated list of organizations |   | x | x | x |   |
166

    
167
## Operating Systems
168

    
169
**Overview**
170
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=operating-systems&state=open)
171
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/operating_systems_test.rb)
172
* Sample data
173
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/operating-systems.csv)
174
* Supported products and version
175
  * Foreman-1.5, Foreman-nightly
176
  * Katello-nightly
177
  * Satellite-6.0
178
  * SAM-1.4
179

    
180
**CSV Columns**
181

    
182
*Note: % column indicates Count substituion*
183

    
184
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
185
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
186
| Name         | Name of the operating systems to update or create | x | x | x | x |   |
187
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
188
| Family | Operating system family |   | x | x | x |   |
189

    
190
## Domains
191

    
192
**Overview**
193
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=domains&state=open)
194
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/domains_test.rb)
195
* Sample data
196
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/domains.csv)
197
* Supported products and version
198
  * Foreman-1.5, Foreman-nightly
199
  * Katello-nightly
200
  * Satellite-6.0
201
  * SAM-1.4
202

    
203
**CSV Columns**
204

    
205
*Note: % column indicates Count substituion*
206

    
207
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
208
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
209
| Name         | Name of the domains to update or create | x | x | x | x |   |
210
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
211
| Full Name | Full name of the domain |   | x | x | x |   |
212
| Organizations | Comma separated list of organizations |   | x | x | x |   |
213

    
214
## Architectures
215

    
216
**Overview**
217
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=architectures&state=open)
218
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/architectures_test.rb)
219
* Sample data
220
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/architectures.csv)
221
* Supported products and version
222
  * Foreman-1.5, Foreman-nightly
223
  * Katello-nightly
224
  * Satellite-6.0
225
  * SAM-1.4
226

    
227
**CSV Columns**
228

    
229
*Note: % column indicates Count substituion*
230

    
231
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
232
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
233
| Name         | Name of the architectures to update or create | x | x | x | x |   |
234
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
235
| Operating Systems | Comma separated list of operating system names |   | x | x | x |   |
236

    
237
## Partition Tables
238

    
239
**Overview**
240
* Import and export of the Organizations and Locations columns does not apply to all versions and will be silently ignored when unsupported.
241
* Importing Operating Systems column does not apply to all versions and will be silently ignored when unsupported.
242
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=partition-tables&state=open)
243
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/partition_tables_test.rb)
244
* Sample data
245
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/partition-tables.csv)
246
* Supported products and version
247
  * Foreman-1.5, Foreman-nightly
248
  * Katello-nightly
249
  * Satellite-6.0
250
  * SAM-1.4
251

    
252
**CSV Columns**
253

    
254
*Note: % column indicates Count substituion*
255

    
256
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
257
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
258
| Name         | Name of the partition tables to update or create | x | x | x | x |   |
259
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
260
| OS Family | Operating system family |   | x | x | x |   |
261
| Operating Systems | Comma separated list of operating system names |   | x | x | x |   |
262
| Layout | Disk layout |   | x | x | x |   |
263

    
264
## Lifecycle Environments
265

    
266
**Overview**
267
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=lifecycle-environments&state=open)
268
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/lifecycle_environments_test.rb)
269
* Sample data
270
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/lifecycle-environments.csv)
271
* Supported products and version
272
  * Foreman-1.5, Foreman-nightly
273
  * Katello-nightly
274
  * Satellite-6.0
275
  * SAM-1.4
276

    
277
**CSV Columns**
278

    
279
*Note: % column indicates Count substituion*
280

    
281
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
282
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
283
| Name         | Name of the lifecycle environments to update or create | x | x | x | x |   |
284
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
285
| Organization | Organization name |   | x | x | x |   |
286
| Prior Environment | Previous organization name in path |   | x | x | x |   |
287
| Description | Lifecycle environment description |   | x | x | x |   |
288

    
289
## Host Collections
290

    
291
| Additional arguments | Description |
292
| ---------------:| :--------------|
293
| --organization | Only process organization matching this name |
294

    
295
**Overview**
296
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=host-collections&state=open)
297
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/host_collections_test.rb)
298
* Sample data
299
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/host-collections.csv)
300
* Supported products and version
301
  * Katello-nightly, Katello-2.1, Katello-2.2
302
  * Satellite-6.0, Satellite-6.1
303
  * SAM-1.4
304

    
305
**CSV Columns**
306

    
307
*Note: % column indicates Count substituion*
308

    
309
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
310
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
311
| Name         | Name of the host collections to update or create | x | x | x | x |   |
312
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
313
| Organization | Organization name |   | x | x | x |   |
314
| Limit | Usage limit |   | x | x | x |   |
315
| Description | Host collection description |   | x | x | x |   |
316

    
317
## Products
318

    
319
| Additional arguments | Description |
320
| ---------------:| :--------------|
321
| --organization | Only process organization matching this name |
322
| --[no-]sync | Sync product repositories (default true) |
323

    
324
**Overview**
325
* Due to the length of time that syncing repositories can take, the --no-sync option may be used to skip this step. To always disable syncing, ':products_sync: false' may be specified in configuration file.
326
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=products&state=open)
327
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/products_test.rb)
328
* Sample data
329
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/products.csv)
330
* Supported products and version
331
  * Katello-nightly, Katello-2.1, Katello-2.2
332
  * Satellite-6.0, Satellite-6.1
333

    
334
**CSV Columns**
335

    
336
*Note: % column indicates Count substituion*
337

    
338
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
339
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
340
| Name         | Name of the host collections to update or create | x | x | x | x |   |
341
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
342
| Label | Unique label  |   | x | x | x |   |
343
| Organization | Organization name |   | x | x | x |   |
344
| Repository | Repository name |   | x | x | x |   |
345
| Repository Url | Repository Url |   | x | x | x |   |
346
| Description | Repository description |   | x | x | x |   |
347

    
348
## Provisioning Templates
349

    
350
| Additional arguments | Description |
351
| ---------------:| :--------------|
352
| --organization | Only process organization matching this name |
353

    
354
**Overview**
355
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=provisioning-templates&state=open)
356
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/provisioning_templates_test.rb)
357
* Sample data
358
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/provisioning_templates.csv)
359
* Supported products and version
360
  * Foreman-1.5, Foreman-nightly
361
  * Katello-nightly
362
  * Satellite-6.0
363

    
364
**CSV Columns**
365

    
366
*Note: % column indicates Count substituion*
367

    
368
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
369
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
370
| Name         | Name of the provisioning templates to update or create | x | x | x | x |   |
371
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
372
| Organizations  | Comma separated list of organizations |   | x | x | x |   |
373
| Locations  | Comma separated list of locations |   | x | x | x |   |
374
| Operating Systems  | Comma separated list of associated operating systems |   | x | x | x |   |
375
| Host Group / Puppet Environment Combinations  | Comma separated list of host group and puppet environment associations |   | x | x | x |   |
376
| Kind  | Kind of template (eg. snippet) |   | x | x | x |   |
377
| Template  | Full text of template |   | x | x | x |   |
378

    
379
## Subscriptions
380

    
381
**Overview**
382
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=subscriptions&state=open)
383
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/subscriptions_test.rb)
384
* Sample data
385
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/subscriptions.csv)
386
* Supported products and version
387
  * Foreman-1.5, Foreman-nightly
388
  * Katello-nightly
389
  * Satellite-6.0
390
  * SAM-1.4
391

    
392
**CSV Columns**
393

    
394
*Note: % column indicates Count substituion*
395

    
396
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
397
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
398
| Name         | Name of the subscriptions to update or create | x | x | x | x |   |
399
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
400
| Organization | Organization name |   | x | x | x |   |
401
| Manifest File | Path to manifest file |   | x | x | x |   |
402
| Content Set | Repository content set to enable |   | x | x | x |   |
403
| Arch | Architecture |   | x | x | x |   |
404
| Release | Release version |   | x | x | x |   |
405

    
406
## Activation Keys
407

    
408
**Overview**
409
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=activation-keys&state=open)
410
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/activation_keys_test.rb)
411
* Sample data
412
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/activation-keys.csv)
413
* Supported products and version
414
  * Export
415
    * Katello-nightly
416
    * Satellite-6.0
417
    * SAM-1.4
418
  * Import
419
    * Katello-nightly
420
    * Satellite-6.0
421

    
422
**CSV Columns**
423

    
424
*Note: % column indicates Count substituion*
425

    
426
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
427
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
428
| Name         | Name of the activation keys to update or create | x | x | x | x |   |
429
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
430
| Organization | Parent organization name |   | x | x | x |   |
431
| Description | Activation key description |   | x | x | x |   |
432
| Limit | Usage limit |   | x | x | x |   |
433
| Environment | Lifecycle environment name |   | x | x | x |   |
434
| Content View | Content view name |   | x | x | x |   |
435
| Host Collections | Comma separated list of host collections |   | x | x | x |   |
436
| Subscriptions | Comma separated list of subscriptions |   | x | x | x |   |
437

    
438
## Hosts
439

    
440
**Overview**
441
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=hosts&state=open)
442
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/hosts_test.rb)
443
* Sample data
444
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/hosts.csv)
445
* Supported products and version
446
  * Foreman-1.5, Foreman-nightly
447
  * Katello-nightly
448
  * Satellite-6.0
449
  * SAM-1.4
450

    
451
**CSV Columns**
452

    
453
*Note: % column indicates Count substituion*
454

    
455
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
456
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
457
| Name         | Name of the hosts to update or create | x | x | x | x |   |
458
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
459
| Organization | Organization name |   | x | x | x |   |
460
| Environment | Puppet environment name |   | x | x | x |   |
461
| Operating System | Operating system name |   | x | x | x |   |
462
| Architecture | Architecture name |   | x | x | x |   |
463
| MAC Address | Unique MAC address | x | x | x | x |   |
464
| Domain | Domain name |   | x | x | x |   |
465
| Partition Table | Partition table name |   | x | x | x |   |
466

    
467
## Content Hosts
468

    
469
| Additional arguments | Description |
470
| ---------------:| :--------------|
471
| --organization | Only process organization matching this name |
472

    
473
**Overview**
474
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=content-hosts&state=open)
475
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/content_hosts_test.rb)
476
* Sample data
477
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/content-hosts.csv)
478
* Supported products and version
479
  * Katello-nightly, Katello-2.1, Katello-2.2
480
  * Satellite-6.0
481
  * SAM-1.4
482

    
483
**CSV Columns**
484

    
485
*Note: % column indicates Count substituion*
486

    
487
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
488
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
489
| Name         | Name of the content hosts to update or create | x | x | x | x |   |
490
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
491
| Organization | Organization name |   | x | x | x |   |
492
| Environment | Puppet environment name |   | x | x | x |   |
493
| Content View | Content view name |   | x | x | x |   |
494
| Host Collections | Comma separate list of host collectoins |   | x | x | x |   |
495
| Virtual | Virtual (Yes or No) |   | x | x | x |   |
496
| Host | Virtual content host name |   | x | x | x |   |
497
| OS | Operating system name |   | x | x | x |   |
498
| Arch | Architecture name |   | x | x | x |   |
499
| Sockets | Number of sockets |   | x | x | x |   |
500
| RAM | Amount of RAM with units |   | x | x | x |   |
501
| Cores | Number of cores |   | x | x | x |   |
502
| SLA | Service Level Agreement |   | x | x | x |   |
503
| Products | Comma separated list of subscriptions |   | x | x | x |   |
504
| Subscriptions | Comma separated list of subscriptions |   | x | x | x |   |
505

    
506
## Reports
507

    
508
**Overview**
509
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=reports&state=open)
510
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/reports_test.rb)
511
* Sample data
512
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/reports.csv)
513
* Supported products and version
514
  * Foreman-1.5, Foreman-nightly
515
  * Katello-nightly
516
  * Satellite-6.0
517
  * SAM-1.4
518

    
519
**CSV Columns**
520

    
521
*Note: % column indicates Count substituion*
522

    
523
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
524
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
525
| Name         | Name of the reports to update or create | x | x | x | x |   |
526
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
527
| Time | Time of report |   | x | x | x |   |
528
| Applied |  |   | x | x | x |   |
529
| Restarted |  |   | x | x | x |   |
530
| Failed |  |   | x | x | x |   |
531
| Failed Restarts |  |   | x | x | x |   |
532
| Skipped |  |   | x | x | x |   |
533
| Pending |  |   | x | x | x |   |
534
| Metrics |  |   | x | x | x |   |
535

    
536
## Roles
537

    
538
**Overview**
539
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=roles&state=open)
540
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/roles_test.rb)
541
* Sample data
542
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/roles.csv)
543
* Supported products and version
544
  * Foreman-1.6, Foreman-nightly
545
  * Katello-nightly
546
  * Satellite-6.0.4
547

    
548
**CSV Columns**
549

    
550
*Note: % column indicates Count substituion*
551

    
552
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
553
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
554
| Name         | Name of the roles to update or create | x | x | x | x |   |
555
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
556
| Resource | Resource to apply role to |   | x | x | x |   |
557
| Search | Search string |   | x | x | x |   |
558
| Permissions | Role permission |   | x | x | x |   |
559
| Organizations | Comma separated list of organizations |   | x | x | x |   |
560
| Locations | Comma separated list of locations |   | x | x | x |   |
561

    
562
## Users
563

    
564
**Overview**
565
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=users&state=open)
566
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/users_test.rb)
567
* Sample data
568
  * [Mega Corporation](https://github.com/Katello/hammer-cli-csv/blob/master/test/data/users.csv)
569
* Supported products and version
570
  * Foreman-1.5, Foreman-nightly
571
  * Katello-nightly
572
  * Satellite-6.0
573
  * SAM-1.4
574

    
575
**CSV Columns**
576

    
577
*Note: % column indicates Count substituion*
578

    
579
| Column Title | Column Description | % | Foreman | Katello | Satellite | SAM |
580
| :----------- | :----------------- | :-: | :-: | :-: | :-: | :-: |
581
| Name         | Name of the users to update or create | x | x | x | x |   |
582
| Count | Number of times to iterate this CSV row, incrementing value for substitution |   | x | x | x |   |
583
| First Name | First name of user |   | x | x | x |   |
584
| Last Name | Last name of user |   | x | x | x |   |
585
| email | Email address |   | x | x | x |   |
586
| Organizations | Comma separated list of organizations |   | x | x | x |   |
587
| Locations | Comma separated list of locations |   | x | x | x |   |
588
| Roles | Comma separated list of role names for user |   | x | x | x |   |
589

    
590
## Import
591

    
592
**Overview**
593
* [Open Issues](https://github.com/Katello/hammer-cli-csv/issues?labels=users&state=open)
594
* [Tests](https://github.com/Katello/hammer-cli-csv/blob/master/test/users_test.rb)
595

    
596
**Examples**
597

    
598
```
599
% hammer csv import -v --organizations test/data/organizations.csv --locations test/data/locations.csv
600
Creating organization 'Mega Corporation'... done
601
Creating organization 'Mega Subsidiary'... done
602
Creating location 'Asia Pacific'... done
603
Creating location 'Asia Pacific (Tokyo) Region'... done
604
Creating location 'Asia Pacific (Singapore) Region'... done
605
Creating location 'Asia Pacific (Sydney) Region'... done
606
Creating location 'EU (Ireland) Region'... done
607
Creating location 'South America (Sao Paulo) Region'... done
608
Creating location 'US East (Northern Virginia) Region'... done
609
Creating location 'US West (Northern California) Region'... done
610
Creating location 'US West (Oregon) Region'... done
611
```
612

    
613
# Development
614

    
615
## Code style
616

    
617
```rubocop -R <file>```
618

    
619
## Tests
620

    
621
The tests are meant to run against a live server.
622