"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/api/limits.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

limits.py  (keystone-16.0.1):limits.py  (keystone-17.0.0)
skipping to change at line 17 skipping to change at line 17
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
# This file handles all flask-restful resources for /v3/limits # This file handles all flask-restful resources for /v3/limits
import flask import flask
import flask_restful import flask_restful
from six.moves import http_client import http.client
from keystone.common import json_home from keystone.common import json_home
from keystone.common import provider_api from keystone.common import provider_api
from keystone.common import rbac_enforcer from keystone.common import rbac_enforcer
from keystone.common import validation from keystone.common import validation
from keystone import exception from keystone import exception
from keystone.limit import schema from keystone.limit import schema
from keystone.server import flask as ks_flask from keystone.server import flask as ks_flask
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
skipping to change at line 110 skipping to change at line 110
def post(self): def post(self):
ENFORCER.enforce_call(action='identity:create_limits') ENFORCER.enforce_call(action='identity:create_limits')
limits_b = (flask.request.get_json(silent=True, force=True) or {}).get( limits_b = (flask.request.get_json(silent=True, force=True) or {}).get(
'limits', {}) 'limits', {})
validation.lazy_validate(schema.limit_create, limits_b) validation.lazy_validate(schema.limit_create, limits_b)
limits = [self._assign_unique_id(self._normalize_dict(limit)) limits = [self._assign_unique_id(self._normalize_dict(limit))
for limit in limits_b] for limit in limits_b]
refs = PROVIDERS.unified_limit_api.create_limits(limits) refs = PROVIDERS.unified_limit_api.create_limits(limits)
refs = self.wrap_collection(refs) refs = self.wrap_collection(refs)
refs.pop('links') refs.pop('links')
return refs, http_client.CREATED return refs, http.client.CREATED
def patch(self, limit_id): def patch(self, limit_id):
ENFORCER.enforce_call(action='identity:update_limit') ENFORCER.enforce_call(action='identity:update_limit')
limit = (flask.request.get_json(silent=True, force=True) or {}).get( limit = (flask.request.get_json(silent=True, force=True) or {}).get(
'limit', {}) 'limit', {})
validation.lazy_validate(schema.limit_update, limit) validation.lazy_validate(schema.limit_update, limit)
self._require_matching_id(limit) self._require_matching_id(limit)
ref = PROVIDERS.unified_limit_api.update_limit(limit_id, limit) ref = PROVIDERS.unified_limit_api.update_limit(limit_id, limit)
return self.wrap_member(ref) return self.wrap_member(ref)
def delete(self, limit_id): def delete(self, limit_id):
ENFORCER.enforce_call(action='identity:delete_limit') ENFORCER.enforce_call(action='identity:delete_limit')
return (PROVIDERS.unified_limit_api.delete_limit(limit_id), return (PROVIDERS.unified_limit_api.delete_limit(limit_id),
http_client.NO_CONTENT) http.client.NO_CONTENT)
class LimitModelResource(flask_restful.Resource): class LimitModelResource(flask_restful.Resource):
def get(self): def get(self):
ENFORCER.enforce_call(action='identity:get_limit_model') ENFORCER.enforce_call(action='identity:get_limit_model')
model = PROVIDERS.unified_limit_api.get_model() model = PROVIDERS.unified_limit_api.get_model()
return {'model': model} return {'model': model}
class LimitsAPI(ks_flask.APIBase): class LimitsAPI(ks_flask.APIBase):
_name = 'limits' _name = 'limits'
_import_name = __name__ _import_name = __name__
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)