pyaem2 package

Submodules

pyaem2.bagofrequests module

pyaem2.bagofrequests.download_file(url, params, handlers, **kwargs)[source]

Downloads a file from specified URL, the file will be downloaded to path specified in file kwarg. Parameters will be appended to URL automatically on HTTP get method. Response code will then be used to determine which handler should process the response. When response code does not match any handler, an exception will be raised.

Parameters
  • url (str) – URL to send HTTP request to

  • params (dict) – Request parameters key-value pairs, use array value to represent multi parameters with the same name

  • handlers (dict) – Response handlers key-value pairs, keys are response http code, values are callback methods

  • kwargs (dict) – file (str) – Location where the downloaded file will be saved to

Returns

PyAem2Result – The result containing status, response http code and body, and request info

Raises

PyAem2Exception

pyaem2.bagofrequests.request(method, url, params, handlers, **kwargs)[source]

Sends HTTP request to a specified URL. Parameters will be appended to URL automatically on HTTP get method. Response code will then be used to determine which handler should process the response. When response code does not match any handler, an exception will be raised.

Parameters
  • method (str) – HTTP method (post, delete, get)

  • url (str) – URL to send HTTP request to

  • params (dict) – Request parameters key-value pairs, use array value to represent multi parameters with the same name

  • handlers (dict) – Response handlers key-value pairs, keys are response http code, values are callback methods

Returns

PyAem2Result – Result of the request containing status, response http code and body, and request info

Raises

PyAem2Exception

pyaem2.bagofrequests.upload_file(url, params, handlers, **kwargs)[source]

Uploads a file using the specified URL endpoint, the file to be uploaded must be available at the specified location in file kwarg. Parameters will be appended to URL automatically on HTTP get method. Response code will then be used to determine which handler should process the response. When response code does not match any handler, an exception will be raised.

Parameters
  • url (str) – URL to send HTTP request to

  • params (dict) – Request parameters key-value pairs, use array value to represent multi parameters with the same name

  • handlers (dict) – Response handlers key-value pairs, keys are response http code, values are callback methods

  • kwargs (dict) – file (str) – Location of the file to be uploaded

Returns

PyAem2Result – The result containing status, response http code and body, and request info

Raises

PyAem2Exception

pyaem2.contentrepo module

class pyaem2.contentrepo.ContentRepo(url, **kwargs)[source]

Bases: object

activate_path(path, **kwargs)[source]
add_user_to_group(user_name, group_path, group_name, **kwargs)[source]
change_password(user_path, user_name, old_password, new_password, **kwargs)[source]
create_agent(agent_name, agent_type, dest_username, dest_password, dest_url, run_mode, **kwargs)[source]
create_group(group_path, group_name, **kwargs)[source]
create_path(path, **kwargs)[source]
create_user(user_path, user_name, password, **kwargs)[source]
delete_agent(agent_name, run_mode, **kwargs)[source]
delete_path(path, **kwargs)[source]
disable_workflow(workflow, glob, edit, node_type, run_mode, **kwargs)[source]
does_group_exist(group_path, group_name, **kwargs)[source]
does_user_exist(user_path, user_name, **kwargs)[source]
enable_workflow(workflow, glob, edit, node_type, run_mode, **kwargs)[source]
get_cluster_list(**kwargs)[source]
set_permission(user_or_group_name, path, permissions, **kwargs)[source]
set_property(path, property_name, property_value, **kwargs)[source]

pyaem2.exception module

exception pyaem2.exception.PyAem2Exception(code, message, response)[source]

Bases: Exception

pyaem2.handlers module

pyaem2.handlers.auth_fail(response, **kwargs)[source]
pyaem2.handlers.method_not_allowed(response, **kwargs)[source]
pyaem2.handlers.unexpected(response, **kwargs)[source]

pyaem2.packagemanager module

class pyaem2.packagemanager.PackageManager(url, **kwargs)[source]

Bases: object

download_package(group_name, package_name, package_version, file_path, **kwargs)[source]
update_package(group_name, package_name, package_version, **kwargs)[source]
update_package_with_filter(group_name, package_name, package_version, filter_paths, **kwargs)[source]

pyaem2.packagemanagerservicehtml module

class pyaem2.packagemanagerservicehtml.PackageManagerServiceHtml(url, **kwargs)[source]

Bases: object

Package Manager service using /crx/packmgr/service/script.html AEM endpoint.

