Commit Graph

57 Commits

Author SHA1 Message Date
Radomir Dopieralski d4399d3d36 When creating a client, pass the default logger
When a client is created without a logger, novaclient creates a
default logger, but it's then not used, because it's not passed
to the factory function. Because of that, all novaclient calls
are getting logged as 'keystoneauth.session' instead of
'novaclient.v2.client' as they should.

Closes-bug: 1921388
Change-Id: I53caceb08667eb12e27016731868e8015dd10e34
2021-03-25 15:12:29 +01:00
Takashi NATSUME 364cad4191 Remove cells v1 and extension commands and APIs
The following CLIs and their backing API bindings
which have been deprecated since 20.0.0 Train release
have now been removed.

- list-extensions
- cell-capacities
- cell-show

Change-Id: I8e6edf1e4c1bf12d51ed993363129b4f4c3aa36c
2019-10-04 10:09:31 +09:00
Takashi NATSUME 81ec72ecf8 Remove deprecated methods and properties
Remove deprecated methods, properties and unused classes.

Change-Id: I16e0b6e55a9c9da04c4582f9be672018d37bf368
2019-07-04 04:06:42 +00:00
Takashi NATSUME 8eb7d1c5cc Remove deprecated novaclient.v2.contrib modules
All modules of novaclient.v2.contrib have been removed.
The 'only_contrib' parameter for the
'novaclient.client.discover_extensions' method is no longer valid.

Change-Id: I6da83057dda1f27afe98a2412bc0815f100f34a4
2019-02-07 15:00:36 +09:00
openstack 05e287fa9f Enable split logging for cinder-novaclient interaction
This patch ensures that log messages[1][2][3] are logged only when
keystoneauth=DEBUG is enabled in cinder.conf. This will also enable
us to consume split_logger config option [4] when enabled in cinder
without making any additional changes in client code.

[1] REQ: https://review.openstack.org/#/c/505764/8/keystoneauth1/session.py@391
[2] RESP: https://review.openstack.org/#/c/505764/8/keystoneauth1/session.py@422
[3] RESP BODY: https://review.openstack.org/#/c/505764/8/keystoneauth1/session.py@454
[4] https://review.openstack.org/#/c/568878/

Closes-Bug: #1782134
Change-Id:I3c47b5249141b3f05b2f54984bb5b1d7801a02bc
2018-08-24 12:49:36 +00:00
int32bit d418b5f245 Add CLI to show instance usage audit logs
Currently we can get instance usage audit logs via Nova API,
and the docs also update for it. It is necessary to add that
to our client and CLI.

This patch adds the following command.

nova instance-usage-audit-log [--before <before>]

Co-Authored-by: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I4ef8e40c322f1768ee1b5e01e9681cab0e2804bd
2018-01-29 07:39:27 +09:00
Matt Riedemann 01fb16533b Remove deprecated fixedip/floatingip/virtual interface CLIs/APIs
The add-fixed-ip, remove-fixed-ip, floating-ip-associate,
floating-ip-disassociate, and virtual-interface-list CLIs
and related python API bindings were deprecated in the 9.0.0
release in Pike via change Ie76283962c375b735f30ccb3053db07cf2330de2.
This removes the CLIs and related python API bindings and will go
into the 10.0.0 release.

Change-Id: Icb667973c65d26395db660b1c7b919550db66d08
2018-01-11 21:03:00 -05:00
Matt Riedemann 1d88717e75 Remove deprecated os-hosts CLIs and python API bindings
These were all deprecated in the 9.0.0 release in Pike
via change I79091edf5a2569e49e79deba312456fdcdee09e1 and
can now be removed. This will go into the 10.0.0 release.

Change-Id: I85a287ff2666c2dcdcbbc8fd6c2e285176f7a67a
2018-01-11 21:02:55 -05:00
Matt Riedemann 8c73ba4471 Remove deprecated cloudpipe CLIs and python API bindings
These were all deprecated in the 9.0.0 release in Pike
via change I329ee0e5fcf068ea7e54b99fbaf94a524647f660
and we can remove them now. This will go into 10.0.0.

Change-Id: Ia90a49112847e365fcdaf581dc9ee32f9a20fd85
2018-01-11 16:40:15 -05:00
Matt Riedemann 4bc4078fcb Remove deprecated certs CLIs and python bindings
The certs CLIs and python API bindings were deprecated
in release 9.0.0 in Pike via change:

  If3e1e40947a8ad3f665f6a96d46de8cef6a2a190

