hemlock_rest/hemlock_rest.py
def POST(self):
        """
        POSTs the create actions of the API.

        :return: returns the result of the action
        """
        cmd = ""
        try:
            self.data = ast.literal_eval(self.data)
            if "role" in self.fullpath:
                cmd = "hemlock role-create --name "+self.data['name']
                return os.popen(cmd).read()
            elif "schedule_server" in self.fullpath:
                cmd = "hemlock schedule-server-create --name "+self.data['name']
                return os.popen(cmd).read()
            elif "tenant" in self.fullpath:
                cmd = "hemlock tenant-create --name "+self.data['name']
                return os.popen(cmd).read()
            elif "schedule" in self.fullpath:
                cmd = "hemlock client-schedule --name "+self.data['name']+" --minute "+self.data['minute']+" --hour "+self.data['hour']+" --day_of_month "+self.data['day_of_month']+" --month "+self.data['month']+" --day_of_week "+self.data['day_of_week']+" --client_id "+self.data['client_id']
                return os.popen(cmd).read()
            elif "client" in self.fullpath:
                # !! TODO add no_coucnhase flag
                cmd = "hemlock client-store --name "+self.data['name']+" --type "+self.data['type']+" --system_id "+self.data['system_id']+" --credential_file "+self.data['credential_file']
                return os.popen(cmd).read()
            elif "hemlock-server" in self.fullpath:
                cmd = "hemlock hemlock-server-store --credential_file "+self.data['credential_file']
                return os.popen(cmd).read()
            elif "user" in self.fullpath:
                cmd = "hemlock user-create --name "+self.data['name']+" --username "+self.data['username']+" --email "+self.data['email']+" --role_id "+self.data['role_id']+" --tenant_id "+self.data['tenant_id']
                child = pexpect.spawn(cmd)
                child.expect('Password:')
                child.sendline(self.data['password'])
                return child.read()
        except:
            print "failure"
        return

        POSTs the create actions of the API.

        :return: returns the result of the action
        
POSTs the create actions of the API.
POSTs the create actions of the API .
def POST(self):
        cmd = ""
        try:
            self.data = ast.literal_eval(self.data)
            if "role" in self.fullpath:
                cmd = "hemlock role-create --name "+self.data['name']
                return os.popen(cmd).read()
            elif "schedule_server" in self.fullpath:
                cmd = "hemlock schedule-server-create --name "+self.data['name']
                return os.popen(cmd).read()
            elif "tenant" in self.fullpath:
                cmd = "hemlock tenant-create --name "+self.data['name']
                return os.popen(cmd).read()
            elif "schedule" in self.fullpath:
                cmd = "hemlock client-schedule --name "+self.data['name']+" --minute "+self.data['minute']+" --hour "+self.data['hour']+" --day_of_month "+self.data['day_of_month']+" --month "+self.data['month']+" --day_of_week "+self.data['day_of_week']+" --client_id "+self.data['client_id']
                return os.popen(cmd).read()
            elif "client" in self.fullpath:
                cmd = "hemlock client-store --name "+self.data['name']+" --type "+self.data['type']+" --system_id "+self.data['system_id']+" --credential_file "+self.data['credential_file']
                return os.popen(cmd).read()
            elif "hemlock-server" in self.fullpath:
                cmd = "hemlock hemlock-server-store --credential_file "+self.data['credential_file']
                return os.popen(cmd).read()
            elif "user" in self.fullpath:
                cmd = "hemlock user-create --name "+self.data['name']+" --username "+self.data['username']+" --email "+self.data['email']+" --role_id "+self.data['role_id']+" --tenant_id "+self.data['tenant_id']
                child = pexpect.spawn(cmd)
                child.expect('Password:')
                child.sendline(self.data['password'])
                return child.read()
        except:
            print "failure"
        return
def POST ( self ) : cmd = "" try : self . data = ast . literal_eval ( self . data ) if "role" in self . fullpath : cmd = "hemlock role-create --name " + self . data [ 'name' ] return os . popen ( cmd ) . read ( ) elif "schedule_server" in self . fullpath : cmd = "hemlock schedule-server-create --name " + self . data [ 'name' ] return os . popen ( cmd ) . read ( ) elif "tenant" in self . fullpath : cmd = "hemlock tenant-create --name " + self . data [ 'name' ] return os . popen ( cmd ) . read ( ) elif "schedule" in self . fullpath : cmd = "hemlock client-schedule --name " + self . data [ 'name' ] + " --minute " + self . data [ 'minute' ] + " --hour " + self . data [ 'hour' ] + " --day_of_month " + self . data [ 'day_of_month' ] + " --month " + self . data [ 'month' ] + " --day_of_week " + self . data [ 'day_of_week' ] + " --client_id " + self . data [ 'client_id' ] return os . popen ( cmd ) . read ( ) elif "client" in self . fullpath : cmd = "hemlock client-store --name " + self . data [ 'name' ] + " --type " + self . data [ 'type' ] + " --system_id " + self . data [ 'system_id' ] + " --credential_file " + self . data [ 'credential_file' ] return os . popen ( cmd ) . read ( ) elif "hemlock-server" in self . fullpath : cmd = "hemlock hemlock-server-store --credential_file " + self . data [ 'credential_file' ] return os . popen ( cmd ) . read ( ) elif "user" in self . fullpath : cmd = "hemlock user-create --name " + self . data [ 'name' ] + " --username " + self . data [ 'username' ] + " --email " + self . data [ 'email' ] + " --role_id " + self . data [ 'role_id' ] + " --tenant_id " + self . data [ 'tenant_id' ] child = pexpect . spawn ( cmd ) child . expect ( 'Password:' ) child . sendline ( self . data [ 'password' ] ) return child . read ( ) except : print "failure" return
POSTs the create actions of the API.
POSTs the create actions of the API .
"""
        POSTs the create actions of the API.

        :return: returns the result of the action
        """ # !! TODO add no_coucnhase flag
returns the result of the action
returns the result of the action
self