def createFolder(server, port, adminUser, adminPass, folderName, folderDescription, useSSL=True, token=None):    
    
    # Get and set the token
    if token is None:    
        token = gentoken(server, port, adminUser, adminPass, useSSL)    
    
    # Dictionary of properties to create a folder
    folderProp_dict = { "folderName": folderName,
                        "description": folderDescription                                            
                      }
    
    folder_encode = urllib.urlencode(folderProp_dict)            
    create = "{}{}{}/arcgis/admin/services/createFolder?token={}&f=json".format(getProtocol(useSSL), server, getPort(port), token)    
    status = urllib2.urlopen(create, folder_encode).read()

    
    if 'success' in status:
        print "Created folder: {}".format(folderName)
    else:
        print "Could not create folder"  
        print status
        
    return
Function to create a folder
dataset/ETHPy150Open Esri/ops-server-config/SupportFiles/AGSRestFunctions.py/createFolder