Commit Graph

34 Commits

Author SHA1 Message Date
OpenStack Proposal Bot f5fdf0a435 Updated from OpenStack Service Type Authority
Change-Id: I28b1251a9ae2126f984d73b037cedc4c4017f1bf
2022-09-13 15:40:47 +00:00
zhangbailin 7155ee7aa8 Update api_ref for Cyborg project
Change-Id: If306a507c314271121cd24aa5df78fb192eac460
2022-09-08 14:26:19 +08:00
Stephen Finucane 35f079f3b6 Modernize package a little
- Remove unnecessary dependencies
- Cleanup 'tox.ini' file

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I19a5d0318ac72012aa7adc9b7eaccc2e59885838
2022-03-22 10:36:43 +00:00
OpenStack Proposal Bot 726b8ec079 Updated from OpenStack Service Type Authority
Change-Id: Id141cd1906b678a4ee238b10fb2fbf3850f5fa42
2019-07-23 14:20:39 +00:00
Andreas Jaeger 27aa3be0f2 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: Id60f5c97058646c19a8a9d0befc56e9e97b202d8
2019-07-22 20:53:27 +02:00
OpenStack Proposal Bot 0b2f4733eb Updated from OpenStack Service Type Authority
Change-Id: I315e21be4597d9bf3fce61c877f01307e4ced3cb
2019-05-01 20:01:20 +00:00
OpenStack Proposal Bot cf1419a89e Updated from OpenStack Service Type Authority
Change-Id: Id6b96df35aab310ac7dda46364e9ddbeea834f0b
2019-03-01 04:36:10 +00:00
OpenStack Proposal Bot 4170f2e584 Updated from OpenStack Service Type Authority
Change-Id: Id96ceb90f74908de377ec81d253454e12a59aab4
2019-01-18 17:53:03 +00:00
ZhijunWei fb33d01882 Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I72a882f2c33ea8c5b79625b3bb3e951204e0bba7
2019-01-06 19:06:14 +08:00
OpenStack Proposal Bot b6f014da2a Updated from OpenStack Service Type Authority
Bot triggered by service-types-authority change [1].

Unit tests updated manually.

[1] I64b579180542342afe71f05afe175d14e10a539d

Change-Id: I589f556f7321f7153a8c9b19f276220e2ef89160
2018-11-27 09:29:22 -06:00
Federico Ressi e4cc41873a Add unittest for os_service_types.data module.
Change-Id: I1d0e68f361e6fb9ddd578debeaaf0b6b5c0879fd
2018-09-06 07:02:38 +00:00
Zuul b6ac042ece Merge "Use keystoneauth only in applicable test" 2018-09-05 14:52:04 +00:00
Colleen Murphy 93729fcfcf Use keystoneauth only in applicable test
keystoneauth uses os-service-types as a run time dependency.
os-service-types uses keystoneauth as a testing dependency. This causes
an issue for packagers: in order to run the unit tests at build time,
an os-service-types package must include keystoneauth as a build
dependency, but since keystoneauth includes os-service-types as a run
time dependency, it causes a circular dependency.

To make it easier on packagers, this patch changes the usage of
keystoneauth in the tests to only be used by the TestRemote class
instead of the base TestCase class. This way, a packager could avoid
including keystoneauth as a build dependency by choosing to skip just
the problematic os-service-types test instead of skipping the entire
test suite.

Change-Id: I7f8da9c09f20ae808e1dc7aef2341396d91e7cf4
2018-09-05 11:25:11 +02:00
Federico Ressi a372532fd9 Close descriptor after reading file.
This change has been motivated by below ResourceWarning Python3
is emitting when using this library:

  ResourceWarning: unclosed file <_io.TextIOWrapper name='.../site-packages/os_service_types/data/service-types.json' mode='r' encoding='UTF-8'>
    return json.load(open(os.path.join(DATA_DIR, filename), 'r'))

Change-Id: Id86cdedab44bf4096185ced2ed6b9379a71bc3e1
2018-08-28 08:22:44 +02:00
Monty Taylor e11dc0f670
Fix service_type normalization
The previous version of the function would fail poorly when service_type
is None. Put in an if to fix it.

Change-Id: Ibbeee913afc463705fe781c2ef0918deb1303617
Story: 2003314
2018-08-06 10:52:53 -05:00
Monty Taylor 2441006a71
Add flag for returning unofficial types
In consuming code in openstacksdk and keystoneauth, the pattern:

  if stm.is_official(service_type):
      return stm.get_service_type(service_type)
  return service_type

Gets used in several places. Let's provide a way to say that with a
flag:

  return std.get_service_type(service_type, permissive=True)

which says "get me the official service_type for this, but if it's not
something I know about, give me the thing the user asked for.

Change-Id: Ib8fb14a88ecc690da67967b7e906deb7d923f869
2018-07-26 08:36:03 -04:00
Monty Taylor a064fe49ed
Allow passing in service types with _ in them
-'s vs. _'s is a thing people can get wrong from time to time. If
someone says "I want block_storage" - we know what they mean - or at
least we can.

Change-Id: I97c65c25ae8e787f4bfedab54db619d98a16f037
2018-07-24 10:47:21 -05:00
OpenStack Proposal Bot 7a2ab03029 Updated from OpenStack Service Type Authority
Change-Id: Icc2ba07e9af125967b0643fe0119d6e2341793c9
2018-07-24 15:17:59 +00:00
OpenStack Proposal Bot 12975c9548 Updated from OpenStack Service Type Authority
Change-Id: I61e1dcfbeecede7fa49f43eb9e45efeed78551ab
2018-03-21 13:06:17 +00:00
OpenStack Proposal Bot 7b28fd3c26 Updated from OpenStack Service Type Authority
Change-Id: I5728349874b3b85d52532da8403e0f873ac470e2
2018-02-14 16:59:28 -06:00
Monty Taylor 8471b4098d
Sort json data
The patches from the proposal bot are large and unreadable because our
starting data is not sorted like the data that we're publishing now is.

