76 Commits

Author SHA1 Message Date
Zuul
acc54b48d1 Merge "Power fault recovery: client support" 2018-06-11 15:12:09 +00:00
Kaifeng Wang
78902bfd0c Power fault recovery: client support
This patch adds codes to support the fault field exposed from ironic API.
Querying nodes with specified fault is also supported as well.

Story: #1596107
Task: #10469
Partial-Bug: #1596107

Depends-On: https://review.openstack.org/556015/

Change-Id: I429df0ab5ea39140a2b988d5dfdacb24a67b955e
2018-06-07 20:09:07 +08:00
Dmitry Tantsur
8940d72521 Do not abort wait_for_provision_state of last_errors becomes non-empty
It can happen if one of heartbeats encounteres "node locked" error, which
is normal, because the next heartbeat will succeed.

Change-Id: Iaed9b83e199761eac4e0e2157c16ea1efa564c24
Story: #2002094
Task: #19772
2018-05-24 13:58:14 +02:00
Dao Cong Tien
487ad98067 Follow-up of rescue mode
This addresses the comments in PS29 of
change id Id865d7c9a40e8d85242befb2a0335abe0c52dac7

Change-Id: I7352bedfdf65f5af1bd239476a343104f87965dd
Partial-bug: 1526449
2018-01-30 09:41:43 +07:00
Dao Cong Tien
e0d8b16161 Add rescue_interface to node and driver
Add support for rescue_interface to the commands below:

 * openstack baremetal node create
 * openstack baremetal node show
 * openstack baremetal node set
 * openstack baremetal node unset
 * openstack baremetal driver list
 * openstack baremetal driver show

Change-Id: Ib91d67a95092713add0d5025d8755f212c59f659
Partial-Bug: #1526449
2018-01-26 23:07:15 +00:00
Mario Villaplana
fce885bf64 Add support for RESCUE and UNRESCUE provision states
Adding support for rescue and unrescue to OSC.

Co-Authored-By: Michael Turek <mjturek@linux.vnet.ibm.com>
Co-Authored-By: Dao Cong Tien <tiendc@vn.fujitsu.com>

Change-Id: Id865d7c9a40e8d85242befb2a0335abe0c52dac7
Depends-On: I3953ff0b1ca000f8ae83fb7b3c663f848a149345
Partial-bug: 1526449
2018-01-26 01:33:03 +00:00
Jim Rollenhagen
bc2c3a2367 Traits support
This adds support for the traits APIs in both the node portion of the
SDK, and the openstackclient plugin. We also bump the last known API
version to 1.37 to get access to the new API.

Change-Id: I72017d51dea194ec062a66cb19d718ba827e7427
Partial-Bug: #1722194
Depends-On: I313fa01fbf20bf0ff19f102ea63b02e72ac2b856
2018-01-25 16:13:25 +00:00
Julia Kreger
835c5d4c57 Turn on warning-is-error
In the doc-migration, warning-is-error was never enabled
for python-ironicclient. As such, I've enabled it and
corrected the various document errors.

Change-Id: I2d1b95fba25dba5d59da3f4b09b9974ff5196940
2017-07-26 13:40:01 +00:00
Dao Cong Tien
525f60912c Add support for storage_interface to node and driver CLI
Add support for storage_interface to the commands below:

 * ironic node-create
 * ironic node-show
 * ironic node-update
 * ironic driver-list
 * ironic driver-show
 * openstack baremetal node create
 * openstack baremetal node show
 * openstack baremetal node set
 * openstack baremetal node unset
 * openstack baremetal driver list
 * openstack baremetal driver show

Change-Id: Ia0437529bcb1a3e8dd20bde55eb57e0443290028
Partial-Bug: #1526231
Depends-On: I2c74f386291e588a25612f73de08e8367795acff
2017-07-11 17:43:34 +00:00
Hironori Shiina
a40b1e0726 Add volume target support to Python API
This adds support for volume_target, which is required to boot instances
from volumes.
This will expose new Python API to operate volume targets:

  - client.volume_target.create
  - client.volume_target.list
  - client.volume_target.get
  - client.volume_target.update
  - client.volume_target.delete
  - client.node.list_volume_targets