We can safely remove them now and we'll do a major version
release for this.

Change-Id: I91a49b03e4d3c661ef6072962fac416f2dc37d0b
2018-01-11 16:40:15 -05:00
Sean Dague ddb386b2df Revert "client.logger.warning wrongly used in migrations"
This is a partial revert of the previous patch. The inline setup of
the logger ends up causing issues when this is consumed by other
libraries that want control over the logger.

Closes-Bug: #1697452

This reverts commit 9a27201416.

Change-Id: I1d61d4952aef1039e72a2aac629cb13a6a15d7b2
2017-06-15 10:33:45 -04:00
nidhimittalhada 9a27201416 client.logger.warning wrongly used in migrations
client.logger.warning if reached, will give
this error "No handlers could be found for
logger "novaclient.v2.client"".

Fixed by using warnings.warn() and corrected
root cause by adding appropriate handlers.

Change-Id: I60c8a023cff92f8b6f37a4a14b6193c3efaa19a8
Closes-Bug: #1688507
2017-06-02 16:18:20 +05:30
Matt Riedemann 3a03a0e10d Remove deprecated network APIs
These were deprecated in Newton:

aaebeb05a0

The 'find network' convenience helper when
booting a server only works with neutron now,
and assumes the 'network' endpoint is in the
service catalog.

The functional tests are changed to use
python-neutronclient for listing and finding
the network to use. At this point, we don't
have any nova-network CI jobs that will work
with novaclient, so the non-voting mitaka
nova-network job is also being removed in change
I63b36fb8acc5c9a273e6adcb271df16d0f71031e.

As noted in the release note, the only remaining
pure nova-network CLI/API that will work is for
listing virtual interfaces, which is only implemented
for nova-network within Nova. The functional tests
for this API are removed since we don't have any
nova-network CI jobs that will test it besides
unit tests. Long-term we'll likely deprecate the
os-virtual-interfaces API as well and replace it with
the os-interface API.

Change-Id: I8c520100a0016eed3959619c71dae037ebd72939
2017-04-03 13:17:25 -04:00
libing 736ed310ac Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I4c8c83315897c7e64b05402c233b0fa67eb03a6e
2017-03-25 14:03:26 +08:00
Matt Riedemann 0f46143f3b Remove deprecated floating_ips APIs
These were deprecated in Newton:

aaebeb05a0

The floating IP fixtures and GET API methods in the
manager are still used for testing the addFloatingIP
and removeFloatingIP server operations, so the manager
is moved to the test_servers module.

Change-Id: I2138e43160772c7c896bc5e93195a8169ebfe6c3
2017-03-20 19:26:58 -04:00
Matt Riedemann 4dbb20e5ac Remove deprecated fixed_ips APIs
These were deprecated in Newton:

aaebeb05a0

Change-Id: Iee5bc26384d2079d6a5a8eded1ce5a003439fc95
2017-03-20 19:26:58 -04:00
Matt Riedemann a298b29cc7 Remove deprecated security_groups APIs
These were deprecated in Newton:

aaebeb05a0

The SecurityGroup resource object is left
since the list-secgroup command and
list_security_group servers API code
still uses that object. The
/servers/{server_id}/os-security-groups API
is a proxy to Neutron but was not deprecated
in microversion 2.36 so it's not yet deprecated
here in the client.

Change-Id: I6fa14f43d48f1e035ef54bd2d0078506f0c6d6e0
2017-03-20 19:26:43 -04:00
Matt Riedemann 0896bdc52a Remove deprecated security_group_rules APIs
These were deprecated in Newton:

aaebeb05a0

Change-Id: I2ff1e97c022bc57d468947e90d536a37c65b8a7a
2017-03-20 17:43:49 -04:00
Matt Riedemann a52c86c203 Remove deprecated security_group_default_rules APIs
These were deprecated in Newton:

aaebeb05a0

Apparently we did not have any tests for this code.

Change-Id: I33c18433e57941b26a4abd290b3cd03994d26327
2017-03-20 17:38:00 -04:00
Matt Riedemann 8030b2604d Remove the deprecated fping API
This was deprecated in Newton:

aaebeb05a0

