Exemplo n.º 1
0
    def ex_drives_list(self):
        """
        Return a list of all the available drives.
        """
        response = self.connection.request(action='/drives/info', method='GET')

        result = str2dicts(response.body)
        return result
Exemplo n.º 2
0
    def ex_static_ip_create(self):
        """
        Create a new static IP address.
        """
        response = self.connection.request(action = '/resources/ip/create', method = 'GET')

        result = str2dicts(response.body)
        return result
Exemplo n.º 3
0
    def ex_drives_list(self):
        """
        Return a list of all the available drives.
        """
        response = self.connection.request(action = '/drives/info', method = 'GET')

        result = str2dicts(response.body)
        return result
Exemplo n.º 4
0
    def ex_static_ip_create(self):
        """
        Create a new static IP address.
        """
        response = self.connection.request(action='/resources/ip/create',
                                           method='GET')

        result = str2dicts(response.body)
        return result
Exemplo n.º 5
0
 def test_str2dicts(self):
     string = "mem 1024\ncpu 2200\n\nmem2048\\cpu 1100"
     result = str2dicts(string)
     self.assertEqual(len(result), 2)
Exemplo n.º 6
0
    def _get_node_info(self, node):
        response = self.connection.request(action='/servers/%s/info' %
                                           (node.id))

        result = str2dicts(response.body)
        return result[0]
Exemplo n.º 7
0
    def parse_body(self):
        if not self.body:
            return self.body

        return str2dicts(self.body)
 def test_str2dicts(self):
     string = 'mem 1024\ncpu 2200\n\nmem2048\cpu 1100'
     result = str2dicts(string)
     self.assertEqual(len(result), 2)
Exemplo n.º 9
0
    def _get_node_info(self, node):
        response = self.connection.request(action = '/servers/%s/info' % (node.id))

        result = str2dicts(response.body)
        return result[0]
Exemplo n.º 10
0
    def parse_body(self):
        if not self.body:
            return self.body

        return str2dicts(self.body)