Commit Graph

172 Commits

Author SHA1 Message Date
Radoslaw Smigielski 4baf2eb2c3 Incorrect protocol type in create_security_group_rule()
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
2024-02-11 08:09:57 +01:00
Anvi Joshi 7b5356f32d Support manage/unmanage shares with manila
Change-Id: I95b72434a8a44f737f5ee9a44b6ecbf8f4162a7a
2023-08-09 03:33:53 +00:00
Anvi Joshi 6ef2af39d5 Implemented methods for share metadata
Change-Id: Ib3c27ec3d0eb102b30a80994d6cc2af4ee78f3dd
2023-07-27 04:21:35 +00:00
Zuul 56804e9889 Merge "Add share group snapshots to shared file systems." 2023-07-25 20:25:44 +00:00
Ashley Rodriguez 4838e5e729 Add share group snapshots to shared file systems.
Introduce Share Group Snapshot class with basic methods including list,
create, delete, get and update to shared file system storage service.

Change-Id: Ice8750dcf07ff436ba8d9e9cf5e8cb183b5b3825
2023-07-05 19:12:05 -03:00
Nobuto Murata a72d46a955 Bump the chunk_size to use CPU more efficiently
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
2023-05-18 11:52:22 +09:00
Stephen Finucane c7010a2f92 Bump black to 23.3.0
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>
2023-05-05 12:46:17 +01:00
Stephen Finucane a36f514295 Blackify everything else
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>
2023-05-05 11:31:36 +01:00
Reynaldo Bontje c3e77fc61e Add resize/extend share actions.
Adds the resize/extend actions from the
Share actions API. Includes the resize_share
method in the proxy.

Change-Id: I9c852360b2e71f6e0a2cfd45c0a77690220379cd
2023-04-11 18:51:41 +00:00
tutkuna 1ca0f0c3f3 Add share instances to shared file systems
Change-Id: I7e1f8bd4218858a8e483a402b3906706840a47a5
Co-Authored-By: Reynaldo Bontje <rey.bontje80@gmail.com>
2023-03-28 00:51:05 +00:00
Stephen Finucane 6b937b2c6c Deprecate all of the compute image proxy APIs
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>
2022-12-19 10:27:43 +00:00
Goutham Pacha Ravi 5f9522986c Add shared file systems support
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>
2021-02-18 08:48:21 -08:00
Zuul 7e2a51aeff Merge "Stop subclassing object" 2020-05-13 11:35:51 +00:00
Zuul 6b18264878 Merge "Remove some unneeded things from test-requirements" 2020-05-13 04:23:57 +00:00
Monty Taylor 0c5ae59025 Stop subclassing object
This wasn't actually even needed in python2.7, but habits die hard.

Change-Id: I20f282d285506b1f1dde01be6cde0c0e8c7883c8
2020-05-10 08:29:41 -05:00
Monty Taylor 9b253307a7 Remove some unneeded things from test-requirements
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
2020-05-10 08:23:38 -05:00
Zuul ff05ad5347 Merge "Added missing {user, project}_domain_name in Api" 2020-03-29 23:48:06 +00:00
Monty Taylor 54a76faf72 Rationalize examples and functional extra config loading
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
2020-03-11 17:25:50 -05:00
Andreas Jaeger 7d25db2610 Update links
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
2019-07-30 07:15:55 +02:00
Amol Kahat 3c72ff38ab
Added missing {user, project}_domain_name in Api
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>
2019-07-25 19:56:24 +05:30
Mohammed Naser e8534f582a docs: Add simplified CLI parser docs
The documentation for using the built-in CLI parser are incorrect, this
updates them for very functional and simple ones.

Change-Id: I0cc17b46c85aadc1fd30c5a55021bfeb1f7366f0
2019-07-23 20:35:41 +00:00
Artem Goncharov 8d14cbaa88 Add DNS support
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
2019-03-02 09:09:56 +01:00
Victor Coutellier de8a882ce7 Add glance image import support
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
2019-02-28 15:10:32 +00:00
Artem Goncharov b64990055c fix typo
a small typo (missing "c" in "cloud")