Co-Authored-By: Stephane Miller <stephane@alum.mit.edu>
Co-Authored-By: Hironori Shiina <shiina.hironori@jp.fujitsu.com>

Depends-On: I328a698f2109841e1e122e17fea4b345c4179161
Change-Id: I2347d0893abc2b1ccdea1ad6e794217b168a54c5
Partial-Bug: 1526231
2017-07-07 06:08:17 +00:00
Hironori Shiina
8f0c442c2e Add volume connector support to Python API
This adds support for volume_connector, which is required to boot
instances from volumes.
This will expose new Python API to operate volume connectors:
  - client.volume_connector.create
  - client.volume_connector.list
  - client.volume_connector.get
  - client.volume_connector.update
  - client.volume_connector.delete
  - client.node.list_volume_connectors

Co-Authored-By: Satoru Moriya <satoru.moriya.br@hitachi.com>
Co-Authored-By: Stephane Miller <stephane@alum.mit.edu>
Co-Authored-By: Hironori Shiina <shiina.hironori@jp.fujitsu.com>

Depends-On: I328a698f2109841e1e122e17fea4b345c4179161
Change-Id: I485595b081b2c1c9f9bdf55382d06dd275784fad
Partial-Bug: 1526231
2017-07-07 15:06:44 +09:00
Jenkins
f242c6af3b Merge "Add args to CLI 'node-create' for selecting hardware interfaces" 2017-02-01 11:07:04 +00:00
Dao Cong Tien
78a3dcb522 Add args to CLI 'node-create' for selecting hardware interfaces
Adds the below args to CLI 'ironic node-create' and OSC:
--boot-interface
--console-interface
--deploy-interface
--inspect-interface
--management-interface
--power-interface
--raid-interface
--vendor-interface

Change-Id: I405d067ad2cd71f272241c10ce3760549de94711
Partial-Bug: #1524745
Depends-On: Ic8398a6093189a65a7c1ab5cf7e682577dde3257
2017-01-26 13:45:13 +07:00
Hironori Shiina
1afaaa18c7 Fix node-inject-nmi to pass an empty body
Fix a request of inject_nmi API to pass an empty body because PUT
request must be a JSON dict. A request without a body causes a
validation error in the server.

Change-Id: Iaaa9e88b4a4b1e1086217900480fb528bfae56dc
Partial-Bug: #1526226
2017-01-23 19:44:47 +00:00
Jenkins
8a1d09e898 Merge "Add a new command "ironic node-inject-nmi"" 2017-01-23 16:33:29 +00:00
Jenkins
625f45d699 Merge "Add soft reboot/poweroff power states." 2017-01-18 16:22:13 +00:00
Tang Chen
249215e3d5 Add soft reboot/poweroff power states.
Soft reboot/poweroff is now being implemented in Ironic. And the
Ironic driver in Nova should support this new feature. This patch
adds soft reboot and soft poweroff states.

Co-Authored-By: Naohiro Tamura <naohirot@jp.fujitsu.com>

Partial-Bug: #1526226
Change-Id: Icd2859784f3df85c08162c14464bce58067aab1d
Depends-On: I1c9bbd1f11f6a8565607c874b3c99aa10eeb62a5
2017-01-18 15:06:35 +00:00
Tang Chen
906d3caf02 Add a new command "ironic node-inject-nmi"
This patch adds a new command "ironic node-inject-nmi" to support
inject nmi.

Co-Authored-By: Naohiro Tamura <naohirot@jp.fujitsu.com>

Partial-Bug: #1526226
Change-Id: Ib19e020685d46051ddf3086adde57ed229b22797
Depends-On: I08d74f5ccbc386baca1fb29e428fe01924499d45
2017-01-13 17:18:52 +09:00
Vasyl Saienko
400166cbda Extend VIF attach commands
This patch update VIF attach commands to allow setting custom
keys by using --vif-info <key=value> option.

Related-Bug: #1582188
Change-Id: I3b638693e981781d0ddcf6dd8fe75556ff24e428
2017-01-12 22:12:51 +02:00
Sam Betts
288371a43a Add interface attach/detach support
This patch add the ironicclient part of the interface attach/detach API
support.
New commands are introduced:

