Debian Codegraph @

glanceclient/v1/client.py

raw symbols SCIP
1 # Copyright 2012 OpenStack Foundation
2 # All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
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)