This commit adds support to the openstack client for the physical
network attribute of baremetal ports for the following commands:
- create
- list
- set
- show
- unset
It also adds support to the ironic client for the physical network
attribute of baremetal ports for the following commands:
- port-create
- port-list
- port-show
- port-update
For OSC, the latest API version has been bumped to 1.34.
Change-Id: I26948e274b9b0bed170f11de45f0ade48d8b3285
Depends-On: I7023a1d6618608c867c31396fa677d3016ca493e
Partial-Bug: #1666009
Currently, the deletion of multiple ports stops if one of the deletions
fails.
This patch prevents the client from stopping after the first error, so
that it will try to delete all specified ports.
Change-Id: I3523c77c30c1345576f5c6ba5d8a04c23adef96a
Closes-Bug: #1655351
This patch adds commands that allows to work with ironic portgroups.
The following ironic CLI commands are introduced:
* ironic portgroup-list
* ironic portgroup-show
* ironic portgroup-port-list
* ironic portgroup-create
* ironic portgroup-delete
* ironic portgroup-update
Also extends ironic port-create with --portgroup.
Portgroup support was added in Ironic API version 1.24.
Change-Id: Id8afa902026ce4466e96cc7bfb7fb97447d65809
Co-Authored-By: Vasyl Saienko (vsaienko@mirantis.com)
Co-Authored-By: William Stevenson (will.stevenson@sap.com)
Partial-bug: #1618754
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
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
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
The sort key used in the list command should be same
no matter with or without detail command.
The commands are:
For chasis:
chassis-list
chassis-node-list
For node:
node-list
node-port-list
For port:
port-list
Change-Id: Idc4789618460c627d8ebe0070443585e261a73de
Closes-Bug: #1446450
This patch add a "--fields" parameter to the "port-list", "port-show",
"chassis-list", "chassis-show" and "chassis-node-list" commands which the
user can specify a subset of fields that will be returned by the server.
This patch also enhances the error message for check_for_invalid_fileds()
method to show what are the valid fields.
Change-Id: Iaf90d615c9fa68f24e54c23d708ff9c5bee7c46c
Refactor the resource_fields.py file to remove some (but not all) of the
duplication that is occurring.
* Created a class Resource to contain the fields and label values
* Added test cases for the new Resource class
* Use the new Resource class to hold data for Chassis, Node, and
Ports.
* Have logic to support a 'sort_fields' and 'sort_labels' property
which removes fields/labels which can not be used for sorting.
Change-Id: I846517a3714b1a86ef7ed7f52e911376e1915bb5
The 'node_uuid' is an invalid sort key in port list command, as
well as 'chassis_uuid' in node list command.
Remove them from sort keys in corresponding list commands.
Change-Id: I10caf5d99d9c8cc7b03dedc9b5cf0546351c6657
Closes-Bug: #1443003
Ironic *-show does not ensure that uuid are not empty.
This patch adds checks to the client to ensure that command line
arguments are not empty strings or only whitespace. It will raise
a command exception if *-show command line argument is an empty
string or only whitespace.
Change-Id: Ia34957922006da5ecbbfc7483040d67ac51f0ada
Closes-Bug: 1442436
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
A previous commit separated the -n/--node option from the --node_uuid
option on the "port-create" command. This meant that, even when the user
specified --node_uuid, the client required -n/--node as well and would
error out.
This moves these options onto a single CLI argument.
Change-Id: Idcc3217e07f9600f7db18182e9b1bc8b2ae356d3
Closes-bug: #1441374
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
Adds a space to separate 'portwhich', and ends the sentence with
a period (because the other help strings do that).
Change-Id: I6756828c87836f1a5c6acc725bf1bdb8dcd58306
cli command port-show use the restapi 'get /v1/port/detail?address
={macaddress}', it also lack restapi 'get /v1/port?address={mac}'
add port-list to get the port which has macaddress:
ironic port-list --address {macaddress}
ironic port-list --address {macaddress} --detail
Change-Id: I4d836940974812360066b7d977472991235cb5c9
Closes-Bug: #1416627
This commit adds support for getting a list of ports, chassis, ports
associated with a node and nodes associated with a chassis with all
attributes, to both the client and the shell CLI.
Closes-Bug: #1366866
Change-Id: If1941de66d70cdbcc3f31cefdbcd4f634e6ce24e
These arguments are using for sorting the result on the server.
Small refactoring was conducted to seperate processing of
common arguments for all lists into the utility function.
Change-Id: I33be1fcecc665c8f2207e53b24ff47954d80dc60
Closes-Bug: #1339731
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
Expose a mean to search for a port by a given MAC address. e.g
$ ironic port-show --address aa:bb:cc:dd:ee:ff
Closes-Bug: #1355155
Change-Id: Ie069bdebfe5143fdcba62a6390729934a4b44f5a
the presence of a 'next' field is the indicator to continue pagination
until there're no more values to be returned.
On the CLI two new options were added to commands used to list resources:
* --marker: Optional, the UUID of an item, eg the last item from a
previous result set. Return the next result set.
* --limit: The maximum number of results to return per request, if:
1) limit > 0, the maximum number of items to return.
2) limit == 0, return the entire list of items.
3) limit param is NOT specified (None), the number of items
returned respect the maximum imposed by the Ironic API
(see Ironic's api.max_limit option).
Closes-Bug: #1314992
Change-Id: I77cc7a7df65c3d2a84144b12a001487ff6832045
This patch removes aliases in `ironicclient.common.utils` and starts
to use directly `arg` and `env` functions from common code.
Change-Id: Ied396b767e623fbcbf0c7a32326be7b64132b3e1
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
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
A port-show command returned these fields: address, created_at, extra,
updated_at, and uuid. The node_uuid associated with the port is also
returned with this change.
Change-Id: If345406d5a00bed7e5acfaa6e710f3cdb39b07ac
Closes-Bug: #1279552
Our node-show support created_at/updated_at two fields now,
but port-show and chassis-show dont support, enable them
for debugging/auditing
Change-Id: Id1bb970d852c2c971d45426d23a61ab7c6698a6c
Partial-Bug: #1244107
Currently we have try/except blocks for each shell command which
may cause an exception, and often we unaware of all possible
exceptions. Therefore our in-place messages may not correspond
to real server exceptions. This patch removes in-place handlers
so shell will rely on single try/except based in
/ironicclient/shell.py: main, which simply prints server's
exception message.
Change-Id: I65dc71c6fb15483fb88ef4c6a423147fe0bb54cb
Closes-Bug: #1251712
The commit https://review.openstack.org/#/c/56682/ introduced node_uuid
for Ports in the Ironic API, this patch adjusts the client to reflect
that change.
Change-Id: Iae9ee8c5cadeae7803f74cca010bb6f8683667c0
This changes the help messages of ironic cli which shows
ID whereever UUID is expected.
Change-Id: Icacd3ab0d146d75b67dccd607c480aef50c9f162
Closes-Bug: #1250260
The arguments --address and --node_id are mandatory arguments for
ironic port-create, but are listed as optional arguments in usage message.
This change fixes them.
Change-Id: I3a32577140021ce77706c73f8cc21842ea5f0473
Closes-Bug: #1244637
Add short command line option alternative for resources creation. This
patch also sacrifices the short option used for debug (-d) in place of
improve the user experience for the real user, developers who needs to
enable debug can still use the long form alternative (--debug).
Change-Id: I1588dc453e1c432fd372e07b87978a77faddcd1c
Improve help strings, remove the upper and lower case mix, inform the
user that some fields are required, remove the period at the end of the
strings making them more uniform.
Change-Id: If5531e0f3161b74f29a80d61792746d561660f49
Splitting v1/shell.py into one file per resource makes the code more
organized and in the long run helps to improve code readability.
Change-Id: Ia57019548158ffe33a1eca444405107caa327936