26 Commits

Author SHA1 Message Date
Dao Cong Tien
9fbcadfff3 Extends driver-list, driver-show supporting new hardware types
- Extend the driver-list command with --type argument, which, if supplied,
limits the driver list to only classic drivers (classic value) or
hardware types (dynamic value), and --detail to show detailed info
of drivers.

- Extend the output of the driver-show command with more info of driver.

Change-Id: I5f72c47805ae9f761250f500098bfef4d502e419
Partial-Bug: #1524745
2017-04-28 19:11:27 +07:00
Ruby Loo
c2a0ef1bce Add DRIVER_RESOURCE to remove duplicated strings
This cleans up the driver-related code so that the fields and labels
used for driver resources are in v1/resource_fields.py. This makes
it consistent with the other resources (node, port, etc).

Change-Id: I4d546d1ad3be997a23be4e2d9c919644bf8ce804
2017-03-13 23:35:09 +00:00
Ruby Loo
24032199ed Move duplicated info to new v1/utils.py
This moves duplicated information to a new v1/utils.py file:
- list of HTTP codes
- list of boot devices
- provision-related information

Change-Id: I4a11627359213770dbc8aa037fcf95ed7bfd0870
2016-08-31 22:57:53 -04:00
Ruby Loo
7f650e3701 Add key_value_pairs_to_dict() method
Add the key_value_pairs_to_dict() method, which takes a list
of key=value string pairs and generates a dictionary from that.
Code is refactored to use this method.

Change-Id: Ie4ada3354ff0afa66398804a715d09dd05695393
2016-08-18 13:11:53 -04:00
Jenkins
b93184e7df Merge "Add CLI support for RAID configuration" 2016-03-04 00:15:21 +00:00
Nisha Agarwal
56663b38e6 Add CLI support for RAID configuration
This commits add the following:

* Ability to set target_raid_config for a node using
  node-set-target-raid-config.

* Display target_raid_config and raid_config in node-show.

* Display logical disk properties for a driver using
  driver-raid-logical-disk-properties.

NOTE: Client still defaults to version 1.9, so
  '--ironic-api-version 1.15' (or above) should be
  added to the CLI to use the feature as RAID can be
  triggered only with manual cleaning which uses the
  ironic-api-version 1.15.

Co-Authored-By: Nisha Agarwal <agarwalnisha1980@gmail.com>
Closes_bug: 1526400
Change-Id: Id7bb8a242838029e4cc3715d18b27fb1d5cd4dfa
2016-03-03 10:35:01 -08:00
Aline Bousquet
fda1854865 Add a JSON option to the client
Add a json option to list and show commands to return the JSON
response body from the Ironic API without formatting it.

Change-Id: Ic21c8ce1cc211816e309b4a00b6e89a0a8bf6a9d
Closes-Bug: #1436440
2016-03-02 11:29:40 +00:00
xiexs
e3183daa83 Add --wrap option for "ironic driver-properties"
This patch tries to add --wrap option to limit the
length of each line.
Default is disabled.

Change-Id: I3c1b2797cb481e6e826e88da70d87033ed2ba291
2015-12-04 16:25:41 +08:00
Lin Tan
047de319f4 Add driver-get-vendor-passthru-methods cmd
This will return the vendor-passthru-method for the driver

Change-Id: I9ed75497155438b360183b1257d13483d6abaf52
2015-11-18 14:28:22 +08:00
Lin Tan
4d966622ef Sync with oslo-incubator
According to the latest agreement in Oslo team, apiclient and
clituils will be removed from Oslo incubator. We should keep
the local copy by ourselfs:
1. rename openstack/common/apiclient to common/apiclient
2. Because Ironic only use base.py and exception.py, so delete others.
3. rename openstack/common/cliutils.py to common/clituils.py
4. Delete openstack/common/_i18n becuase we have common/i18n.py
5. Delete openstack folder because it is empty
6. Add related unit tests and add oslotest to test-requirements.