Change-Id: I5748ea9b51aae6dc330856f5635993cded59545a
2019-01-30 17:11:44 +01:00
Jens Harbott 601769e838 Update cirros version for functional tests
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
2019-01-22 11:14:48 +00:00
David Shrewsbury fd61b54679 Avoid dogpile.cache 0.7.0
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
2018-12-18 02:22:35 +00:00
Monty Taylor d42811c405
Fix latest flake8 issues
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
2018-10-29 16:44:05 -05:00
Monty Taylor 603ba0d7d9
Remove all the deprecated stuff
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
2018-10-15 13:21:57 -05:00
Dmitry Tantsur 5e4420763a Add set_provision_state and wait_for_provision_state for baremetal Node
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
2018-07-17 13:58:43 +02:00
Yuanbin.Chen 9d56efeb39 Change clustering example test create parameter
This patch fix profile and policy create parameter error,
fix cluster test return to_dict error.

Change-Id: I3ba61df97588a35d11149ed5c2edcc69023b2f53
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-05-07 15:55:35 +08:00
Monty Taylor 16e045db32
Run examples tests with functional tests
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
2018-02-22 13:12:44 -08:00
Monty Taylor 958a35a5ca
Remove openstack_cloud factory function
This is mostly mechanical as these are no longer needed.

Change-Id: I632675506bef591704068d17ec3dfad963a4c4b5
2018-01-31 11:26:02 -06:00
Zuul 0d6e6e97c0 Merge "Add clustering guides cluster file, examples cluster code" 2018-01-24 19:39:52 +00:00
Zuul 1e715c05be Merge "Add clustering guides node file, examples node code" 2018-01-24 12:49:45 +00:00
Zuul 9c8a528917 Merge "Move openstack_cloud helper functions" 2018-01-24 09:46:46 +00:00
Yuanbin.Chen 7803466ed2 Add clustering guides node file, examples node code
Change-Id: I905c424f86ef1f838ad2b637cb623f9ce7025466
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-24 14:49:22 +08:00
Yuanbin.Chen 3c782b5582 Add clustering guides cluster file, examples cluster code
Change-Id: I7a86398b86a4317100b454f1bd45a8eafc6ae4d4
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-24 10:44:51 +08:00
Zuul 97a7e5358d Merge "Add clustering guides file, Examples code." 2018-01-21 02:57:33 +00:00
Yuanbin.Chen c0b2d084d2 Add clustering guides file, Examples code.
Clustering guides add action/eventfile.
Clustering examples add action/event example code.

Change-Id: I47164b1539d53e51ac915817398ebf85fd8ddb24
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-20 14:25:51 +08:00
Yuanbin.Chen 27e767feed Replace clustering examples code cluster to clustering
Change-Id: I013d6eb917c93ccfeb44b4d9c96108d3d6cde607
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-20 12:36:51 +08:00
Yuanbin.Chen aa52477e8e Add clustering guides receiver file,examples receiver code
Change-Id: I4a4a34c674195402aaa92929d2cfd2cb51775995
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-19 15:13:45 +08:00
Monty Taylor e636890d59
Move openstack_cloud helper functions
We don't want these where they look like supported interfaces just yet.
Move them below openstack.cloud.

Change-Id: I653e5aaba8084e8c226fd0e787dfff01050e7a6c
2018-01-18 16:54:55 -06:00
Monty Taylor da2406bace
Rationalize logging helpers and docs
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
2018-01-16 14:46:44 -06:00
Monty Taylor 40d425c595
Merge user and users sections of the docs
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
2018-01-15 19:19:50 -06:00
Monty Taylor 18fe7b4e2b
Rename CloudConfig to CloudRegion
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
2018-01-09 11:56:04 -06:00
Monty Taylor 4bad718783
Rework config and rest layers
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
2017-11-15 11:46:50 -06:00
Monty Taylor 65293358a0
Move shade and os-client-config python content
Make shade be openstack.cloud and os-client-config be openstack.config.

Change-Id: I1d28be82a72cc1a30d6be306257fc1f0736ed604
2017-10-04 12:39:43 -05:00
zengjianfang 3c62c90f45 Use https instead of http in cluster examples
Change-Id: I674ec63232216729e953f6f5b11403b56eeb787d
2017-05-04 12:38:22 +00:00
Akihiro Motoki dc9a3458ad functional tests: minor cleanup
* 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
2017-04-29 15:40:34 +00:00
Brian Curtin 237041aff9 Add image download example
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
2017-03-13 11:14:45 -04:00