Commit Graph

36 Commits

Author SHA1 Message Date
zhiguo.li 83574cff43 [Trivialfix] Remove the useless parameter 'ext_mgr'
The parameter 'ext_mgr' is not used in method _setup_routes() in
subclasses:
manila.api.v2/router.APIRouter
manila.api.v1.router.APIRouter
manila.api.versions.VersionsRouter
So it should be removed to make the code clean.

The superclass of them is manila.api.openstack.__init__.APIRouter,
the 'ext_mgr' is removed from method _setup_routers() in superclass.

In method__init__() in superclass, the _setup_routers() is called,
so 'ext_mgr'is removed in related calling statement.

Change-Id: I25e2d5447b328c88c660ae17025f65719290b21b
2018-06-09 22:39:24 +00:00
zhongjun cffbc0d5ac Use parenthesis instead of backslashes in API folder
Use parenthesis instead of backslashes in API folder

TrivialFix
Change-Id: I6c2ea07b0bfc5852b28e44989406cc10eb972e28
2017-06-15 17:23:05 +08:00
Tom Barron b213a25c44 Remove NovaNetworkPlugin
Nova network was deprecated in Newton and is no longer supported for
regular deployments in Ocata [1].

Complete the removal of nova network support from manila begun in [2]
by removing support for ''nova_net_id`` in the share networks API,
by removing the corresponding column from the share networks DB model,
and by removing the nova network plugins themselves.  Unit tests for
share network api views were refactored to remove redundancy while
extending coverage to the new microversion introduced with this patch
and maintaining full coverage of earlier microversions.

APIImpact
DocImpact
UpgradeImpact

Partially-implements: bp remove-nova-net-plugin

[1] http://docs.openstack.org/releasenotes/nova/unreleased.html
[2] I846b760fa7c01f7f86768399a2bfad9ced7e57cd

Change-Id: I8b9a559fbea61979f01737ed1dc272276c4f1269
2017-01-13 08:11:16 -05:00
houming-wang 3cb2500722 Trivial: Remove unused logging import
In some Manila source code files, oslo log is imported but not used.
Remove it.
from oslo_log import logging
LOG = logging.getLogger(__name__)

Closes-Bug: #1529254
Change-Id: I06a98b4929e2adb5c43c754799026d4637107bd7
2015-12-28 21:44:26 -05:00
vponomaryov 31a19b1fb3 Move API module 'share_instances' under v2 dir
Share instances API has min version as 2.3 and considered as v2-only.
But now it is stored under v1 dir for no reason.
Move it to proper dir and remove from v1 router because it could not
be used using v1 API anyway.

Change-Id: I1e3c306b31235cd422ac339df56147439a7bbace
Closes-Bug: #1521999
2015-12-02 14:07:55 +02:00
Valeriy Ponomaryov 2467ccf223 Add new URLs for APIs ported from extensions
After port of extensions to core API we need to rename their URLs.

So, rename URLs and bump microversion for it.
Make new URLs work only with new microversion(s) 2.7+
and old with old microversions 1.0-2.6.
Add separate API router for v2 API as now we should split v1 and v2
logic.
Also, move updated APIs under v2 directory that will be used by both
API routers - v1 and v2.

List of updated collections is following:
 - os-availability-zone -> availability-zones
 - os-services -> services
 - os-quota-sets -> quota-sets
 - os-quota-class-sets -> quota-class-sets
 - os-share-manage -> shares/manage
 - os-share-unmanage -> shares/%s/action

List of updated member actions is following:
 - os-share-unmanage/%(share_id)s/unmanage -> shares/%(share_id)s/action
 - types/%(id)s/os-share-type-access -> types/%(id)s/share_type_access

List of updated action names is following:
 - os-access_allow -> access_allow
 - os-access_deny -> access_deny
 - os-access_list -> access_list
 - os-reset_status -> reset_status
 - os-force_delete -> force_delete
 - os-migrate_share -> migrate_share
 - os-extend -> extend
 - os-shrink -> shrink

List of updated attribute names is following:
 - os-share-type-access -> share-type-access

Partially implements bp ext-to-core

Change-Id: I82f00114db985b4b3bf4db0a64191559508ac600
2015-12-01 12:15:06 +02:00
Goutham Pacha Ravi 379ee2f31c Refactor authorize() method in wsgi.py
Almost every API method written in Manila performs
a policy check against relevant policies in etc/policy.json.
A method - authorize() was introduced in
manila/api/openstack/wsgi.py
in commit e4428f5e6c
to perform these policy checks.

This patch refactors the authorize() method as a decorator
for consistency and easy usage in APIs that choose to
implement the policy check prior to any core logic.

Prior unit tests are modified for the APIs impacted through
this change.

The Cgsnapshots controller's policies are corrected for
name consistency without impacting behavior.