Change-Id: I9eecd0457e86e82e65db1d0bc9a4c5c0ed4bbf74
2015-11-17 09:22:53 -08:00
sonu.kumar
5bb267a580 Replacing dict.iteritems() with dict.items()
The iteritems() of Python 2 dictionaries has been renamed to items()
to provide compatibility with Python 3.

Change-Id: I6f32c4e00abb19a9316c5e1d014df26b0c6d35f9
2015-07-20 00:16:25 +05:30
John L. Villalovos
2df670cf30 Remove unneeded 'utf-8' coding lines
This is basically a revert of commit:
  af741ec2236619880fa902d68aef4a6ae6cef534

It was decided that only files that need to have the line:
  # -*- coding: utf-8 -*-
Should have the line[1] as a general principle

This patch removes the 'utf-8' coding line from files that consist
entirely of ASCII characters.

[1]
http://eavesdrop.openstack.org/meetings/ironic/2015/ironic.2015-04-20-17.00.html

Partial-bug: #1325193
Change-Id: I88c1c37f7b580aa805eae9d4a1e66d33302a325f
2015-04-21 16:44:47 +00:00
John L. Villalovos
144e82b163 Fix the final PEP8 errors
Fix PEP8 E126,E127,E128 errors, which were the only ones remaining.

Fix PEP8 errors:
E126: continuation line over-indented for hanging indent
E127: continuation line over-indented for visual indent
E128: continuation line under-indented for visual indent

Remove the ignore= entries for flake8 in tox.ini

Change-Id: I919551121d85d2aab528f4fa5ecdb3cfd940557a
2015-03-10 14:38:30 -07:00
Ruby Loo
7961c60f33 Consistent names of args and metavars, and help strings
This modifies the CLI so that the argument names, metavar names
and help strings are more consistent.

Argument names that consist of more than one word are now separated
by hyphens instead of underscores. Existing argument names with
underscores are still supported but not displayed via help. The new
argument names are: http_method -> http-method, chassis_uuid -> chassis,
driver_info -> driver-info, node_uuid -> node.

Metavars are only used in the help strings displayed to the user. For
consistency, they are lowercased with hyphens to separate the
words. (Using spaces might make someone think that more than one argument
is needed.)

Help strings were updated. Among other things, they are treated like
sentences with the first letter in upper case, and a period at the end.

Closes-Bug: #1420318
Change-Id: If05d51b09d787ccfbf6f6d35d8e752d42f673601
2015-02-20 02:27:34 +00:00
Lucas Alvares Gomes
93f885dfd9 VendorPassthru commands to support different HTTP methods
Extend the vendor_passthru() library methods and clients to support
issuing different HTTP methods on the vendor endpoints.

Implements: blueprint extended-vendor-passthru
Change-Id: I32a4990ed3db0bc73ce845b9b4119d87ab2e1503
2014-11-14 11:55:10 +00:00
Lucas Alvares Gomes
351344d623 Sane parameters for node and driver vendor_passthru()
The vendor_passthru() method for the node and driver library was
expecting a **kwargs, that isn't helpful because you don't know exactly
how much parameters it expects, what are the parameters etc... This
patch is changing it since the parameters are well defined (we knew what
parameters we were expecting there).

Change-Id: Idb2002eb76e76f6e1b67a6ea1a7d31f41573abdd
2014-11-14 11:51:25 +00:00
Rakesh H S
223f93e503 fixes help string for driver-list
CLI help text for driver-list says "List drivers".
But it will list only the enabled drivers.

Hence the help text has been changed to reflect the same.

Change-Id: Ib68537b69dd0455558656710e8d7df7f2a03ff1f
Closes-Bug: #1298628
2014-09-11 17:40:09 +05:30
Dmitry Tantsur
88ad6ddbae Fix column headings regression due to switch to cliutils
After switch to cliutils in https://review.openstack.org/72418
field_labels argument is no longer respected in print_list.
This patch updates cliutils to version introduced in
https://review.openstack.org/#/c/113978 and fixes usage
of the newly-introduced field_labels argument to print_list.