Change-Id: I8deb3b479ec9fd06ab7f527725f489e63fe970c6
2017-03-20 17:34:03 -04:00
Matt Riedemann 31a12984b3 Remove deprecated floating_ip_pools API
These were deprecated in Newton in change:

aaebeb05a0

Change-Id: I9ec33231bbf060e7daae8f3567a38c71e52f5c42
2017-03-20 17:28:28 -04:00
Matt Riedemann ab3315b46f Remove deprecated floating_ips_bulk API
These were deprecated in Newton in change:

aaebeb05a0

Change-Id: Idee91ca8fc4715cd952f97dafcdd5519c9bec919
2017-03-20 17:16:54 -04:00
Matt Riedemann ef74c0a7c8 Remove deprecated floating IP DNS domain/entry APIs
These were deprecated in Newton in change:

aaebeb05a0

Change-Id: I8888f241b04f075d92d2298c623144809546581f
2017-03-20 16:58:22 -04:00
Matt Riedemann dee51a0163 Remove deprecated baremetal CLIs and APIs
These were all deprecated in Newton with change:

87c1b5311b

So now we can remove them.

Change-Id: Ic74a989b8a6565cc52ab82440fab8605a4b78e6b
2017-03-20 15:33:23 -04:00
Matt Riedemann 41f66d15aa Remove deprecated image commands/API bindings
We deprecated the image proxy commands and APIs in Newton
due to the 2.36 microversion. We said after Ocata 15.0.0 we
would remove these, which we can do now in Pike.

Note that the list() method on the ImageManager has to be
moved to the GlanceManager since we still need to list images
for the --image-with option on the boot command. The _match_image
method in the shell has to be updated for a glance v2 response
where custom metadata properties are flat in the image body.

This needs to be released with a major version bump.

Change-Id: I2d9fd0243d42538bd1417a42357c17b09368d2a5
2017-02-22 15:56:28 -05:00
Andrey Kurilin 0bdd24518e Deprecate volume_service_name argument
We forgot about it while removing all methods related to Volume API.

Change-Id: I465b91a17e2633ae876c0011bc8af6ec475c8d48
2016-12-17 17:51:57 +00:00
Andrey Kurilin e4dc84e0f6 Make SessionClient interface similar to HTTPClient
HttpClient will be deprecated soon and SessionClient will be used by default.
To not break integration novaclient with other project at the step of moving
from HTTPClient, SessionClient should have similar interface.

Change-Id: I855ccc5160dc7628f4550e93bf133adf8263aace
2016-12-16 12:55:57 +00:00
Andrey Kurilin b4bd07e5a7 Deprecate connection_pool variable
This is the last variable which is redundant in case of SessionClient.
After this patch we will be able to use SessionClient in 100% usecases.

Change-Id: I102ba25eee7434cb66ea6efbf9ec4ab310d0957a
2016-12-16 12:55:44 +00:00
Andrey Kurilin 2163e6661a Transmit all auth related vars from cli to inner methods
We need cert, project_domain_id, project_domain_name, user_domain_id,
user_domain_name arguments to constract SessionClient in proper way.

These variables will be used in further patches

Change-Id: I44416de7f4dc18916aecb6884158b416e696227e
2016-12-16 12:55:34 +00:00
Andrey Kurilin 77048cc27e Deprecate proxy_token and proxy_tenant_id args
http://lists.openstack.org/pipermail/openstack-dev/2016-October/106098.html

Change-Id: I1ab6d8d36fd2b39c78c5111cbe8191f20e0cda3e
2016-12-15 23:02:58 +00:00
Andrey Kurilin 9bbe5a87b7 Clarify meaning of project_id var
Meaning of project_id (argument of novaclient.client) was not clear.
In different cases, it can be tenant/project id or name (in terms of
Keystone).

* tenant_id - this variable is deprecated now and project_id should be
              used instead;
* project_id - meaning of this variable is clarified now and it expects
               Project ID (in terms of keystone) now.

Change-Id: Ie3fc6b50260203c0debe8664bb87a7d72fb645d7
2016-12-15 19:49:04 +02:00
Andrey Kurilin f98b8470de Rename api_key to password
"password" term is more clear. Resolves FIXME from the code:

    FIXME(comstud): Rename the api_key argument above when we
                    know it's not being used as keyword argument

