Create config file version 3
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Fri, 31 May 2013 10:29:18 +0000 (13:29 +0300)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Fri, 31 May 2013 10:29:18 +0000 (13:29 +0300)
Refs: #3874

Minimum config file:
[global]
token = <user token>

Changes:

- Only one field "cli" for user command specs, to map command groups to CLIs:

[cli]
 user = astakos
 file = pithos
 server = cyclades
...

- Specify client services/apis and versions.
 General format:
 [client]
  type = <service>
  version = <api version>

 Example:
 [cyclades]
  type = compute
  version = v2.0

kamaki/cli/config.py

index 2968e6d..280f2a3 100644 (file)
@@ -50,39 +50,47 @@ HISTORY_PATH = os.path.expanduser('~/.kamaki.history')
 CONFIG_ENV = 'KAMAKI_CONFIG'
 
 HEADER = """
-# Kamaki configuration file v2
+# Kamaki configuration file v3
 """
 
 DEFAULTS = {
     'global': {
         'colors': 'off',
-        'account':  '',
         'token': '',
         'log_file': os.path.expanduser('~/.kamaki.log'),
         'log_token': 'off',
         'log_data': 'off',
-        'max_threads': 7
+        'max_threads': 7,
+        'url': 'https://accounts.okeanos.grnet.gr/astakos/identity/v2.0/'
+    },
+    'cli': {
+        'user': 'astakos',
+        'file': 'pithos',
+        'server': 'cyclades',
+        'flavor': 'cyclades',
+        'network': 'cyclades',
+        'image': 'image',
+        'config': 'config',
+        'history': 'history'
     },
-    'config': {'cli': 'config'},
     'history': {
-        'cli': 'history',
         'file': HISTORY_PATH
     },
-    'file': {
-        'cli': 'pithos',
-        'url': 'https://pithos.okeanos.grnet.gr/v1'
+    'pithos': {
+        'type': 'object-storage',
+        'version': 'v2'
     },
-    'compute': {'url': 'https://cyclades.okeanos.grnet.gr/api/v1.1'},
-    'server': {'cli': 'cyclades'},
-    'flavor': {'cli': 'cyclades'},
-    'network': {'cli': 'cyclades'},
-    'image': {
-        'cli': 'image',
-        'url': 'https://cyclades.okeanos.grnet.gr/plankton'
+    'cyclades': {
+        'type': 'compute',
+        'version': 'v2.0'
+        },
+    'plankton': {
+        'type': 'image',
+        'version': 'v2.0'
     },
-    'user': {
-        'cli': 'astakos',
-        'url': 'https://accounts.okeanos.grnet.gr'
+    'astakos': {
+        'type': 'identity',
+        'version': 'v2.0'
     }
 }