#NEWLINE# def create_node( self , name , size , image , location , ex_ssh_key_ids = None ) : #NEWLINE# #INDENT# '\n        Create a node.\n\n        :keyword    ex_ssh_key_ids: A list of ssh key ids which will be added\n                                   to the server. (optional)\n        :type       ex_ssh_key_ids: ``list`` of ``str``\n\n        :return: The newly created node.\n        :rtype: :class:`Node`\n        ' #NEWLINE# params = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'size_id' : size . id , #NEWLINE# 'image_id' : image . id , #NEWLINE# 'region_id' : location . id , #NEWLINE# #UNINDENT# } #NEWLINE# if ex_ssh_key_ids : #NEWLINE# #INDENT# params [ 'ssh_key_ids' ] = ',' . join ( ex_ssh_key_ids ) #NEWLINE# #UNINDENT# data = self . connection . request ( '/v1/droplets/new' , params = params ) #NEWLINE# status = data . object . get ( 'status' , 'OK' ) #NEWLINE# if ( status == 'ERROR' ) : #NEWLINE# #INDENT# message = data . object . get ( 'message' , None ) #NEWLINE# error_message = data . object . get ( 'error_message' , message ) #NEWLINE# raise ValueError ( ( 'Failed to create node: %s' % self ) ) #NEWLINE# #UNINDENT# return self . _to_node ( data = data . object [ 'droplet' ] )