Sort the current data by hand so that the proposal bot changes can
actually be read.

Change-Id: I6066d7f74b7abee87a63115941bdced1d44e39b7
2018-02-14 08:45:52 -06:00
Monty Taylor f9dca6f788
Add factory helper function which returns a singleton
Not that ServiceTypes is super expensive or anything, but it's also
an encapsultation of static data, so there's really no need to construct
more than one of them in a program.

Change-Id: I2515fd9be27421006ed22a3ab01bef8cb48196f8
2018-01-12 11:20:50 -06:00
Andreas Jaeger b0454b1cf5 Update api-refs
These documents have moved, update links.

See also Iba0f0b5e7f4d4dd8a5653374c4579ceaf3bd835d

Change-Id: Ia5885c4781f8029b063baa77e19aa76d8807a9ea
2017-09-13 20:26:24 +02:00
Monty Taylor f130e94dbe
Sync from latest service-types-authority
The sync job isn't working, so let's do one by hand. This includes the
senlin change to clustering.

Before we sync again, let's also get ost to use OrderedDict so that the
json emitted is consistent from change to change and we can validate
these easier.

Change-Id: Iee84f555a65170ac9969486c89a25bfb33595c52
2017-08-17 09:26:10 -05:00
Monty Taylor 8e1b7471b6
Consume new mapping fields from service-type-authority
The service type authority is publishing three new pre-computed
mappings. Add getters to expose them and use them where appropriate.
Also, add a method that will return all of the service data for a
project with more than one service to complement the one that only
returns the primary data.

Depends-On: Ib761cf9de875e7b80404797d4aa8d294ca56347a
Change-Id: I78d2dfa03a5a0c392a85a7a77612098b4b01f70e
2017-08-17 08:39:18 -05:00
Monty Taylor 3e8e86bdb5 Support secondary services
The data now allows marking a service as secondary to support
placement/compute in nova. Support that in by_project.

Adds placement to the built-in data so that we can see the testing of
it. We should not approve this patch until approving the Add placement
service patch.

Change-Id: I01ad2934bdcb9346f4af88520f572d9b4f852b5d
2017-08-14 14:12:40 +00:00
Monty Taylor 7980f17df9
Update unittests to be able to sync latest data
There have been two changes to service-types-authority data which break
the unittests for os-service-types. Some of the url schemes were set to
https instead of http, and the order of the volume aliases changed.

Update the unittests so that we can sync data updates again. Sync one by
hand to verify the updates.

Change-Id: Ic323db63b1ab8e74284bdd32a858cb1722a0d4ed
Depends-On: I3086dcfb85f5ca9970f018d503c9378f307a3e73
2017-08-13 10:13:07 -05:00
Jenkins 06fcdd8e73 Merge "Add ability to warn on use of non-official types" 2017-07-25 18:43:45 +00:00
Monty Taylor fdcb50f595
Add ability to warn on use of non-official types
Consumers of os-service-types may want to warn their users about using
non-official types while still making use of the alias data to allow
things to work. Since os-service-types is at the bottom of the stack for
that, it can be useful to just configure ServiceTypes to emit the
warnings itself - that way people can be assured that all the codepaths
are hit.

Change-Id: Ia4ea392671c8196a5083ac1ab27cc1e4fb289946
2017-07-25 14:28:23 -04:00
Jenkins b76a962b1f Merge "Throw an exception on conflicting arguments" 2017-07-25 13:48:56 +00:00
Eric Fried c2442d32f1 Refresh local service-types.json
Refresh the local copy of service-types.json with the latest version
from service-types-authority.

Change-Id: If9780d7896c05f02e29bc5bd14ad6beec3a1c267
2017-07-24 14:39:54 -05:00
Monty Taylor 6522198058
Throw an exception on conflicting arguments
If session and only_remote conflict, we should throw an error. Otherwise
saying "session=None, only_remote=True" silently does not fetch remotely
and returns builtins.

While we're in there, clean up review feedback.

Change-Id: I70db70a541a3401bb57b2003a90333adb3508b51
2017-07-24 05:46:43 +08:00
Monty Taylor 48a94e00a7
Implement fetching and accessor methods
The ServiceTypes class is the main entry point for python programmers.
It should allow them to answer the questions they have about the data
without necessarily walking the structure. It can also return the raw
structure if people want to get at it.

We need to know the project codename for services for doing API doc
publication validation and also for being able to send legacy
microversion headers. The information is in the data, use it.

In order to construct and send microversion headers for projects with
aliases, we need to know ALL of the aliases plus the official name,
because we don't know which one of the values will be the correct name
the service is looking for for a given version. The microversion spec,
however, requires that consumers be able to handle a header that
contains a list of services and to ignore the ones it isn't looking for.

By providing a a list of all the possible values we make it easy to
construct a header for a service given a service_type that should work
for all known identifiers of the service and that is future compatible
with the service-type and microversion specifyier aligning.

Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Change-Id: I57641c9e3c27688b6d7709b1bb07292740d26659
2017-07-19 13:18:14 +09:00
Monty Taylor 1865fa56f8 Add cookiecutter boilerplate
Removed babel related things - we're not expecting to have translations.

Change-Id: I510195c6c83c99d78c90571ff0fdea8219833d95
2017-07-14 13:43:28 -04:00