The endpoint’s response payload is in HTML format with message embedded in:

  • <textarea>the message</textarea> fragment when status code is 200

  • <div id=”message”>the message</div> fragment when status code is 201

The Adobe consultant I worked with advised me that this endpoint provides a ‘more synchronous’ operations compared to its /crx/packmgr/service/.json counterpart.

Check out PackageManager, PackageManagerServiceJson, and PackageManagerServiceJsp for other package-related services.

install_package(group_name, package_name, package_version, **kwargs)[source]
replicate_package(group_name, package_name, package_version, **kwargs)[source]
upload_package(group_name, package_name, package_version, file_path, **kwargs)[source]

pyaem2.packagemanagerservicejson module

class pyaem2.packagemanagerservicejson.PackageManagerServiceJson(url, **kwargs)[source]

Bases: object

build_package(group_name, package_name, package_version, **kwargs)[source]
create_package(group_name, package_name, package_version, **kwargs)[source]
delete_package(group_name, package_name, package_version, **kwargs)[source]
install_package(group_name, package_name, package_version, **kwargs)[source]
replicate_package(group_name, package_name, package_version, **kwargs)[source]
upload_package(group_name, package_name, package_version, file_path, **kwargs)[source]

pyaem2.packagemanagerservicejsp module

class pyaem2.packagemanagerservicejsp.PackageManagerServiceJsp(url, **kwargs)[source]

Bases: object

is_package_installed(group_name, package_name, package_version, **kwargs)[source]
is_package_uploaded(group_name, package_name, package_version, **kwargs)[source]

pyaem2.pyaem2 module

class pyaem2.pyaem2.PyAem2(username, password, host, port, use_ssl=False, debug=False)[source]

Bases: object

activate_path(path, **kwargs)[source]
add_user_to_group(user_name, group_path, group_name, **kwargs)[source]
build_package(group_name, package_name, package_version, **kwargs)[source]
change_password(user_path, user_name, old_password, new_password, **kwargs)[source]
create_agent(agent_name, agent_type, dest_username, dest_password, dest_url, run_mode, **kwargs)[source]
create_group(group_path, group_name, **kwargs)[source]
create_package(group_name, package_name, package_version, **kwargs)[source]
create_path(path, **kwargs)[source]
create_user(user_path, user_name, password, **kwargs)[source]
delete_agent(agent_name, run_mode, **kwargs)[source]
delete_package(group_name, package_name, package_version, **kwargs)[source]
delete_path(path, **kwargs)[source]
does_group_exist(group_path, group_name, **kwargs)[source]
does_user_exist(user_path, user_name, **kwargs)[source]
download_package(group_name, package_name, package_version, file_path, **kwargs)[source]
install_bundle(bundle_name, bundle_version, file_path, **kwargs)[source]
install_package(group_name, package_name, package_version, **kwargs)[source]
install_package_sync(group_name, package_name, package_version, **kwargs)[source]
is_package_installed(group_name, package_name, package_version, **kwargs)[source]
is_package_uploaded(group_name, package_name, package_version, **kwargs)[source]
is_valid_login(**kwargs)[source]
replicate_package(group_name, package_name, package_version, **kwargs)[source]
replicate_package_sync(group_name, package_name, package_version, **kwargs)[source]
set_permission(user_or_group_name, path, permissions, **kwargs)[source]
set_property(path, property_name, property_value, **kwargs)[source]
start_bundle(bundle_name, **kwargs)[source]
stop_bundle(bundle_name, **kwargs)[source]
update_package(group_name, package_name, package_version, **kwargs)[source]
update_package_with_filter(group_name, package_name, package_version, filter_paths, **kwargs)[source]
upload_package(group_name, package_name, package_version, file_path, **kwargs)[source]
upload_package_sync(group_name, package_name, package_version, file_path, **kwargs)[source]

pyaem2.result module

class pyaem2.result.PyAem2Result(response)[source]

Bases: object

debug()[source]
failure(message)[source]
is_failure()[source]
is_success()[source]
is_warning()[source]
success(message)[source]
warning(message)[source]

pyaem2.sling module

class pyaem2.sling.Sling(url, **kwargs)[source]

Bases: object

is_valid_login(**kwargs)[source]

pyaem2.webconsole module

class pyaem2.webconsole.WebConsole(url, **kwargs)[source]

Bases: object

install_bundle(bundle_name, bundle_version, file_path, **kwargs)[source]
start_bundle(bundle_name, **kwargs)[source]
stop_bundle(bundle_name, **kwargs)[source]

Module contents