Skip to main content

A Python client for the Weblogic REST API

Project description

This is a Python client for Weblogics RESTful Management Services. It takes care of some of the quirks with the API, without being so closely linked that it becomes limiting.

It creates Python objects dynamically based on the response from the server, so that it’s easy to quickly write useful and Pythonic scripts.

It’s tested against, but should work fine with all 12c R2 releases.


$ pipenv install wls-rest-python

Example usage

Explore the API, change properties and undeploy applications:

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

Start all managed servers asynchronously:

from wls_rest_python import WLS

wls = WLS('', 'weblogic', 'welcome1')

admin_server_name = wls.edit.adminServerName

running_jobs = []
for server in wls.domainRuntime.serverLifeCycleRuntimes:
    if != admin_server_name:

while running_jobs:
    for job in running_jobs:
        if job.completed:

Undeploy all applications and deploy a new one:

import json
from wls_rest_python import WLS

wls = WLS('', 'weblogic', 'welcome1')

for deployment in wls.edit.appDeployments:

deployment_model = {
    'name': 'myWebApp',
    'targets': [
        {'identity': [

deployment_info = {
    'model': (None, json.dumps(deployment_model)),
    'sourcePath': open('/u01/wars/myWebApp.war', 'rb'),
    'planPath': open('/u01/wars/myWebAppPlan.xml', 'rb')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wls-rest-python-0.1.4.tar.gz (6.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page