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¶
pyaem2.exception module¶
pyaem2.handlers module¶
pyaem2.packagemanager module¶
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.
pyaem2.packagemanagerservicejson module¶
pyaem2.packagemanagerservicejsp module¶
pyaem2.pyaem2 module¶
-
class
pyaem2.pyaem2.
PyAem2
(username, password, host, port, use_ssl=False, debug=False)[source]¶ Bases:
object
-
create_agent
(agent_name, agent_type, dest_username, dest_password, dest_url, run_mode, **kwargs)[source]¶
-