* ironic node-vif-list <node_id>
* ironic node-vif-attach <node_id> <vif_id>
* ironic node-vif-detach <node_id> <vif_id>

* openstack baremetal node vif list <node_id>
* openstack baremetal node vif attach <node_id> <vif_id>
* openstack baremetal node vif detach <node_id> <vif_id>

Bump OSC plugin last known API version to 1.28

Co-Authored-By: Vasyl Saienko <vsaienko@mirantis.com>
Co-Authored-By: Vladyslav Drok <vdrok@mirantis.com>

Depends-On: I70f1166a15a26f392734e21d6bc30a03da4e5486
Change-Id: I801c5633d72e3eb392e5a04362306c44f6100764
Partial-Bug: #1582188
2017-01-11 16:56:37 +00:00
Ruby Loo
109b438527 If no resource, don't call Resource.to_dict()
This adds a new method base.Manager._get_as_dict() which
checks whether there is a resource first, before calling
Resource.to_dict(). Code was modified to call this new
method, instead of calling Resource.to_dict() directly.

This fixes the AttributeError that occurs if, for example, one
tries to get the list of driver passthru methods of the 'fake'
driver (via 'ironic driver-get-vendor-passthru-methods fake').
There are no methods, and without this change, an AttributeError
exception is raised. With this fix, an empty list is returned.

Change-Id: Ib6b691cd39ede9c5902b4df29023fd974b367a7d
Closes-Bug: #1626806
2016-10-04 12:10:08 -04:00
Ruby Loo
1345372cb3 Add --chassis to 'openstack baremetal node list'
This adds an optional '--chassis <chassis UUID>' to the
'openstack baremetal node list' command. It provides
the ability to get a list of nodes of a specified chassis.

Change-Id: I5dbc0521858823d2e83506b6f873eda9a143f80b
Partial-Bug: #1526479
2016-08-30 14:17:29 -04:00
Dmitry Tantsur
e7c286ff1d Add --wait flag for provision actions and wait_for_provision_state function
This change adds --wait[=timeout] flag for all provisioning actions but abort.
It also adds a helper node method wait_for_provision_state to back this flag.

The wait is aborted with an error in any of the following cases:
* node.last_error gets set
* unexpected stable state was reached (e.g. available instead of active)
* a failure state was reached

Change-Id: I8ba5c7da8980e932a578b084167b00e2b20f6daf
Partial-Bug: #1590752
2016-08-19 15:48:13 +02:00
Jim Rollenhagen
22888e9759 Add support for node.resource_class
This adds support for the node.resource_class field, introduced in
API 1.21. It can be modified on an existing node or passed when
creating a node, or used as a filter when fetching a list of nodes.

Change-Id: Id494a8b735a3532db84d90ba21da173f7e33ed1d
Depends-On: I936f2e7b2f4d26e01354e826e5595ff021c3a55c
Partial-Bug: #1604916
2016-07-28 11:54:02 +00:00
Vasyl Saienko
d1ea9b44f6 Updates supporting ironic-neutron integration
This patchset adds port creation with new optional parameters specifying
new port attributes (local_link_connection, pxe_enabled).
It also adds new parameter network_interface to node object.

Co-Authored-By: Vasyl Saienko (vsaienko@mirantis.com)
Co-Authored-By: William Stevenson (will.stevenson@sap.com)

Partial-bug: #1526403
Depends-on: I67495196c3334f51ed034f4ca6e32a3e01a58f15

Change-Id: If2fb996783b9ac26a5bae2aadd6387207750def9
2016-07-15 18:25:21 -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
Jenkins
68afcb1946 Merge "Add CLI to list nodes using the same driver." 2016-03-03 15:12:02 +00:00
Ruby Loo
e6f6d9eacc Add 'node-set-provision-state <node> clean'
This adds the manual cleaning CLI:

usage: ironic node-set-provision-state [--config-drive <config-drive>]
                                       [--clean-steps <clean-steps>]
                                       <node> <provision-state>

