88 Commits

Author SHA1 Message Date
Dmitry Tantsur
595db83ddc Support passing a dictionary for configdrive
API version 1.56 introduces support for building configdrive on the
server side. In this case configdrive is a dictionary, this changes
adds support for it.

Change-Id: I2b870fc89aa31c13b33f76b14acd6ee959800554
Depends-On: https://review.openstack.org/639050
Story: #2005083
Task: #29841
2019-03-05 17:11:28 +01:00
Dmitry Tantsur
e0708a16ef Allocation API: client API and CLI
Adds the Python API to create/list/view/delete allocations, as well
as the OpenStackClient commands.

Change-Id: Ib97ee888c4a7b6dfa38934f02372284aa4c781a0
Story: #2004341
Task: #28028
2019-02-16 15:51:38 +01:00
Kaifeng Wang
fed8abe5a5 Support for conductors exposed from API
Adds conductor resource to the CLI, the support to list and show
conductor resource, and filter nodes by conductor field.

Story: 1724474
Task: 28066

Change-Id: I9644b9b1bbe2f4f5aa6e80a6bb7ab9b0a4663a6f
2018-12-12 14:37:25 +08:00
Yolanda Robla
dfd341585b Add management of automated_clean field
Modify api to manage the new automated_clean field.
Also bump last known version to 47

Change-Id: I790c762083c2c1b6cbdde4b21434c56bb99236dd
Story: #2002161
Task: #23252
2018-10-23 10:00:03 +02:00
Dmitry Tantsur
fb94fb825c Add support for conductor groups
Implements support for conductor groups when creating, updating and
listing nodes. Refactored some CLI code to avoid excessive copy-paste.

Change-Id: I16559bc3bb6dcbac996c768aa4514676cf4a98a8
Depends-On: https://review.openstack.org/#/c/581391/
Story: #2001795
Task: #23117
2018-07-23 17:30:13 +02:00
Dmitry Tantsur
7c77aba2b9 Add support for reset_interfaces in node's PATCH
Change-Id: I52ee891d6549827d9a055f23d475fe42f422c4d2
Depends-On: https://review.openstack.org/582951
Story: #2002868
Task: #22822
2018-07-17 14:30:14 +02:00
Zuul
9c9c62e51b Merge "Add microversion override for get and list" 2018-06-18 14:58:45 +00:00
Zuul
51d7fec9e0 Merge "BIOS Settings support" 2018-06-12 16:21:52 +00:00
Julia Kreger
144ce25e42 Add microversion override for get and list
A continuation of previous patches adding support for node
get and list calls to be able to overriden with an
os_ironic_api_version keyword argument.

Also adds a release note covering the prior patches in this
series.

Change-Id: I870540a23555e6ae37659452f727872d9d7882a3
Related-Bug: #1739440
Story: #2001870
Task: #14325
2018-06-12 08:34:50 -07:00
Zuul
5448011fdf Merge "Support per-call version: set_provision_state" 2018-06-12 10:10:07 +00:00
Zenghui Shi
2fabfa4103 BIOS Settings support
This adds support for the BIOS Setting APIs in the
openstackclient plugin. Also bump the last known
API version to 1.40 to get access to new API.

Change-Id: I1b4185e53818686c895d1fe526ba3fe5540873b3
2018-06-12 08:51:19 +08:00
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
Eric Fried
7a1575e298 Support per-call version: set_provision_state
This is the first of (hopefully) many patches to enable API version
overrides to be passed into ironicclient methods.

This one plumbs .update() to accept an os_ironic_api_version kwarg and,
if specified, stuff it in the appropriate header for the call.

It also sets up node.set_provision_state to use that framework.

This was brought about by the ugliness necessary to make [1] work in
Nova.

[1] https://review.openstack.org/#/c/554762/

Related-Bug: #1739440
Task: #14326
Story: #2001870
Change-Id: Ic772ada7e562bc845045736cb18c17d7117818f7
2018-06-06 21:56:10 +00: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