
We don't need this in a Python 3-only world. Remove six in follows: 1. lower-constraints.txt 2. requirements.txt 3. zaqar/bench/observer.py 4. zaqar/common/api/api.py 5. zaqar/common/api/request.py 6. zaqar/common/api/response.py 7. zaqar/common/pipeline.py 8. zaqar/common/storage/select.py Change-Id: I8669061e00fd929c24e62ce9fd4ba31aab63e0d4
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
# Copyright (c) 2013 Rackspace, Inc.
|
|
# Copyright (c) 2013 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
|
|
class Request(object):
|
|
"""General data for a Zaqar request
|
|
|
|
Transport will generate a request object and send to this the API to be
|
|
processed.
|
|
:param action: Action to identify the API call being processed,
|
|
i.e: 'get_queues', 'get_messages'
|
|
:type action: str
|
|
:param body: Request's body. Default: None
|
|
:type body: str
|
|
:param headers: Request headers. Default: None
|
|
:type headers: dict
|
|
:param api: Api entry point. i.e: 'queues.v1'
|
|
:type api: `str`.
|
|
:param env: Request environment. Default: None
|
|
:type env: dict
|
|
"""
|
|
|
|
def __init__(self, action,
|
|
body=None, headers=None, api=None, env=None):
|
|
self._action = action
|
|
self._body = body
|
|
self._headers = headers or {}
|
|
self._api = api
|
|
self._env = env or {}
|
|
|
|
def get_request(self):
|
|
return {'action': self._action,
|
|
'body': self._body,
|
|
'headers': self._headers,
|
|
'api': self._api}
|