Expand my Community achievements bar.

AEM Cloud service version in Model

Avatar

Level 3

Hello All,

We have a requirement to send the AEM Cloud service version to other system. I was trying to find a solution for this.

Currently we configure in code and send. Do we have any API which gives us this .

Basically i am looking at the below info in my Model

 

arungm20_0-1705076676930.png

 

Thanks

Arun

6 Replies

Avatar

Community Advisor

No one that I am aware of.

 

Alternatively, you could explore the Cloud Manager API to leverage an environment variable that can be accessed without extra code. Then, you will have to keep this variable up to date. Here are some standard variables that are not accessible through the CM API but might be used to fill your custom variable: Link to Standard Variables



Esteban Bustamante

Avatar

Level 3

Thanks @narendragandhi . Seems like ProductInfo is deprecated

import org.osgi.annotation.versioning.ProviderType;

/**
 * <code>ProductInfoService</code> provides access to all {@link ProductInfo}s registered by {@link
 * ProductInfoProvider}s throughout the system.
 * @deprecated This interface is deprecated without a replacement
 */
@Deprecated
@ProviderType
public interface ProductInfoService {

    /**
     * Returns all registered {@link ProductInfo}s
     *
     * @return the product infos. At least one product info is returned.
     */
    ProductInfo[] getInfos();

    /**
     * Return the {@link License} registered for
     *
     * @return the license or <code>null</code>
     */
    License getLicense();
}

 

Avatar

Administrator

@arungm20 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 3

hi @kautuk_sahni 

Unfortunately could not find a library yet. Hence we decided to have it as an environment variable in the pipline so it can be changed when required

 

The solution by @narendragandhi  is good. however this is deprecated 

 

Thanks

Arun

Avatar

Level 8

Hi @arungm20 

 

I looked at the implementation of the About page that you provided in the screenshot above and found that it uses the ProductInfoService. If it is deprecated then I would also not recommend to use it.

 

Thanks

Narendra