Example conn.network.create_security_group_rule() in examples/network/security_group_rules.py
uses wrong protocol type protocol='HTTPS'. HTTPS is not allowed value,
allowed values are: icmp, udp, tcp. It should be "protocol='tcp'" instead.
Closes-Bug: #2052860
Change-Id: I0fb0532ca562bcf93672a1ca3f1ce2e3ad864c6d
Introduce Share Group Snapshot class with basic methods including list,
create, delete, get and update to shared file system storage service.
Change-Id: Ice8750dcf07ff436ba8d9e9cf5e8cb183b5b3825
The chunk_size used for downloading images was 1KiB for some time. That
is okay for relatively small images but the client side of CPU can be a
bottleneck especially for large images. Bump the default chunk_size from
1KiB to 1MiB so we can use the client side CPU more efficiently.
[1KiB chunk_size - current]
$ time openstack image save IMAGE_689MB --file /dev/null
real 0m16.633s
user 0m12.633s
sys 0m1.365s
-> ~331 Mbps
[1MiB chunk_size - patched]
$ time openstack image save IMAGE_689MB --file /dev/null
real 0m4.896s
user 0m3.361s
sys 0m0.724s
-> ~1,125 Mbps
Story: 2010759
Task: 48044
Change-Id: Ib877d292f8adbf2fa0c51065f2917b3f1e263483
I was using the distro-provided version of black, 22.8.0, during the
blackify series. There's a newer version out however, 23.3.0. Bump this,
applying the various changes it introduces in the process.
Change-Id: I3442a7ddaf0cb35f37b84bdbe06625a28e982dba
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Black used with the '-l 79 -S' flags.
A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.
Change-Id: Ie106a5cec8831e113a2b764b62b712a205e3153b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Adds the resize/extend actions from the
Share actions API. Includes the resize_share
method in the proxy.
Change-Id: I9c852360b2e71f6e0a2cfd45c0a77690220379cd
This is the only proxy API we support in SDK. We should stop doing that.
For now, just deprecate it.
Some examples are updated to use the image API.
Change-Id: Id4905782e64998c7293625f22298bbce0baed82a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Introduce the shared file systems storage
service proxy, and add a basic service
resource to list availability zones.
[1] https://tree.taiga.io/project/ashrod98-openstacksdk-manila-support/us/11?kanban-status=2360120
Depends-On: Ia2e62d3a11a08adeb6d488b7c9b365f7ff2be3c8
Change-Id: I20f1f713583c53a2df7fd01af11234960c9c8291
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
We don't need to depend directly on python-subunit.
In python3 we don't need safe_hasattr.
We don't use testrepository.
In lower constraints, os-client-config and mox3 are
transitive depends that we do not care about so don't
need to track lower pins for them.
futures and ipaddress were removed from requirements
but not from lc.
Finally, remove future from lc and from __future__
since we're python3 only.
Change-Id: Ic22079f78f77221e83986e5a835457dbefc3ded7
This whole thing is a mess. examples is doing the right thing and
using get_extra_config, but its docs are wrong. functional is
reading config from a non-standard place but is the place that
the examples docs incorrect say it should be read from.
Update both places to read from the RIGHT location and update
the docs as well. Make examples support setting a key to use
and then set that key in tox so that we can just use the
functional settings for both.
Also, fix the clustering functional test so that it consumes
the IMAGE_NAME discovered in functional.base.
Change-Id: Ia9f150bbdd3825cb3e0d4282af3ca8f23dc1d888
The openstacksdk docs are published at docs.o.o, not developer.o.o since
quite some time. Fix links to point to current version of docs.
Add missing links, thus removing some TODOs.
Change-Id: I5e3b4c70bc0875a1dfcc587b60a95258a61b4407
In examples/connect.py, openstack.connect api call requires
user_domain_name and project_domain_name as a required args
which was missing lead to api failure while connecting to
openstack cloud.
It fixes the same.
Story: 2006281
Task: 35984
Change-Id: I79d977282f4bc7699957a0275d251b75c2642cc2
Signed-off-by: Amol Kahat <amolkahat@gmail.com>
The documentation for using the built-in CLI parser are incorrect, this
updates them for very functional and simple ones.
Change-Id: I0cc17b46c85aadc1fd30c5a55021bfeb1f7366f0
Add support for the DNS service. There are still some unimplemented
resources (tld, pools, limits, tsigkey, blacklist, quota,
service_status). They would be added in the follow-up, since this change
is already very big for a review.
Change-Id: I4acab7c4cace63b4ea7d719854e159bd41d49039
Interoperable image import process are introduced in the Image API v2.6. It
mainly allow image importing from an external url and let Image Service
download it by itself without sending binary data at image creation.
This commit will add a method import_image in both Image resource and proxy.
I also add a simple create_image proxy function for creating an image without
uploading it's data, as it is not required in glance API.
Change-Id: Idee9bea3f1f5db412e0ecd2105adff316aef4c4b
Story: 2005085
Task: 29671
Devstack has updated from 0.3.6 to 0.4.0, since we still hardcode
things, we need to follow them.
[0] https://review.openstack.org/521825
Change-Id: I5ed1bb70f6f14f79a31b7c98eedfbe2956044036
Latest release of dogpile.cache breaks our method of calling a bound
function in the decorators. For more details see story or
https://github.com/sqlalchemy/dogpile.cache/issues/140
Pin while we work on a solution.
Additionally, the cirros version was updated to 0.3.6 in devsatck with
Id2f20ebafdd78c2dadf81b8f80f22e7bd6db7755. Update the hard-coded
versions in the functional tests (this should be modified to be more
version agnostic in a future change)
Story: 2004605
Depends-On: https://review.openstack.org/624697
Change-Id: Id2df8a05ef45041bf55a2671f7d06e7b88cc79d6
The latest flake8 checks strings for escape chars, and also has a new
and better rule about line breaks before binary operators - which is
what knuth says should happen.
The escape char check was catching some asterisks in docstrings that
weren't actually providing much, since we already list type as "kwargs".
Just remove them.
Install latest flake8 so we can gate on this.
Change-Id: I89088adcc6f4ff5a894df5e677ae9b28a58edd9a
We're really close to a 1.0 release. Let's go ahead and remove the stuff
that was marked deprecated and see what breaks.
Depends-On: https://review.openstack.org/610695
Change-Id: I0b1b7a0060a3cc0ac1772e5ef2d2a9673159cd77
This change adds set_provision_state and wait_for_provision_state
to openstack.baremetal.v1.Node, as well as set_node_provision_state
to the bare metal Proxy. Also adds wait_for_nodes_provision_state,
which is similar to Node.wait_for_provision_state but handles several
nodes at the same time, which is important for bulk operations.
The cloud's node_set_provision_state was updated to use the new calls.
As a nice side effect, it now supports all provision states and actions
up to the Queens release, as well as does proper microversioning.
Some documentation was written for the bare metal proxy.
Change-Id: I22a76c3623f4dd2cca0b2103cbd8b853d5cebb71
The examples tests are currently not being run, which means they're
probably broken. Move them into the functional test dir so that they get
picked up when we run functional tests.
Change-Id: Id4dc9d48544134f304c2d2a0a292c04184316d70
We don't want these where they look like supported interfaces just yet.
Move them below openstack.cloud.
Change-Id: I653e5aaba8084e8c226fd0e787dfff01050e7a6c
shade and openstacksdk each have a logging doc and a logging setup helper
function. They both basically do the same thing, and we have a TODO item
about collapsing them.
This moves openstack.utils.enable_logging to openstack.enable_logging
(leaving behind a compat piece at openstack.utils.enable_logging) It
adds the shade functionality to it, and also changes the behavior to
match shade's WRT behavior when no parameters are passed (defaults to
logging to stdout)
Update the codebase to call openstack._log.setup_logging instead of
logging.getLogger directly, as setup_logging attaches a NullHandler by
default.
Collapse the docs into a single document.
There were only two places where openstacksdk was already logging to
something other than 'openstack'. Collapse those down to 'openstack'
until we come up with a reason to break them out more logically.
Change-Id: I45fd5ffd18255450d38a1f56c80f5c157ea19ae3
The openstack doc standard location is 'user', so go with that.
Incorporate pages from the shade and occ docs into the appropriate
places in the user index file.
This still leaves user/logging and user/guide/logging which need to be
rationalized. That will come in the next commit, as it also needs to
actually rationalize the logging helper functions.
Remove the Makefile, as it's not used by things.
Change-Id: I26f36370ef9651f4bcaa7dee3b903309463d9592
The name CloudConfig has always sucked. While working on the next patch,
it occurred to me that what a CloudConfig represents is the config for a
given region of a cloud. We even reference "Cloud Region" as a unit of
work when giving conference talks.
Take the opportunity while we're doing this sdk/occ merge to rename it.
Obviously we can provide naming compat shim in OCC itself.
Leave in *some* naming compat shims to get us past the 0.10 release so
that OSC continues to have the happies.
Change-Id: Ia0bbc20eb28a3a36e69adba3a4b45323e4aa284e
This is a large and invasive change to the underlying guts. Most casual
use should not notice a difference, but advanced users, especially those
using the Profile or Authenticator interfaces or making use of pluggable
providers will be broken.
The overall intent is to align directly on top of the mechanisms that
came from os-client-config for config and to use keystoneauth1's Adapter
interface to make use of the canonical implementations of such things as
service and version discovery. The end goal is that openstacksdk
provides the REST interaction layer for python-openstackclient, shade,
Ansible and nodepool.
Replace profile with openstack.config
os-client-config is used by shade and python-openstackclient to read
and process configuration. openstacksdk also can use the
os-client-config interface, but translates it internally into the
Profile object. As os-client-config has been injested into
openstack.config, remove Profile and just use the config classes.
Make proxy subclass of adapter
This gives every service a generic passthrough for REST calls, which
means we can map unknown service-type values to a generic proxy.
Strip endpoint_filter
We're passing Adapters around, not sessions. Doing so means that
self.service and endpoint_filter have become unnecessary.
Rename _Request.uri to _Request.url
This is a stepping-stone to replacing _Request with requests.Request and
using requests.Session.prepare_request inside of _prepare_request.
Rename service proxy instances to match their official service-type.
Aliases are kept for the old versions, but make the canonical versions
match the official name.
Rename bare_metal to baremetal
Rename cluster to clustering
Rename block_store to block_storage
Rename telemetry to meter
Create generic proxies for all services in STA
Every service listed in service types authority is an OpenStack service.
Even if we don't know about it in SDK, we should at the very least have
a low-level Adapter for it so that people can use REST calls while
waiting on the SDK to add higher-level constructs.
The pypy jobs are happily green. Run them as voting rather than
non-voting.
Add syntatic sugar alias for making connections
Typing:
import openstack.connection
conn = openstack.connection.Connection(cloud='example')
is annoying. This allows:
import openstack
conn = openstack.connect(cloud='example')
Use task_manager and Adapter from shade
As a stepping-stone towards shade and sdk codepaths being rationalized,
we need to get SDK using the Adapter from shade that submits requests
into the TaskManager. For normal operation this is a passthrough/no-op
sort of thing, but it's essential for high-volume consumers such as
nodepool.
This exposes a bunch of places in tests where we're mocking a bit too
deeply. We should go back through and fix all of those via
requests_mock, but that's WAY too much for today.
This was a 'for later' task, but it turns out that the move to Adapter
was causing exceptions to be thrown that were not the exceptions that
were intended to be caught in the SDK layer, which was causing
functional tests of things like GET operations to fail. So it became a
today task.
Change-Id: I7b46e263a76d84573bdfbbece57b1048764ed939
* Check service availability for swift, heat and octavia
* Use OS_CLOUD=devstack-admin. DevStack sets up default clouds.yaml
for member and admin roles. The current OpenStackSDK functest prepares
its own clouds.yaml based on DevStack admin account, so there is no
difference from 'devstack-admin'. It simplifies the post_gate_hook process.
* Skip openstack.tests.functional.network.v2.test_quota.TestQuota.test_set
(Related-Bug: #1687202)
Change-Id: I571e437dd7e439d2ad8a1d7ed9a5a24361b1308e
I forgot to `git add` this file to the
Ie62ebcc895ca893321a10def18ac5d74c7c843b9 change and recently noticed it
causing `tox -e pep8` to fail locally.
Change-Id: Ib80eda80f27457f2db2672d58c4a6c4a7ecd3d7c