用于weblogic rest api的python客户机

wls-rest-python的Python项目详细描述


https://travis-ci.org/magnuswatn/wls-rest-python.svg?branch=masterhttps://codecov.io/gh/magnuswatn/wls-rest-python/branch/master/graph/badge.svghttps://badge.fury.io/py/wls-rest-python.svghttps://img.shields.io/badge/code%20style-black-000000.svg

这是一个用于weblogics restful管理服务的python客户端。 它使用api来处理一些怪癖,而不必如此接近 联系到它变成了限制。

它根据服务器的响应动态创建python对象, 这样就很容易快速编写有用的pythonic脚本。

它是根据12.2.1.3进行测试的,但在所有12C R2版本中都可以正常工作。

安装

$ pipenv install wls-rest-python

示例用法

浏览API,更改属性并取消部署应用程序:

>>>fromwls_rest_pythonimportWLS>>>>>>wls=WLS('https://wls.example.com:7001','weblogic','welcome1')>>>>>>dir(wls.edit.batchConfig)['canonical','dynamicallyCreated','id','identity','name','notes','parent','schemaName','self','tags','type']>>>>>>wls.edit.servers.myServer.nativeIOEnabledTrue>>>wls.edit.servers.myServer.update(nativeIOEnabled=False)>>>wls.edit.servers.myServer.nativeIOEnabledFalse>>>wls.domainRuntime.deploymentManager.appDeploymentRuntimes.myApp.getState(...target='myServer'){'return':'STATE_ACTIVE'}>>>>>>wls.domainRuntime.deploymentManager.appDeploymentRuntimes.myApp.undeploy()>>>

异步启动所有托管服务器:

fromwls_rest_pythonimportWLSwls=WLS('https://wls.example.com:7001','weblogic','welcome1')admin_server_name=wls.edit.adminServerNamerunning_jobs=[]forserverinwls.domainRuntime.serverLifeCycleRuntimes:ifserver.name!=admin_server_name:running_jobs.append(server.start(prefer_async=True))whilerunning_jobs:forjobinrunning_jobs:ifjob.completed:running_jobs.remove(job)time.sleep(10)

取消部署所有应用程序并部署新的应用程序:

importjsonfromwls_rest_pythonimportWLSwls=WLS('https://wls.example.com:7001','weblogic','welcome1')fordeploymentinwls.edit.appDeployments:deployment.delete()deployment_model={'name':'myWebApp','targets':[{'identity':['servers','myServer']}]}deployment_info={'model':(None,json.dumps(deployment_model)),'sourcePath':open('/u01/wars/myWebApp.war','rb'),'planPath':open('/u01/wars/myWebAppPlan.xml','rb')}wls.edit.appDeployments.create(files=deployment_info)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javajavax。艾尔。PropertyNotFoundException:   java为什么通过TCP发送的文件比它本身包含的文件包含更多的数据?   java为什么字符开关/案例不起作用?   php到java连接器,在哪里可以找到好的连接器   需要帮助Java简单规则形状面积计算器和if语句吗   macos如何从newstyle Oracle Java OSX捆绑包结构启动帮助页?   java既然所有的类都扩展对象,而对象是一个类,那么对象如何扩展对象呢?   java从JavaPairdd<String,Tuple2<Integer,Integer>>转换为JavaPairdd<String,Integer>   java微调器值未从一个活动传递到另一个活动   参数化类型的java数组   java不提供类。getCanonicalName是否存在性能问题?   java输入键JTextField   为什么我不能在java中调用nextLine()方法两次?   JTextPane中的java JProgressBar   java如何获取Crudepository实例?   用于提取几个<div>标记的java正则表达式   java如何使用JUnit Testrunner生成html图像   Go中Java静态属性的等价性