本文整理汇总了Python中NaServer.set_vfiler方法的典型用法代码示例。如果您正苦于以下问题:Python NaServer.set_vfiler方法的具体用法?Python NaServer.set_vfiler怎么用?Python NaServer.set_vfiler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NaServer
的用法示例。
在下文中一共展示了NaServer.set_vfiler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: import NaServer [as 别名]
# 或者: from NaServer import set_vfiler [as 别名]
sys.exit (2)
# Set the login and password used for authenticating when
# an ONTAPI API is invoked.
# When Host_equiv is set,dont set username ,password
if(host_equiv != 1 and use_cba != 1):
s.set_admin_user(user, password)
# Set the name of the vfiler on which the API
# commands need to be invoked.
#
if (dovfiler):
s.set_vfiler(vfiler_name)
if (send_oid):
s.set_originator_id(originator_id)
# Set the Type of API Server.
#
response = s.set_server_type(server_type)
if (response and response.results_errno() != 0) :
r = response.results_reason()
print ("Unable to set server transport" + r + "\n")
sys.exit (2)
if(set_timeout == 1) :
示例2: print_usage
# 需要导入模块: import NaServer [as 别名]
# 或者: from NaServer import set_vfiler [as 别名]
else:
print_usage()
else:
vfiler = opt
filer = sys.argv[2]
user = sys.argv[3]
password = sys.argv[4]
arguments = sys.argv[5:]
# open server
server = NaServer(filer, 1, 7)
if(not server.set_vfiler(vfiler)):
print ("Error: ONTAPI version must be at least 1.7 to send API to a vfiler\n")
sys.exit (2)
server.set_admin_user(user, password)
if (dossl) :
resp = server.set_transport_type("HTTPS")
if (resp and resp.results_errno() != 0) :
r = resp.results_reason()
print ("Unable to set HTTPS transport " + r + "\n")
sys.exit (2)
if(len(arguments) > 0):
# invoke the api with api name and any supplied key-value pairs