Esempio n. 1
0
 def listSites(self, args):
     data = self.api.listSites()
     list_data = []
     for site in data:
         json_obj = json.loads(site)
         list_data.append(json_obj)
     #print list_data
     gl_view.cli_view(list_data,"list-sites")
Esempio n. 2
0
 def deleteSite(self, args):
     if args.site_id == '':
         print ''
         print 'Command "glint delete-site" requires either varibale SITE_ID or argument --site-id'
         print ''
     else:
         data = self.api.deleteSite(args.site_id)
         gl_view.cli_view([data],"delete-site")
Esempio n. 3
0
 def getCredential(self, args):
     if args.site_id == '':
         print ''
         print 'Command "glint get-credential" requires either varibale SITE_ID or argument --site-id'
         print ''
     else:
         data = self.api.getCredential(args.site_id)
         gl_view.cli_view([data], "get-credential")
Esempio n. 4
0
 def deleteSite(self, args):
     if args.site_id == '':
         print ''
         print 'Command "glint delete-site" requires either varibale SITE_ID or argument --site-id'
         print ''
     else:
         data = self.api.deleteSite(args.site_id)
         gl_view.cli_view([data], "delete-site")
Esempio n. 5
0
 def listSites(self, args):
     data = self.api.listSites()
     list_data = []
     for site in data:
         json_obj = json.loads(site)
         list_data.append(json_obj)
     #print list_data
     gl_view.cli_view(list_data, "list-sites")
Esempio n. 6
0
 def getCredential(self, args):
     if args.site_id == '':
         print ''
         print 'Command "glint get-credential" requires either varibale SITE_ID or argument --site-id'
         print ''
     else:
         data = self.api.getCredential(args.site_id)
         gl_view.cli_view([data],"get-credential")
Esempio n. 7
0
 def hasCredential(self, args):
     if (args.site_id == '') and (args.ck_type == ''):
         print ''
         print 'Command "glint has-credential" requires either varibales SITE_ID and CK_TYPE or arguments --site-id and --ck-type'
         print ''
     elif args.site_id == '':
         print ''
         print 'Command "glint has-credential" requires either varibale SITE_ID or agument --site-id'
         print ''
     elif args.ck_type == '':
         print ''
         print 'Command "glint has-credential" requires either varibale CK_TYPE or a    gument --ck-type'
         print ''
     else:
         data = self.api.hasCredential(args.site_id, args.ck_type)
         gl_view.cli_view([data], "has-credential")
Esempio n. 8
0
 def hasCredential(self, args):
     if (args.site_id  == '') and (args.ck_type == ''):
         print ''
         print 'Command "glint has-credential" requires either varibales SITE_ID and CK_TYPE or arguments --site-id and --ck-type'
         print ''
     elif args.site_id == '':
         print ''
         print 'Command "glint has-credential" requires either varibale SITE_ID or agument --site-id'
         print ''
     elif args.ck_type == '':
         print ''
         print 'Command "glint has-credential" requires either varibale CK_TYPE or a    gument --ck-type'
         print ''
     else:
         data = self.api.hasCredential( args.site_id, args.ck_type)
         gl_view.cli_view([data],"has-credential")
Esempio n. 9
0
 def createSite(self, args):
     data = self.api.createSite(args.name,args.url,args.format)
     gl_view.cli_view([data],"create-site")
Esempio n. 10
0
 def imageDelete(self, args):
     data = self.api.imageDelete(args.image_name,args.image_source_site,args.image_source_tenant)
     gl_view.cli_view([data],"image-delete")
Esempio n. 11
0
 def imageCopy(self, args):
     data = self.api.imageCopy(args.image_name,args.image_source_site,[args.image_destination_site])
     gl_view.cli_view([data],"image-copy")
Esempio n. 12
0
 def getImages(self, args):
     data = self.api.getImages()
     gl_view.cli_view(data, "get-images")
Esempio n. 13
0
 def addCredential(self, args):
     #return self.api.addCredential(args.remote_tenant,args.remote_username,args.remote_password,args.remote_site_id)
     data = self.api.addCredential(args.remote_tenant,args.remote_username,args.remote_password,args.remote_site_id)
     gl_view.cli_view([data],"add-credential")
Esempio n. 14
0
 def createSite(self, args):
     data = self.api.createSite(args.name, args.url, args.format)
     gl_view.cli_view([data], "create-site")
Esempio n. 15
0
 def imageDelete(self, args):
     data = self.api.imageDelete(args.image_name, args.image_source_site,
                                 args.image_source_tenant)
     gl_view.cli_view([data], "image-delete")
Esempio n. 16
0
 def imageCopy(self, args):
     data = self.api.imageCopy(args.image_name, args.image_source_site,
                               [args.image_destination_site])
     gl_view.cli_view([data], "image-copy")
Esempio n. 17
0
 def addCredential(self, args):
     #return self.api.addCredential(args.remote_tenant,args.remote_username,args.remote_password,args.remote_site_id)
     data = self.api.addCredential(args.remote_tenant, args.remote_username,
                                   args.remote_password,
                                   args.remote_site_id)
     gl_view.cli_view([data], "add-credential")
Esempio n. 18
0
 def getImages(self, args):
     data = self.api.getImages()
     gl_view.cli_view(data,"get-images")
Esempio n. 19
0
data = [{
    u'name': u'Mosue',
    u'url': u'http://mouse01.heprc.uvic.ca:5000/v2.0',
    u'authport': u'5000',
    u'version': u'v2.0',
    u'pk': u'1',
    u'type': u'Openstack'
}, {
    u'name': u'Rateroni',
    u'url': u'http://rat01.heprc.uvic.ca:5000/v2.0',
    u'authport': u'5000',
    u'version': u'v2.0',
    u'pk': u'2',
    u'type': u'Openstack'
}]
g_view.cli_view(data, "list-sites")

#delete-credential
data = [{u'Result': u'Success removing Credential'}]
g_view.cli_view(data, "delete-credential")

#delete-site
data = [{u'Result': u'Successful Delete'}]
g_view.cli_view(data, "delete-site")

#create-site
data = [{u'site_id': 2, u'Result': u'Success'}]
g_view.cli_view(data, "create-site")

#add-credential
data = [{u'Result': u'Sites: add Credential'}]
Esempio n. 20
0
'''
Created on Mar 31, 2015

@author: ronaldjosephdesmarais
'''

import glintViewer as g_view

#list-sites
data = [{u'name': u'Mosue', u'url': u'http://mouse01.heprc.uvic.ca:5000/v2.0', u'authport': u'5000', u'version': u'v2.0', u'pk': u'1', u'type': u'Openstack'}, {u'name': u'Rateroni', u'url': u'http://rat01.heprc.uvic.ca:5000/v2.0', u'authport': u'5000', u'version': u'v2.0', u'pk': u'2', u'type': u'Openstack'}]
g_view.cli_view(data,"list-sites")

#delete-credential
data = [{u'Result': u'Success removing Credential'}]
g_view.cli_view(data,"delete-credential")

#delete-site
data = [{u'Result': u'Successful Delete'}]
g_view.cli_view(data,"delete-site")

#create-site
data = [{u'site_id': 2, u'Result': u'Success'}]
g_view.cli_view(data,"create-site")

#add-credential
data = [{u'Result': u'Sites: add Credential'}]
g_view.cli_view(data,"add-credential")

#has-credential
data = [{u'result': True, u'error': False}]
g_view.cli_view(data,"has-credential")