本文整理汇总了Python中kmip.services.kmip_client.KMIPProxy.activate方法的典型用法代码示例。如果您正苦于以下问题:Python KMIPProxy.activate方法的具体用法?Python KMIPProxy.activate怎么用?Python KMIPProxy.activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kmip.services.kmip_client.KMIPProxy
的用法示例。
在下文中一共展示了KMIPProxy.activate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: KMIPProxy
# 需要导入模块: from kmip.services.kmip_client import KMIPProxy [as 别名]
# 或者: from kmip.services.kmip_client.KMIPProxy import activate [as 别名]
# Exit early if the UUID is not specified
if uuid is None:
logging.debug('No UUID provided, exiting early from demo')
sys.exit()
# Build and setup logging and needed factories
f_log = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
'logconfig.ini')
logging.config.fileConfig(f_log)
logger = logging.getLogger(__name__)
# Build the client and connect to the server
client = KMIPProxy(config=config)
client.open()
# Activate the object
result = client.activate(uuid)
client.close()
# Display operation results
logger.info('activate() result status: {0}'.format(
result.result_status.enum))
if result.result_status.enum == ResultStatus.SUCCESS:
logger.info('activated UUID: {0}'.format(result.uuid.value))
else:
logger.info('activate() result reason: {0}'.format(
result.result_reason.enum))
logger.info('activate() result message: {0}'.format(
result.result_message.value))