where <provision-state> is 'clean' and <clean-steps> is
the clean steps in JSON format. May be the path to a file containing
the clean steps; OR '-', with the clean steps being read from
standard input; OR a string. The value should be a list of clean-step
dictionaries; each dictionary should have keys 'interface' and
'step', and optional key 'args'. This argument must be specified
(and is only valid) when setting provision-state to 'clean'.

Change-Id: Id5907812935096c5c557c896daf72175ed138866
Partial-Bug: #1526290
Depends-On: I0e34407133684e34c4ab9446b3521a24f3038f92
2016-02-18 11:14:19 -05:00
Kan
4d14aced92 Add CLI to list nodes using the same driver.
Add CLI function to list nodes using the same driver.

Change-Id: I3ee3dd4fd52931a4eebb6ff037d83eb95e4fb1ba
Partial-Bug: #1530626
Depends-On: I998d6a0a6da44487d5ba90dafd417d81d1c7e504
2016-02-03 05:18:35 +00:00
Jenkins
9a563b06d4 Merge "Refactoring and removing duplicate code of "base.Manager" heirs without changing the API" 2015-12-13 02:00:43 +00:00
Sinval Vieira
20cefcf0bd Refactoring and removing duplicate code of "base.Manager" heirs
without changing the API

This commit does refactoring regarding the base.Manager and the
specific managers that inherit from it (Chassis, Node, Port and
Driver).

The specific managers had a lot of duplicate code in methods like:
get, create, delete and update, they were literally equal, what does
not make sense once we already had the base.Manager inheritance to
avoid this type of problem.

This change moves the duplicate code to the parent (base.Manager) and
make the specific managers simpler by making the base.Manager more
useful regarding code reuse for these methods.

Change-Id: Ic77a86196d5bcd956f0a3ae517200824a4d70aa8
Closes-Bug: #1517631
2015-12-09 19:31:20 -03:00
Jenkins
45310e9a96 Merge "Correct node-port-list help info" 2015-12-08 05:15:04 +00:00
Lin Tan
f89739bed7 Correct node-port-list help info
node-port-list accecpts node_name but help say it only accecpt
node_uuid. Correct it and add related tests.

Change-Id: I37f7d505e249156e6a428c3b8d2648b43fcc3df4
2015-12-08 02:13:50 +00:00
John L. Villalovos
861b1f4b8e Revert "Refactoring and removing duplicate code of "base.Manager" heirs"
This reverts commit 46b279bb36b2647bf04097fe271586fca76f5ed0.

The patch being reverted has broken the API compatibility. Until a fix
for this issue has been created, the patch should be reverted.

Change-Id: I1295c3e0d5ca228253874719befd7ed842d505fa
Closes-Bug: #1521429
2015-11-30 19:02:21 -08:00
Sinval Vieira
46b279bb36 Refactoring and removing duplicate code of "base.Manager" heirs
This commit does refactoring regarding the base.Manager and the
specific managers that inherit from it (Chassis, Node, Port and
Driver).

The specific managers had a lot of duplicate code in methods like:
get, create and vendor_passthru, they were literally equal, what does
not make sense once we already had the base.Manager inheritance to
avoid this type of problem.

This change moves the duplicate code to the parent (base.Manager) and
make the specific managers simpler by making the base.Manager more
useful regarding code reuse for these methods.

Change-Id: I9acef9ecc815df61d7ddabe3fae9eccdafe2eeed
Closes-Bug: #1517631
2015-11-30 10:22:06 -03:00
Tang Chen
5d0de8f392 Use a dict to translate node power states to json data.
The input of set_power_state() is different from the real string
it sends to Ironic service in json data. The power states were
translated in set_power_state(). Using a dict to map the translation
is more clear, and easier to add new power states.

Change-Id: I8c7dac1ac39f92b2031e7f1fa95cd5c398a708d5
Implements: blueprint enhance-power-interface-for-soft-reboot-and-nmi
Related-to: blueprint soft-reboot-poweroff
Related-to: blueprint instance-crash-dump
2015-11-23 10:31:52 +00:00
Lin Tan
cd3cd7e791 Add a new cmd method node-get-vendor-passthru-methods
This method will return vendor-passthru-methods for the node.