Change-Id: I39f810a181b119591cf017eded71356a437a8c0a
2016-12-15 19:49:03 +02:00
Andrey Kurilin 1ce917ef25 Rename bypass_url to endpoint_override
* there are two terms in openstack which describes the same thing:
     bypass_url and endpoint_override
* endpoint_override is more wide term. It is used in Keystone)
* since not all openstack folks knows that bypass_url and endpoint_override
  are the same, bypass_url (variable which was used in novaclient) was not
  transmitted to SessionClient

NOTE: name of variable in inner class HTTPClient was not changed, since
      this class will be abandoned soon.

Change-Id: I2d45820c01851b271de8ea66e0d59ec494040c04
2016-12-15 19:49:03 +02:00
Andrey Kurilin 73196fd3c1 Remove redundant args of _construct_http_client
Arguments 'extenstions' and 'no_cache' were not transmitted to
'_construct_http_client' method. They are redundant

Change-Id: Ibe0f874e510eef7cc28fcee87b0083c7febd5161
2016-12-15 19:49:03 +02:00
Andrey Kurilin 330516543b Sort arguments for client's methods
We have a lot of arguments in several Clients methods. Reviewing their
changes is a hard task, so let's sort them to simplify reviews.

Change-Id: Ie78773fd92017fbc4631d0fc6ae9da2e15935537
2016-12-15 19:49:03 +02:00
Andrey Kurilin f834711d2f Move all extensions from contrib dir
All extensions from novaclient.v2.contrib should be not be extensions in
case of api version >=2.0;<=3.0 (historically, they are turned on by default
for cli layer), so let's move it from contrib dir and turn on by default.

Change-Id: I4ef4e44cf970947dad33110ce658a133e4f2893e
2016-11-30 18:00:05 +00:00
Matt Riedemann daa9bdc823 Remove support for non-keystone auth systems
The support for non-keystone auth systems and plugins
was deprecated with 1f11840dd8
back in the 3.1.0 release in mitaka.

Now that we're working on shoring up the support for
keystone auth sessions in the client and eventually moving
to remove support for the non-session HTTPClient, we should
also remove the support to load non-keystone auth plugins.

The whole concept of non-keystone auth systems/plugins is
a legacy artifact and is a barrier to interoperability which
is a goal of nova and OpenStack in general.

Change-Id: Ia649db257c416ca054977812ecb3f1a8044fa584
2016-10-20 12:04:58 -04:00
Thiago Paiva f7dc91dc11 Fixes TypeError on Client instantiation
When instantiating novaclient with kwargs or named attributes, the 'password'
field is duplicated due to an overwrite on the __init__ method of Client v2.
This patch pops out the password field when it's passed and no api_key is
provided.

Co-Authored-By: Pavel Kholkin <pkholkin@mirantis.com>

Closes-bug: #1511417

Change-Id: Id8310eccef5f0f9a2983e25dd35541d1eb0efe86
2016-08-26 11:41:12 +03:00
Andrey Kurilin 65c1fbae70 Store api_version object in one place
Currently we store api_version in two places: client and
HTTPClient/SessionClient instances.

It would be nice to store it in one place, so it would be easier
to change api_version without recreating novaclient object.

Change-Id: I36369a126c20de5922141e8725834ca93d6b0a1a
2016-08-18 18:36:40 +03:00
Sean Dague f5b19b3738 Use neutron for network name -> id resolution
The 2.36 microversion deprecates the nova proxy APIs for looking up a
network from neutron. The CLI will lookup a network by name for
booting a server as a convenience.

Over 90% of clouds now have neutron. We use a service catalog lookup
to assume that neutron is available, and if not fall back to our
proxy. This should mostly shield people from the 2.36 transition.

To test this we add support in our fake client for the neutron network
lookup. Comments were also left about some cleanups we should do in
other parts of the shell testing for net lookup.

Related to blueprint deprecate-api-proxies

Change-Id: I4f809de4f7efb913c814f132f5b3482731c588c5
2016-08-15 16:56:22 -04:00
Sean Dague f839cf1625 Look up image names directly in glance
This does a lookup directly to the image service for name => id
mapping of images. This is required to move on to supporting the
2.36 microversion since that microversion makes the compute
image API proxy return a 404, so before the client can support
that microversion it has to first drop it's usage of the proxy
API.

