Expand my Community achievements bar.

SOLVED

Upload Assets into Cloud Storage - AEM as Cloud Service

Avatar

Community Advisor

I would like to upload assets (binary) into cloud storage with every 2 hour schedule. In every 2 hour, I will be making a call to external API, which will provide me the list of URLs which holds the assets, I will need to upload/update these assets into cloud storage.

 

Current application runs within AEM on premise version, which is driven by a scheduler which runs every 2 hours. As we are planning to migrate to AEM as Cloud Service, We cannot use the Asset HTTP API as it's deprecated in AEM as Cloud Service.

 

Which one will be best option here to achive these use case?

Also the existing scheduler cannot be used as on Cloud, it will be running on container and it can come and go at any time.

 

Also as per adobe documentation, HTTP API can be used but it needs to run as an external application which should not run on the same JVM where AEM is running.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

 

Thanks,

Asutosh

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Asutosh,

so do I understand you correctly, that you have assets stored at a remote location, and that you need to move them from that location to AEMaaCS Assets?

 

I think that the only way to handle this is to get these assets to a location which is available via filesystem (and that can mean that you download them from the remote location/storage) and then upload them to AEM assets. I am not aware of any "pull service" im AEMaaCS which you just pass URLs and credentials and which does that for you.

View solution in original post

8 Replies

Avatar

Employee Advisor

There is the AEM upload tool available (https://github.com/adobe/aem-upload) which is a sample Node application to upload assets into AEM CS. 

 

Towards your statement:

Also the existing scheduler cannot be used as on Cloud, it will be running on container and it can come and go at any time.

 

You can definitely implement this safely. You can build a scheduled Sling Job, which will run every 2 hours on a author node in the author cluster, which can execute the requested operation in a safe way; and it also ensures that it runs only once.

 

Avatar

Community Advisor

Thanks @Jörg_Hoh 

We will be getting the assets from URL from which we need to get the asset and upload the assets into AEM. I am using a similar approach what is mentioned in the aem-upload library. Is there any way we can get the assets from URL?

 

Thanks 

Avatar

Correct answer by
Employee Advisor

Hi Asutosh,

so do I understand you correctly, that you have assets stored at a remote location, and that you need to move them from that location to AEMaaCS Assets?

 

I think that the only way to handle this is to get these assets to a location which is available via filesystem (and that can mean that you download them from the remote location/storage) and then upload them to AEM assets. I am not aware of any "pull service" im AEMaaCS which you just pass URLs and credentials and which does that for you.

Avatar

Community Advisor

Hi @arunpatidar 

Thanks for these details. I can see the Java Standalone application and it works but is there any way I can load the assets from an URL? Here I see the files are available on system, but I want to load the files from URL which will be dynamic.

Avatar

Community Advisor

Hi,

I think you can do it,

you need binary response and other asset props, that you can extract in the java and do a post request to upload.

 



Arun Patidar

Avatar

Level 7

As Joerg explained, you can use the AEM Upload utility for pushing assets from external application to AEM. There is as such no way by which you can create assets in AEM via API.

 

Refer below table to understand what are the ways by which you can create assets in AEM:

 

Use case aem-upload Experience Manager / Sling / JCR Java APIs Asset compute service Assets HTTP API Sling GET / POST servlets GraphQL
Original binary            
Create original × - × × -
Read original - × -
Update original × × × -
Delete original - - -
Copy original - - -
Move original - - -
Metadata            
Create metadata - -
Read metadata - - -
Update metadata - -
Delete metadata - -
Copy metadata - - -
Move metadata - - -
Content Fragments (CF)            
Create CF - - - -
Read CF - - -
Update CF - - - -
Delete CF - - - -
Copy CF - - - -
Move CF - - - -
Versions            
Create version - - - -
Read version - - - - -
Delete version - - - - -
Folders            
Create folder - - -
Read folder - - - -
Delete folder - - -
Copy folder - - -
Move folder - -

 

 

Also, In Experience Manager as a Cloud Service, you can directly upload the assets to the cloud storage using HTTP API. The steps to upload a binary file are below. Execute these steps in an external application and not within the Experience Manager JVM.

  1. Submit an HTTP request. It informs Experience Manager deployment of your intent to upload a new binary.
  2. PUT the contents of the binary to one or more URIs provided by the initiation request.
  3. Submit an HTTP request to inform the server that the contents of the binary were successfully uploaded.

Refer for more details - https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...