Change-Id: Ib34e166ab65513f8f02215c6569175fc9a913244
Closes-Bug: #1515397
2015-11-19 16:56:44 +00:00
Valeriy Ponomaryov 0cb695fd54 Port share type extensions to core API
Changes:
- Register share type APIs as core API.
- Remove extensions code for share types.
- Leave rename of API 'post' data for future update which
  will be done with bump of microversion
  after port of all extensions to core API.

Partially implements bp ext-to-core

Change-Id: I334cc0fa8e69c2f9b5226f247149a0b9b748dd60
2015-11-12 14:58:20 +00:00
Valeriy Ponomaryov f4c16c45be Port quotas to core API
Changes:
- Register quota and quota class sets API as core API using old links.
- Remove extensions code for quota and quota class sets.
- Leave rename of API urls for future update which will be done with
  bump of microversion after port of all extensions to core API.

Partially implements bp ext-to-core

Change-Id: I642e6dc78fd908a4850afc61505dcf34d330acca
2015-11-09 13:54:59 +00:00
Valeriy Ponomaryov 36b54e660d Port services to core API
Changes:
- Register services API as core API using old link.
- Remove extension code for services.
- Leave rename of API url for future update which will be done with
  bump of microversion after port of all extensions to core API.

Partially implements bp ext-to-core

Change-Id: I06005e8339f16c404d3f1ff9917480603801d44f
2015-11-09 13:54:48 +00:00
Valeriy Ponomaryov 0a6b19c1e1 Port manage/unmanage extensions to core API
Changes:
- Register manage/unmanage API extension as core API using old links.
- Remove extensions code.
- Leave rename of API urls for future update which will be done with
  bump of microversion after port of all extensions to core API.

Partially implements bp ext-to-core

Change-Id: I773398f13f4b3e4637599cb482a5a2c189958656
2015-11-03 19:28:54 +02:00
Valeriy Ponomaryov e4428f5e6c Port availability zones to core API
Changes:
- Register availability zones API as core API using old link.
- Remove extension code for availability zones.
- Leave rename of API url for future update which will be done with
  bump of microversion after port of all extensions to core API.

Partially implements bp ext-to-core

Change-Id: Ifc75ef2d16121634ad12e5e12960c928e4d24b90
2015-10-20 13:24:00 +03:00
Alex Meade 680fd50d3e Add Consistency Groups API
This patch adds the /consistency-groups and /cgsnapshots
endpoints as well as AdminActions for both.

Partially implements bp manila-consistency-groups

APIImpact

Change-Id: I5fd0d3341766fdba4d92f4a43c3d1186e7a4b38e
2015-09-05 18:21:17 -04:00
Igor Malinovskiy 91e438b40e Add Share instances Admin API
Add admin API which allows:
- Get share instances of given share
- Get all share instances
- Get share instance details by id
- Reset share instance state
- Force-delete share instance

Add appropriate unit and tempest tests.

APIImpact
Change-Id: Ie96dfc18b491cb4d9705da4eaca5bc4ce43225ea
Partially-Implements: blueprint share-instances
2015-08-31 13:41:17 +03:00
Clinton Knight 145165a22e Implement Manila REST API microversions
The OpenStack API working group recommends all projects adopt
Nova-style microversions for versioning their REST APIs.  This
commit ports the Nova microversion code and docs to Manila.

With this patch, the API version is bumped to 1.1, and the
versions API (which has always returned horribly outdated
values) is the first API that is versioned.  The 1.1 version
of the versions API includes the minimum and current API
version values.

Implements bp: manila-rest-api-microversions
Change-Id: Ifa8e394335a4eb3ad21f53a873530aee241c00e8
2015-08-13 19:51:19 +00:00
Clinton Knight 72f5f0485a Fix issues with get_pool scheduler API
The scheduler API 'get_pools' was copied from Cinder and has several
problems.  The REST endpoint, /scheduler-stats/get_pools, is not a
REST-appropriate name.  The API allows filtering but filters are not
currently supported by the Manila scheduler.  The API was added as an
extension, not part of the v1 API as it should be.  After restarting
the scheduler service, the API doesn't return any data until a share
has been created (Cinder was used as a model for fixing this one).
This patch fixes all of these issues.

Closes-Bug: #1422042
Change-Id: I7e32efb5390fd4b0a62f644ca5a12dcad14d8a9b
2015-03-16 16:32:15 +00:00
Igor Malinovskiy fcaa5286e2 Add share_type_default() method to API
Horizon and other clients should be able to retrieve
default volume type via manila API for proper
validation and UI rendering.

Partially implements blueprint default-volume-type