Change-Id: I1c5b18e2102ef355d0619be3c87771dafb7733ae
Partial-Bug: #1507546
2015-11-18 13:34:59 +08:00
Zhenguo Niu
32c6c3cfb3 Filtering nodes by provision state
Add support for filtering nodes by provision state in the
node-list command. For provision states with spaces, like
'wait call-back' ironicclient will encode it to %20 in the
uri.

And bump the default version to 1.9.

Closes-Bug: #1468229

Depends-On: Ifcd554de04cdc42bffea1a116307b045f39c8416
Change-Id: I9967ff6124e2e7e9958098b41cc892f2c55df5d2
2015-07-20 10:22:09 +08:00
Lucas Alvares Gomes
0d8fa45b4b Allow specifying a set of fields of the Node resource
This patch add a "--fields" parameter to the "node-list", "node-show"
and "node-port-list" commands which the user can specify a subset of
fields that will be returned by the server.

This is supported by the Ironic API version >= 1.8, so this patch also
bumps the default API version to 1.8.

Related-Bug: #1466495
Change-Id: I40654ee9fbd92dd91b41f8596adcd26264634147
2015-07-09 11:27:04 +01:00
Ruby Loo
8fd2ac3ba1 Consistent and more valid strings for Booleans
The set of valid input strings for Boolean values was inconsistent among
the subcommands of the Ironic CLI. egs:
 -for node-set-console-mode: 'true', 'false'
 -for node-set-maintenance: 'on', 'off', 'true', 'false', 'True', 'False'

This change allows the same set of valid values for all the subcommands:
'0', '1', 'f', 'false', 'n', 'no', 'off', 'on', 't', 'true', 'y', 'yes'.

For invalid strings, we output the subcommand usage along with the
argument, invalid string, and valid string choices.

At the API level, if NodeManager.set_maintenance() is passed an invalid
state (maintenance mode) value, an InvalidAttribute exception is raised.

Change-Id: I541695388489cdc640265df8ee6a9999e1442870
Closes-Bug: #1415943
2015-05-07 01:29:57 +00:00
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
Lucas Alvares Gomes
48a95b642d Add support for generating a config drive
This patch is adding support for generating the config drive as part of
the node-set-provision-state command. If a directory is passed via the
--config-drive parameter, the client will then generate a configdrive
with the contents of that directory and give it to Ironic.

Change-Id: I9163846acb30b34d34953f3b82b797ec944569d9
2015-03-26 09:52:59 +00:00
Ghe Rivero
9991b26db1 Use oslo.i18n lib
Stop using gettextutils from oslo.incubator and replace with
the graduated library oslo.i18n

Change-Id: I479be348f6e0894ecff5cd93d37ee66648f3ea01
2015-03-19 18:27:24 +01:00
Devananda van der Veen
94abd4972d Add support for logical names
Add client support for node logical names.

- update help strings to indicate places where Names can be used instead
  of UUIDs
- add new "-n" / "--name" parameter to "ironic node-create"
- add Name field to output of both "node-list" and "node-show"

Change-Id: Id16255e9611e95bd37a225ff475268f609726e37
Implements: blueprint logical-names
2015-03-18 10:39:59 -07: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
Rakesh H S
0f6bf9e94a ironicclient node-set-maintenance to accept true/false
ironicclient node-set-maintenance as of now accepts on/off, but this is not
consistent with the API which accepts true/false.

proposed changes to ironicclient to accept true/false for node-set-maintenance
to maintain consistency.

Change-Id: I93744384267b4670c7a14a90b14bd5afede45fc4
Closes-Bug: #1414804
2015-01-31 08:53:48 -08:00
Lucas Alvares Gomes
f21df697cf Add --config-drive to node-set-provision-state
This patch is extending the node-set-provision-state command and library
to accept a config drive as parameter. The config drive can be passed
as a string or as an actual file.

Implements: blueprint expose-configdrive
Change-Id: Ifa3e005ddbffb81f10febefc4e164eaa2a6924d3
2015-01-29 13:13:02 +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