Skip to main content

Python client for AEM API

Project description

Build Status Published Version Vulnerability Scanning Status

PythonAEM

PythonAEM is a Python client for Adobe Experience Manager (AEM) API. It is written on top of swaggeraem and provides resource-oriented API and convenient response handling.

Learn more about PythonAEM:

pythonaem is part of AEM OpenCloud platform but it can be used as a stand-alone.

Installation

pip3 install pythonaem

Usage

Initialise client:

from pythonaem import PythonAem

conf = {
    'username': 'admin',
    'password': 'admin',
    'protocol': 'http',
    'host': 'localhost',
    'port': 4502,
}
aem = PythonAem(conf)

Aem:

result = aem.get_aem_health_check({
    'tags': 'shallow',
    'combine_tags_or': 'false',
})

Flush agent:

flush_agent = aem.flush_agent('author', 'some-flush-agent')

# create or update flush agent
result = flush_agent.create_update('Some Flush Agent Title', 'Some flush agent description', 'http://somehost:8080')

# check flush agent's existence
result = flush_agent.exists()

# delete flush agent
result = flush_agent.delete()

Replication agent:

replication_agent = aem.replication_agent('author', 'some-flush-agent')

# create or update replication agent
result = replication_agent('author', 'some-replication-agent')

# check replication agent's existence
result = replication_agent.exists()

# delete replication agent
result = replication_agent.delete()

Result

Each of the above method calls returns a Result, which contains message, Response, and data payload. For example:

flush_agent = aem.flush_agent('author', 'some-inexisting-flush-agent')
result = flush_agent.delete()
print(result.message)
print(result.response.status_code)
print(result.response.body)
print(result.response.headers)
print(result.data)

Error Handling

flush_agent = aem.flush_agent('author', 'some-inexisting-flush-agent')
try:
    result = flush_agent.delete()
except Exception as error:
    self.assertEqual(error.message, 'Flush agent some-inexisting-flush-agent not found on author')

Testing

Integration tests require an AEM instance with Shine Solutions AEM Health Check package installed.

By default it uses AEM running on http://localhost:4502 with admin username and admin password. AEM instance parameters can be configured using environment variables aem_protocol, aem_host, aem_port, aem_username, and aem_password.

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

pythonaem-1.2.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

pythonaem-1.2.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file pythonaem-1.2.0.tar.gz.

File metadata

  • Download URL: pythonaem-1.2.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for pythonaem-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b0f1bd2eabc3778195c4076bf66a2e4325ca30486fd91bb5b5106980f066e076
MD5 debf2323970f2d150b5ba192b3b2dec5
BLAKE2b-256 8ec4c4896ca94a0e084003558ef08c3cde9559d4216a78af0eed8145f5078c10

See more details on using hashes here.

File details

Details for the file pythonaem-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pythonaem-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for pythonaem-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88fc8b3dfa8601bff6ee4d9ceace20666d8d6bc6e6f53e5c24186e81fe53ae65
MD5 702066e7ba14b7a703cb6cd538b32239
BLAKE2b-256 dfc398912c633b908032dc2d2eb7dcc3774805a70a72a136ed8135dc9487791a

See more details on using hashes here.

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