Example #1
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type" : "object",
            "properties" : {
                "cluster_name" : { "type" : "string" },
                "cluster_info" : {
                    "type" : "object",
                    "properties" : {
                        "infinidb_version" : { "type": "string" },
                        "dbroots_per_pm"   : { "type": "integer"},
                        "dbroot_list"      : {
                            "type": "array",
                            "items" : {
                                "type" : "array"
                            },
                            "required": False
                        },
                        "infinidb_user"    : { "type": "string"  },
                        "storage_type"     : {
                            "enum": ["local","hdfs","gluster"]   },
                        "pm_query"         : { "type": "boolean" },
                        "um_replication"   : { "type": "boolean" }
                    }
                },
                "role_info" : { "type" : "object" }
            }
        }

        JsonMsg.__init__( self, jsonstring, self.__schema )
Example #2
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_name":{
                 "type":"string",
                 "blank":False
             },
             "action":{
                 "type":"string",
                 "blank":False
             },
             "set_params":{
                 "required":False,
                 "items": {
                     "type":"object",
                     "properties": {
                         "em_category" : { "type": "string" },
                         "em_parameter" : { "type": "string" },
                         "value" : { "type": "string"  }
                     }
                 },
                 "minItems": 0 
             }
         }
     }   
     #print "jason string " +jsonstring
     JsonMsg.__init__( self, jsonstring, self.__schema )
     if ( not self.has_key('action') ):
         raise Exception('ConfigRequest ERROR - exactly one of action must be present')
Example #3
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "failed":{
                 "type":"boolean",
                 "blank":False
             },
             "msg":{
                 "type":"string",
                 "blank":False
             },
             "cmd":{
                 "type":"string",
                 "required":False
             },
             "rc":{
                 "type":"integer",
                 "required":False
             },
             "stdout":{
                 "type":"string",
                 "required":False
             },
             "stderr":{
                 "type":"string",
                 "required":False
             },
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
Example #4
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type": "object",
            "properties": {
                "cluster_name": {
                    "type": "string"
                },
                "config": {
                    "items": {
                        "type": "object",
                        "properties": {
                            "em_category": {
                                "type": "string"
                            },
                            "em_parameter": {
                                "type": "string"
                            },
                            "value": {
                                "type": "string"
                            }
                        }
                    },
                    "minItems": 0
                }
            }
        }

        JsonMsg.__init__(self, jsonstring, self.__schema)
Example #5
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type": "object",
            "properties": {
                "failed": {
                    "type": "boolean",
                    "blank": False
                },
                "msg": {
                    "type": "string",
                    "blank": False
                },
                "cmd": {
                    "type": "string",
                    "required": False
                },
                "rc": {
                    "type": "integer",
                    "required": False
                },
                "stdout": {
                    "type": "string",
                    "required": False
                },
                "stderr": {
                    "type": "string",
                    "required": False
                },
            }
        }

        JsonMsg.__init__(self, jsonstring, self.__schema)
Example #6
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_name":{
                 "type":"string",
                 "blank":False
             },
             "playbook_info" : {
                 "type":"object",
                 "properties" : {
                     "name" : { "type" : "string", "blank" : False },
                     "hostspec" : { "type" : "string", "blank" : False },
                     "extravars" : { "type" : "string" },                        
                 }                               
             },
             "rc" : { "type" : "integer" },
             "stdout" : { "type" : "string" },
             "stderr" : { "type" : "string" },
             "recap_info" : { "type" : "object", "required" : False }         
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
Example #7
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type": "object",
            "properties": {
                "cluster_name": {
                    "type": "string"
                },
                "cluster_info": {
                    "type": "object",
                    "properties": {
                        "infinidb_version": {
                            "type": "string"
                        },
                        "dbroots_per_pm": {
                            "type": "integer"
                        },
                        "dbroot_list": {
                            "type": "array",
                            "items": {
                                "type": "array"
                            },
                            "required": False
                        },
                        "infinidb_user": {
                            "type": "string"
                        },
                        "storage_type": {
                            "enum": ["local", "hdfs", "gluster"]
                        },
                        "pm_query": {
                            "type": "boolean"
                        },
                        "um_replication": {
                            "type": "boolean"
                        }
                    }
                },
                "role_info": {
                    "type": "object"
                }
            }
        }

        JsonMsg.__init__(self, jsonstring, self.__schema)
Example #8
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_name":{ "type":"string", "blank":False },
             "command":{ "type":"string", "blank":False },
             "console_host":{ "type":"string" },
             "rc":{ "type":"integer" },
             "stdout":{ "type":"string" },
             "stderr":{ "type":"string" },
             "results":{ "type":"object", "required":False },
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
Example #9
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_name":{
                 "type":"string",
                 "blank":False
             },
             "role_info" : {
                 "type":"object"                               
             }         
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
Example #10
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type": "object",
            "properties": {
                "cluster_name": {
                    "type": "string",
                    "blank": False
                },
                "hostnames": {
                    "items": {
                        "type": "string"
                    },
                    "minItems": 1
                },
                "ssh_user": {
                    "type": "string",
                    "blank": False
                },
                "ssh_key": {
                    "type": "string",
                    "required": False
                },
                "ssh_pass": {
                    "type": "string",
                    "required": False
                },
                "ssh-port": {
                    "type": "integer",
                    "required": False
                }
            }
        }

        JsonMsg.__init__(self, jsonstring, self.__schema)
        if ( self.has_key('ssh_key') and self.has_key('ssh_pass') ) or\
            ( not self.has_key('ssh_key') and not self.has_key('ssh_pass') ):
            raise Exception(
                'FoctRequest ERROR - exactly one of ssh_key, ssh_pass must be present'
            )
