| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
from glanceclient.common import http |
| 17 |
from glanceclient.common import utils |
| 18 |
from glanceclient.v1 import image_members |
| 19 |
from glanceclient.v1 import images |
| 20 |
from glanceclient.v1 import versions |
| 21 |
|
| 22 |
|
| 23 |
class Client(object): |
| 24 |
"""Client for the OpenStack Images v1 API. |
| 25 |
|
| 26 |
:param string endpoint: A user-supplied endpoint URL for the glance |
| 27 |
service. |
| 28 |
:param string token: Token for authentication. |
| 29 |
:param integer timeout: Allows customization of the timeout for client |
| 30 |
http requests. (optional) |
| 31 |
:param string language_header: Set Accept-Language header to be sent in |
| 32 |
requests to glance. |
| 33 |
""" |
| 34 |
|
| 35 |
def __init__(self, endpoint=None, **kwargs): |
| 36 |
"""Initialize a new client for the Images v1 API.""" |
| 37 |
endpoint, self.version = utils.endpoint_version_from_url(endpoint, 1.0) |
| 38 |
self.http_client = http.get_http_client(endpoint=endpoint, **kwargs) |
| 39 |
self.images = images.ImageManager(self.http_client) |
| 40 |
self.image_members = image_members.ImageMemberManager(self.http_client) |
| 41 |
self.versions = versions.VersionManager(self.http_client) |