Change-Id: I89d03efb791e40f05935d562917703b6adaf3268
2015-02-17 08:35:55 +00:00
Bob Callaway d7993fc8ae Rename volume_type to share_type
This change adds support for share_type, share_types, and share_type_id
along side the corresponding volume_type, volume_types and
volume_type_id fields in the API. This change was made as share_type and
its references are more intuitive in comparison to volume_type.
Both entries are returned to ensure API compatibility but preference is
given to share_type[s,_id].

The database migration introduced in this change should work on MySQL
and Postgres, but will not work on SQLite. Because there is no point
in supporting SQLite, tests for it are removed.

Implements blueprint: rename-volume-type-to-share-type

Change-Id: Ifa23ee6520b5238c7de3d5bce7b7bbde02a4a61d
2015-02-14 17:41:22 +00:00
Valeriy Ponomaryov 63a0504c21 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.
So, start using oslo_log, but keep oslo-incubator code yet other common modules
within Manila codebase use it.

Implements bp use-oslo-log-lib

Change-Id: I88224f7c2bd99adb78140dfc3fa73cea437f29cd
2015-02-08 10:42:40 +00:00
Marc Koderer ecf603bc05 Remove vim headers
As discussed in [1] remove all vim headers from manila files.

[1]: http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html

Change-Id: I341486c66ffe4dad7db8608fdc66868ceb7ad95a
Closes-Bug: #1229324
2014-10-06 15:00:27 +02:00
Andreas Jaeger 8203c51081 Flake8: Fix and enable H404
Fix and enable flake8 test H404:
H404  multi line docstring should start without a leading new line

Change-Id: I13dc13bb5e81d65300680df094cde538c7a6f6df
Partial-Bug: #1333290
2014-08-27 10:47:45 +00:00
Christian Berendt 799319baab Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: I9dc5f995ea07d7c319d944e847a9d1c126937240
2014-07-20 18:48:31 +02:00
Valeriy Ponomaryov 66fd6ab621 Added share server api
Added APIs are:
share-server-list
share-server-show %server_id%
share-server-details %server_id%

Partially implements: blueprint add-share-server-list-api

Change-Id: I2e7722082e6c81db8a0411511b53e64fd8e04e26
2014-05-30 05:17:19 -04:00
Yulia Portnova dd4cbb9096 Added API to manage volume types
Partially-implements bp volume-type-support

Change-Id: I1a58cf82c659b49e5258a563788cb8e5b05bfb8a
2014-04-29 05:12:02 -04:00
vponomaryov 075f707530 Add detail filter for share-network-list
Change-Id: Ia22f991d38b40f65618873ef5fc7e7fbdb07706f
Closes-Bug: 1282069
2014-02-26 15:41:05 +02:00
Yulia Portnova a1c2cdbc7e Fixed detail list for security-services
Added passing collection to resource.

Change-Id: I06ba968e203d06671724314f25b6da58b073761f
Closes-Bug: #1282057
2014-02-19 14:37:47 +02:00
Aleks Chirko c81ad66e7e Add share's networks API
Add server side for share's networks. Implemented controller
will carry user requests to the DB and thus will allow
user to manage share's networks data.

Add share's networks support to the share API.

Partially implements bp: join-tenant-network

Change-Id: Ie4f3945255a049e80083f08a39d7f703a5c75c5e
2014-01-23 13:01:27 +02:00
Yulia Portnova d68efa454c Security service API
Added security service controller to
Manila v1 API.

Partially implements bp: join-tenant-network
Change-Id: Ic11feb44547bf438d925261b587edc828eac31c1
2014-01-13 15:34:48 +00:00
Andrei V. Ostapenko 2e1f4e191b Adds an ability to manage share metadata
Now on share creating, we can specify metadata and it
will be saved in database. Also support of setting,
deleting and updating metadata info was added.

Adds model for share metadata
Adds migration
Adds api extension for share metadata
Adds relative api functions

Partially implements bp manila-client-enhancements
Change-Id: Id421323dd9e947d536b577092f1875f178d9aba5
2013-12-02 13:03:42 +02:00
119Vik c0e15af7fb fixed share snapshots 2013-09-11 16:15:22 +03:00
Yulia Portnova 0d33cb038f Api share-snapshots to snapshots 2013-09-11 12:34:20 +03:00
Yulia Portnova 3683f7feb9 Removed unused imports 2013-09-10 16:36:10 +03:00
Yulia Portnova 1a253971c2 Removed v2 api.
Moved shares and snapshots from contrib to v1
2013-09-10 15:51:26 +03:00
Yulia Portnova 84aa8c2dee removed some volume occurances 2013-09-05 11:33:10 +03:00
Yulia Portnova c112a41151 volume api removed 2013-09-04 10:15:04 +03:00
Yulia Portnova dc4ce932ed Renamed cinder to manila.
Fixed setup.py, fixed bin scripts.
2013-09-02 09:59:07 +03:00