def stopStartServices(server, port, adminUser, adminPass, stopStart, serviceList, useSSL=True, token=None):    
    
    # Get and set the token
    if token is None:       
        token = gentoken(server, port, adminUser, adminPass, useSSL)
    
    # modify the services(s)    
    for service in serviceList:
        op_service_url = "{}{}{}/arcgis/admin/services/{}/{}?token={}&f=json".format(getProtocol(useSSL), server, getPort(port), service, stopStart, token)
        status = urllib2.urlopen(op_service_url, ' ').read()
        
        if 'success' in status:
            print (str(service) + " === " + str(stopStart))
        else:            
            print status
    
    return
Function to stop, start or delete a service.
dataset/ETHPy150Open Esri/ops-server-config/SupportFiles/AGSRestFunctions.py/stopStartServices