Because of the way the FakeHTTPClient was stubbing the image
API proxy and the tests are not passing uuids for image IDs,
there is a lot of cleaning up of the tests to make this work
with a fake glance v2 API backend. The tests were basically
false though since you can't do 'nova image-show 1', but because
the stubs mask that it's just been a mountain of lies that has to
be cleaned up here.

As a side effect of fixing a bunch of the tests, this also
makes debugging assert_called less terrible with a better error
message.

Co-Authored-By: Matt Riedemann <mriedem@us.ibm.com>

Related to blueprint deprecate-api-proxies

Change-Id: Iaff3999eafb7d746e5c6032f07ce0756f7b5e868
2016-08-12 16:00:56 -04:00
Andrey Kurilin 84f4e1e10c Raise an exception in v2.client for direct_use
The direct use of novaclient.v2.client.Client was deprecated long time ago
(2.29.0 release of novaclient, which relates to Liberty release of OpenStack).

It is time to move from warning message to an exception. It will allow us to
change novaclient.v2.client.Client interface and keep compatible stuff to
novaclient.client.Client.

Change-Id: I6e6c6eebcf7992d553a2f85f57b8c2ede0cc8311
Related-Bug: #1493576
2016-07-01 10:33:40 +00:00
Takashi NATSUME d16c3692e6 Log request_id for each api call
Add the function to log 'x-openstack-request-id' or
'x-compute-request-id' in each API call.
If the caller (e.g. heat) uses oslo.log,
the caller's request id in oslo.context and
the callee's request id can be output in the same
log message (same line).

Change-Id: I29312ce278ecfae41a688a0ddf76c24cfa0eaf6b
Implements: blueprint log-request-id
2016-06-08 00:10:55 +00:00
Jenkins 85eb9f7236 Merge "Fix typos in docstrings and comments" 2016-04-07 13:18:42 +00:00
Jenkins 96e4449f44 Merge "Switch to 2.1 default api_version in v2.Client" 2016-04-06 12:22:32 +00:00
Dao Cong Tien a967e40185 Fix typos in docstrings and comments
Change-Id: Ib94c2b999f8295ec526d4e44883b86ab8b5a0688
2016-04-06 09:36:28 +07:00
Matt Riedemann a425702689 Remove deprecated volume(snapshot) commands/bindings
23f13437dd deprecated the
purely volume or volume-snapshot related CLIs and python
API bindings during Kilo. python-cinderclient should be
used for the python API bindings now, and python-openstackclient
should be used for the CLI for those operations.

The alternate_service_type context manager is also removed
since it was only used for proxying through to the volume API
endpoint.

Since the proxy for creating volumes is removed, we have to
add python-cinderclient for testing the volume attachment
CLIs/APIs that are left intact.

Change-Id: I09a6501603667350f49b1b1fa130353a6d5272a2
2016-04-03 14:05:05 -04:00
Andrey Kurilin b9807c0648 Switch to 2.1 default api_version in v2.Client
Direct initialization of versioned clients is restricted, but we tries to
decrease the number of possible bugs and issues, so default value for
api_version was added to v2.Client .

Let's set it to 2.1, since 2.0 is too old API version.

Change-Id: If127f858f7f670a090a57267f46a69ea4c056cce
2016-04-01 19:25:44 +03:00
Pawel Koniszewski 62c76301a2 Support for forcing live migration to complete
In API microversion 2.22 in Nova there is new ServerMigrations resource
that allows opertators to force on-going live migration to complete:
https://review.openstack.org/#/c/245921/

This patch implements new method in python-novaclient to take advantage
of the new API:
nova live-migration-force-complete <instance_id/name> <migration_id>

Change-Id: I823c20b4e0c7b63e905f564a7dff13d3fb314a26
Implements blueprint pause-vm-during-live-migration
2016-02-25 13:59:11 +00:00
Ghanshyam a37c4328a1 Fix H404/405 violations in novaclient/v2/[a-f]
There is a lot of H404/405 violations in novaclient, and it is better
to fix those to have a better doc string for class/methods.

This patch fixes these violations for [a-f] files under  novaclient/v2
folder.

As there are lot of violations and cannot be fixed in single patches,
So separating those in multiple patches for easy review.

Change-Id: Ibe5afef349d1be6d70903e06bee402ca30738ea1
Partial-Bug: #1521899
2015-12-07 17:35:19 +09:00