Example #11
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_name":{
                 "type":"string",
                 "blank":False
             },
             "hostnames": {
                 "items": {
                     "type":"string"
                 },
                 "minItems": 1
             },
             "ssh_user":{
                 "type":"string",
                 "blank":False
             },
             "ssh_key":{
                 "type":"string",
                 "required": False
             },
             "ssh_pass":{
                 "type":"string",
                 "required": False
             },
             "ssh-port":{
                 "type":"integer",
                 "required": False
             }
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
     if ( self.has_key('ssh_key') and self.has_key('ssh_pass') ) or\
         ( not self.has_key('ssh_key') and not self.has_key('ssh_pass') ):
         raise Exception('FoctRequest ERROR - exactly one of ssh_key, ssh_pass must be present')
Example #12
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_info" : {
                 "type":"object",
                 "properties": {
                     "valid" : { "type": "boolean" },
                     "name" : { "type": "string" },
                     "os_family" : { "type": "string" },
                     "gluster_version" : { "type": "string"  },
                     "hadoop_version" : { "type": "string" },
                     "infinidb_version" : { "type": "string" },
                     "em_version" : { "type": "string" },
                     "reason"     : { "type": "string", "required" : False }
                 }
             },
             "instance_info" : {
                 "type":"object",
                 "items": {
                     "type":"object",
                     "properties": {    
                         "valid" : { "type": "boolean" },
                         "ip_address" : { "type": "string" },
                         "gluster_version" : { "type": "string"  },
                         "hadoop_version" : { "type": "string" },
                         "reason"     : { "type": "string", "required" : False }
                     }
                 }
             },
             "role_info" : {
                 "type":"object"                               
             }         
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
Example #13
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = {
         "type": "object",
         "properties": {
             "cluster_name": {
                 "type": "string",
                 "blank": False
             },
             "action": {
                 "type": "string",
                 "blank": False
             },
             "set_params": {
                 "required": False,
                 "items": {
                     "type": "object",
                     "properties": {
                         "em_category": {
                             "type": "string"
                         },
                         "em_parameter": {
                             "type": "string"
                         },
                         "value": {
                             "type": "string"
                         }
                     }
                 },
                 "minItems": 0
             }
         }
     }
     #print "jason string " +jsonstring
     JsonMsg.__init__(self, jsonstring, self.__schema)
     if (not self.has_key('action')):
         raise Exception(
             'ConfigRequest ERROR - exactly one of action must be present')
Example #14
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type": "object",
            "properties": {
                "cluster_name": {
                    "type": "string",
                    "blank": False
                },
                "command": {
                    "type": "string",
                    "blank": False
                },
                "args": {
                    "type": "string",
                    "required": False
                },
            }
        }

        JsonMsg.__init__(self, jsonstring, self.__schema)
Example #15
0
 def __init__(self, jsonstring):
     '''
     Constructor.
     '''
     self.__schema = { 
         "type":"object",
         "properties": {
             "cluster_name":{
                 "type":"string",
                 "blank":False
             },
             "command":{
                 "type":"string",
                 "blank":False
             },
             "args":{
                 "type":"string",
                 "required":False
             },
         }
     }
     
     JsonMsg.__init__( self, jsonstring, self.__schema )
Example #16
0
    def __init__(self, jsonstring):
        '''
        Constructor.
        '''
        self.__schema = {
            "type": "object",
            "properties": {
                "cluster_info": {
                    "type": "object",
                    "properties": {
                        "valid": {
                            "type": "boolean"
                        },
                        "name": {
                            "type": "string"
                        },
                        "os_family": {
                            "type": "string"
                        },
                        "gluster_version": {
                            "type": "string"
                        },
                        "hadoop_version": {
                            "type": "string"
                        },
                        "infinidb_version": {
                            "type": "string"
                        },
                        "em_version": {
                            "type": "string"
                        },
                        "reason": {
                            "type": "string",
                            "required": False
                        }
                    }
                },
                "instance_info": {
                    "type": "object",
                    "items": {
                        "type": "object",
                        "properties": {
                            "valid": {
                                "type": "boolean"
                            },
                            "ip_address": {
                                "type": "string"
                            },
                            "gluster_version": {
                                "type": "string"
                            },
                            "hadoop_version": {
                                "type": "string"
                            },
                            "reason": {
                                "type": "string",
                                "required": False
                            }
                        }
                    }
                },
                "role_info": {
                    "type": "object"
                }
            }
        }

        JsonMsg.__init__(self, jsonstring, self.__schema)