Change-Id: I4c5ca149816e4476f170b30de6855dec747522dd
Closes-Bug: #1342391
2014-09-09 11:07:52 +02:00
Ruby Loo
1ce8722e04 Add driver-properties command
Add 'driver-properties <driver_name>' command. This returns a table
listing the properties of the specified driver, including name
and description.

Eg:
$ ironic driver-properties pxe_ipmitool
+--------------------+----------------------------------------------+
| Property           | Description                                  |
+--------------------+----------------------------------------------+
| ipmi_address       | IP address or hostname of the node. Required.|
| ipmi_password      | password. Optional.                          |
| ipmi_priv_level    | privilege level; default is ... Optional.    |
| ipmi_terminal_port | node's UDP port ... required for console...  |
| ipmi_username      | username; default is NULL user. Optional.    |
| pxe_deploy_kernel  | UUID (from Glance) of the deployment...      |
| pxe_deploy_ramdisk | UUID (from Glance) of the ramdisk...         |
+--------------------+----------------------------------------------+

If this feature is not available in Ironic, it returns
"Not Found (HTTP 404)".

If driver_name doesn't exist, it returns "The driver '<driver-name>' is
unknown. (HTTP 404)".

Change-Id: Id125fe4c1771dc5bb5b57d528940f2ba1c85866a
Blueprint: get-required-driver-info
2014-07-23 21:02:36 +00:00
Ramakrishnan G
47062acbf6 Add ironic cli support for vendor-passthru
This commit adds support for calling vendor-passthru
methods for nodes and drivers.

Change-Id: I73dd6c74f4b069e297cbf2175ffbba39fc1d6df6
Closes-Bug: 1330777
2014-07-22 03:10:08 +05:30
Martin Geisler
af741ec223 Add UTF-8 coding lines to all Python files
While not strictly necessary for files containing only ASCII
characters, adding a line with "coding: utf-8" can guard against
future SyntaxError's in case someone inserts a Unicode literal.

This commit adds such lines to all .py files. The syntax used by this
commit works with Python (of course). It also works with Emacs, which
will recognize the special "-*-" marker and use the "coding" variable
to correctly decode the file, even in an environment where UTF-8 is
not the default file encoding.

Existing coding lines were normalized to match the new lines added.

Partial-bug: #1325193
Change-Id: I58bf93fea711fd25890356a397e594bd820c99e3
2014-05-31 13:22:44 +02:00
Andrey Kurilin
a50fb88976 Reuse module cliutils from common code
This patch:
- removes unused method `common.utils:pretty_choice_list`;
- removes unused method `common.utils:find_resource`;
- removes unused method `common.utils:exit`;
- adds alias to `cliutils:args` in `common.utils`;
- adds alias to `cliutils:env` in `common.utils`;
- reuses method `print_list` from `cliutils`;
- reuses method `print_dict` from `cliutils`.

Related to blueprint common-client-library-2

Change-Id: I42318c6947509d4338309d03e722d822182bbc5d
2014-04-28 16:17:37 +03:00
David Shrewsbury
8aabc0d0a5 Add support for 'driver-show' command
Now that the Ironic API supports getting individual drivers via
/v1/drivers/<driver_name>, a new 'driver-show' command is added
to the client.

Change-Id: Ia18ba75a9814f127b2db0ccbcb3f5b0f44045c7a
2014-03-21 15:58:16 -04:00
He Yongli
3622dfa2fb Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: Iff0d2e4725355800f923a04a1bfcac3003a6abd2
Close-bug: #1229324
2014-02-13 15:11:42 +08:00
Lucas Alvares Gomes
5e56789807 driver-list command to show the list of conductors
The commit https://review.openstack.org/#/c/60216/ returns the name of the
drivers and also a list of active conductors that supports each driver,
this patch makes the necessary changes to expose that information on
the driver-list command.

Change-Id: I9183b40422f6dc3193570703d25d47b6e8edde06
2013-12-06 19:37:41 +00:00
Lucas Alvares Gomes
29f806698f Add driver-list
The driver-list command returns a list of drivers supported by the
ironic conductors.

Change-Id: I24adbde087396fb5c01226ef7a2b602ff8732227
2013-11-12 09:03:00 +00:00