Commit 783ab58b authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Add "service_type" member var in Client classes

Refs: #2

The "service_type" of an API client is related to the endpoint URL
used to initialize the client and should match the "type" attribute
of the corresponding endpoint.
parent 2fc3da09
......@@ -338,7 +338,7 @@ class SilentEvent(Thread):
class Client(Logged):
service_type = ''
MAX_THREADS = 1
DATE_FORMATS = ['%a %b %d %H:%M:%S %Y', ]
CONNECTION_RETRY_LIMIT = 0
......
......@@ -134,6 +134,7 @@ class LoggedAstakosClient(AstakosClient):
class CachedAstakosClient(Client):
"""Synnefo Astakos cached client wraper"""
service_type = 'identity'
@_astakos_error
def __init__(self, base_url, token=None):
......
......@@ -37,6 +37,7 @@ import json
class ComputeRestClient(Client):
service_type = 'compute'
# NON-cyclades
def limits_get(self, success=200, **kwargs):
......
......@@ -53,6 +53,7 @@ def _format_image_headers(headers):
class ImageClient(Client):
"""Synnefo Plankton API client"""
service_type = 'image'
def __init__(self, base_url, token):
super(ImageClient, self).__init__(base_url, token)
......
......@@ -36,6 +36,7 @@ from kamaki.clients.utils import path4url
class NetworkRestClient(Client):
service_type = 'network'
def networks_get(self, network_id=None, **kwargs):
if network_id:
......
......@@ -36,6 +36,7 @@ from kamaki.clients.utils import path4url
class PithosRestClient(StorageClient):
service_type = 'object-store'
def account_head(
self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment