Robot RequestsLibary should be used instead.
Change-Id: If6af408e1095a088c3137c291011186c81bf3b4e
Signed-off-by: Phillip Shea <phillip.shea@hp.com>
import robot
import time
import re
import robot
import time
import re
global _cache
def get(url, userId='admin', password='admin'):
"""Helps in making GET REST calls"""
global _cache
def get(url, userId='admin', password='admin'):
"""Helps in making GET REST calls"""
+ warnings.warn(
+ "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples",
+ DeprecationWarning
+ )
headers = {}
headers['Accept'] = 'application/xml'
headers = {}
headers['Accept'] = 'application/xml'
def nonprintpost(url, userId, password, data):
"""Helps in making POST REST calls without outputs"""
def nonprintpost(url, userId, password, data):
"""Helps in making POST REST calls without outputs"""
+ warnings.warn(
+ "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples",
+ DeprecationWarning
+ )
if userId is None:
userId = 'admin'
if userId is None:
userId = 'admin'
def post(url, userId, password, data):
"""Helps in making POST REST calls"""
def post(url, userId, password, data):
"""Helps in making POST REST calls"""
+ warnings.warn(
+ "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples",
+ DeprecationWarning
+ )
if userId is None:
userId = 'admin'
if userId is None:
userId = 'admin'
def delete(url, userId='admin', password='admin'):
"""Helps in making DELET REST calls"""
def delete(url, userId='admin', password='admin'):
"""Helps in making DELET REST calls"""
+ warnings.warn(
+ "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples",
+ DeprecationWarning
+ )
print("delete all resources belonging to url"+url)
session = _cache.switch("CLUSTERING_DELETE")
resp = session.delete(url, auth=(userId, password)) # noqa
print("delete all resources belonging to url"+url)
session = _cache.switch("CLUSTERING_DELETE")
resp = session.delete(url, auth=(userId, password)) # noqa