### Start Spartacus Storefront Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/610fe98c73e54bd4a9db391aac78d05d_locale=en-US&state=PRODUCTION&version=v2211 This command initiates the Spartacus storefront application locally. It requires Node.js and npm/yarn to be installed. The storefront will be accessible at http://localhost:4200, allowing developers to test front-end customizations. ```shell yarn start ``` -------------------------------- ### POST /subscriptions/{subscriptionCode}/deployments Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/66abfe678b55457fab235ce8039dda71_locale=en-US&state=PRODUCTION&version=v2211 Starts a new deployment. ```APIDOC ## POST /subscriptions/{subscriptionCode}/deployments ### Description Starts a new deployment. ### Method POST ### Endpoint `/subscriptions/{subscriptionCode}/deployments` ### Parameters #### Path Parameters - **subscriptionCode** (string) - Required - Customer subscription code ### Request Body - **{request body}** - Required - Details for the new deployment. ### Request Example ```json { "example": "request body" } ``` ``` -------------------------------- ### Install SAP Commerce Cloud Add-Ons using Ant Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/610fe98c73e54bd4a9db391aac78d05d_locale=en-US&state=PRODUCTION&version=v2211 This command installs specified SAP Commerce Cloud Add-Ons using Apache Ant. Ensure Ant is set up correctly and the Add-Ons are compatible with your SAP Commerce Cloud version. This is crucial for enabling features like personalization and assisted services. ```shell ant addoninstall -Daddonnames="promotionenginesamplesaddon,smarteditaddon,textfieldconfiguratortemplateaddon,assistedservicestorefront,assistedservicepromotionaddon,customerticketingaddon,orderselfserviceaddon,adaptivesearchsamplesaddon,multicountrysampledataaddon,pcmbackofficesamplesaddon,personalizationaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront" ``` -------------------------------- ### Exact Match Deny Path Set Example Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/f2ccdd5ff46b4eefa648e9b9f9e47324 An example of a simple deny path set rule that denies access to a specific path '/server-info'. This is useful for blocking access to sensitive endpoints. ```plaintext # Example 1: an exact match. # Deny access to the server info endpoint. DENY /server-info ``` -------------------------------- ### Prepare Mock Extension for Local Deployment (Shell) Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/784f9480cf064d3b81af9cad5739fecc_locale=en-US&state=PRODUCTION&version=v2211 This snippet demonstrates the shell commands required to prepare a mock extension for local deployment. It involves navigating to the platform home, setting up the environment, and generating the extension using Apache Ant. Ensure the PLATFORM_HOME environment variable is correctly set. ```shell cd ${PLATFORM_HOME} . ./setantenv.sh ant extgen ``` -------------------------------- ### Example of Service Property Key-Value Format Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/b28eb253589b4b9c910bc862094a53ac This snippet demonstrates the standard key-value format for defining service properties or secrets within the Cloud Portal's Properties panel. It shows a simple example of a password property. ```properties my.password=12345 ``` -------------------------------- ### Configure JavaScript Storefront Applications Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/1ee068bcce7845b8ab4ed9cdd54577fb_locale=en-US&state=PRODUCTION&version=v2211 This JSON configuration defines the applications and their respective paths for a JavaScript Storefront. It lists applications and specifies their directory locations within the project. ```json "applications": [ { "name": "jsapp1", "path": "foo/jsapp1" }, { "name": "jsapp2", "path": "foo/bar/jsapp2" } ] ``` -------------------------------- ### OpenSearch Filter Examples for Standard Kubernetes Labels Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/0041f0f8421f4c88bb11a371605d93dd These examples illustrate how to use OpenSearch filters with standard Kubernetes labels to search for specific applications, components, or parts of a larger application within pods. ```OpenSearch Query Language kubernetes.labels.app_kubernetes_io/name:hybris kubernetes.labels.app_kubernetes_io/name:solr kubernetes.labels.app_kubernetes_io/name:datahub ``` ```OpenSearch Query Language kubernetes.labels.app_kubernetes_io/component:updater kubernetes.labels.app_kubernetes_io/component:imageprocessing ``` ```OpenSearch Query Language kubernetes.labels.app_kubernetes_io/part-of:hybris ``` -------------------------------- ### Initialize Tenant and Data Source Variables (Java) Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/d86a030124b54b6a8246d29d46e77c3e Initializes necessary variables for interacting with the SAP Commerce Cloud tenant and managing data sources. This includes obtaining the current tenant, declaring variables for the slave data source and session context, and a flag to track the force master mode. ```java final Tenant t = Registry.getCurrentTenantNoFallback(); String mySlaveDS = null; SessionContext myLctx = null; boolean isForceMasterSet = false; ``` -------------------------------- ### OpenSearch Filter Examples for SAP Commerce Cloud Labels Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/0041f0f8421f4c88bb11a371605d93dd These examples show how to use OpenSearch filters with SAP Commerce Cloud specific labels. This includes filtering by platform aspect (e.g., background processing) and deployment ID. ```OpenSearch Query Language kubernetes.labels.ccv2.cx.sap.com/platform-aspect:backgroundProcessing ``` ```OpenSearch Query Language kubernetes.labels.ccv2.cx.sap.com/deployment-id ``` -------------------------------- ### Static File to Endpoint Mapping Example Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/d1055b92a3d140a28fcf3f4879f35ae2_locale=en-US&state=PRODUCTION&version=v2211 This example demonstrates how the folder structure within a ZIP archive of static files maps to URLs when exposed via a web endpoint. It shows the relationship between the file path in the archive and its accessible URL. ```plaintext authenticate.txt > https://shop.example.com/authenticate.txt static/health.html > https://shop.example.com/static/health.html assets/img/logo.png > https://shop.example.com/assets/img/logo.png ``` -------------------------------- ### Environment Scaling Details Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/66abfe678b55457fab235ce8039dda71_locale=en-US&state=PRODUCTION&version=v2211 Endpoints for managing and retrieving scaling configurations for an environment. ```APIDOC ## GET /subscriptions/{subscriptionCode}/environments/{environmentCode}/scaling ### Description Retrieves the scaling details for a specified environment within a subscription. ### Method GET ### Endpoint /subscriptions/{subscriptionCode}/environments/{environmentCode}/scaling ### Parameters #### Path Parameters - **subscriptionCode** (string) - Required - The customer subscription code. - **environmentCode** (string) - Required - The environment code within the subscription. ### Response #### Success Response (200) - **environmentScalingDetail** (EnvironmentScalingDetailDTO) - The scaling details of the environment. #### Response Example ```json { "environmentScalingDetail": { "minReplicas": 1, "maxReplicas": 5, "currentReplicas": 2 } } ``` ``` ```APIDOC ## PATCH /subscriptions/{subscriptionCode}/environments/{environmentCode}/scaling ### Description Updates and applies the scaling details for a given environment. ### Method PATCH ### Endpoint /subscriptions/{subscriptionCode}/environments/{environmentCode}/scaling ### Parameters #### Path Parameters - **subscriptionCode** (string) - Required - The customer subscription code. - **environmentCode** (string) - Required - The environment code within the subscription. #### Request Body - **updateEnvironmentScalingDetailRequest** (UpdateEnvironmentScalingDetailRequestDTO) - Required - The request body containing the scaling details to update. - **minReplicas** (integer) - Required - The minimum number of replicas. - **maxReplicas** (integer) - Required - The maximum number of replicas. ### Request Example ```json { "updateEnvironmentScalingDetailRequest": { "minReplicas": 2, "maxReplicas": 10 } } ``` ### Response #### Success Response (200) - **environmentScalingDetail** (EnvironmentScalingDetailDTO) - The updated scaling details of the environment. #### Response Example ```json { "environmentScalingDetail": { "minReplicas": 2, "maxReplicas": 10, "currentReplicas": 3 } } ``` ``` -------------------------------- ### Example IP Filter Set Configuration Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/910006b8cf9c4c6fa482984b05a59643 This snippet shows an example of an IP filter set file used to define IP addresses that are allowed or denied access. Each line represents an IP address or a CIDR block. The format is compatible with standard IP filtering mechanisms. ```text 175.242.123.43/32 171.116.139.63/32 235.169.68.129/32 11.181.251.81/32 130.27.80.0/24 115.190.208.134/32 ``` -------------------------------- ### POST /builds Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/66abfe678b55457fab235ce8039dda71_locale=en-US&state=PRODUCTION&version=v2211 Initiates a new build for a specified application branch. Requires application code, branch name, and build name. ```APIDOC ## POST /builds ### Description Initiates a new build for a specified application branch. ### Method POST ### Endpoint /builds ### Parameters #### Request Body - **applicationCode** (string) - Optional - Code of the application - **branch** (string) - Required - Branch name of the application - **name** (string) - Required - Name of the build ### Request Example ```json { "applicationCode": "my-app-code", "branch": "main", "name": "my-build" } ``` ### Response #### Success Response (200) - **subscriptionCode** (string) - Code of the subscription - **code** (string) - Build code #### Response Example ```json { "subscriptionCode": "sub-123", "code": "build-abc" } ``` ``` -------------------------------- ### Example X.509 Certificate in PEM Format Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/16eb468a55b24d0ebcc3c35060f858de This snippet shows an example of a public X.509 certificate in PEM format, which is used when adding a trusted certificate in the Cloud Portal. The format includes -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- delimiters. ```plaintext -----BEGIN CERTIFICATE----- MIIDZDCCAkwCCQC219BweGOf4jANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJ1 kEPMA0GA1UECAwGbG9uZG9uMQ8wDQYDVQQHDAZsb25kb24xEzARBgNVBAoMCm15 LWNvbXBhbnkxDDAKBgNVBAsMA3dtczEgMB4GA1UEAwwXdWsud21zLm15LWNvbXBh bnkuY28udWswHhcNMTgwNzI1MTAyNzI3WhcNMjgwNzIyMTAyNzI3WjB0MQswCQYD VQQGEwJ1azEPMA0GA1UECAwGbG9uZG9uMQ8wDQYDVQQHDAZsb25kb24xEzARBgNV BAoMCm15LWNvbXBhbnkxDDAKBgNVBAsMA3dtczEgMB4GA1UEAwwXdWsud21zLm15 LWNvbXBhbnkuY28udWswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ RD5Qbeki+VEUMiLVZlBSY18c6oqmm7odejwPfoVQKy1zOdKnyFSYUUrtGMMd++w8e P+yWejYBrsyF64w/prPD9A9K3Zd8E5+fePw8TcJror5Sy7wuTl5QrVWmKvXA3qUe dHxZJCAq2EhmZu4K4R0e3C8gXdsKoNP+rcaokz3SHr2GkqpkrQdi3edPz2pT/fN/ A5M1cEoraP5VSKPAplyA5AlAY+zFflAkKBCLwiHGIAurAHYP3YeuxthoFXEOxyR0 HWOnbBea2cv4mConp30NA0BE40fQEBKjG/bdYUFcE72EsvxJtv69ofFAW1sK0apJ +k1i+ttx2uYboZzSe8czAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAAliWp50Sdrv 4HCZGMIRoYgOC3qQPmJWsMt7o7QuBpEH8IqiQxF0qexdxKwn9Rw8DisV7IlOqFwR Z0yElLyhOXO7BT/FrggMqPvXWLzmROcwzjsYc13hodiu3/9X93gBJkzjVCBbWn/1 KvaiH6RiP35jaUNkPS75h7bVmz4GHoL6aqIOAm+IssTTVfZLQGey6haYl9vJLuD2 L/DU96L6MUS8km5IjUEo4eaWUclG5ozANuDdlmFC693mMsWOKexoZ1NtXOsDj/5 ByP5Q1hcuXLMv8PQ+dVez9tGamImyeLHseoN4r84xbEuyUqt47k68JLSoilkd6t/ FMAkYVEQETU= -----END CERTIFICATE----- ``` -------------------------------- ### OpenSearch Filters for Server Startup and Liveness Probes Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/3ab701d8dc134b3a969ed317301074af These filters are used in OpenSearch to check specific aspects of the server startup and application liveness probes. They help in troubleshooting deployment processes by examining server readiness and responsiveness. ```OpenSearch Query Language Server startup: use "Server startup" ``` ```OpenSearch Query Language Application liveness probe check: use "access-log" /modelt/liveness ``` -------------------------------- ### Implement Default Readiness Check Service in Java Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/784f9480cf064d3b81af9cad5739fecc_locale=en-US&state=PRODUCTION&version=v2211 Provides a default implementation for the `ReadinessCheckService`. It iterates through a list of injected `ReadinessCheck` beans, returning the result of the first check that is not in a 'READY' state. If all checks are ready or no checks are configured, it returns a 'READY' status. ```java package de.hybris.platform.modelt.readinesscheck.impl; import de.hybris.platform.modelt.readinesscheck.ReadinessCheck; import de.hybris.platform.modelt.readinesscheck.ReadinessCheckResult; import de.hybris.platform.modelt.readinesscheck.ReadinessCheckService; import de.hybris.platform.modelt.readinesscheck.ReadinessStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; import org.springframework.util.CollectionUtils; import java.util.List; public class DefaultReadinessCheckService implements ReadinessCheckService { private List readinessChecks; @Override public ReadinessCheckResult checkReadiness() { if (CollectionUtils.isEmpty(readinessChecks)) { return ReadinessCheckResult.ready(); } for (ReadinessCheck readinessCheck : readinessChecks) { if (ReadinessStatus.READY != readinessCheck.getResult().getReadinessStatus()) { return readinessCheck.getResult(); } } return ReadinessCheckResult.ready(); } @Required public void setReadinessChecks(final List readinessChecks) { this.readinessChecks = readinessChecks; } } ``` -------------------------------- ### GET /subscriptions/{subscriptionCode}/deployments/{deploymentCode} Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/66abfe678b55457fab235ce8039dda71_locale=en-US&state=PRODUCTION&version=v2211 Retrieves the details of a specific deployment. ```APIDOC ## GET /subscriptions/{subscriptionCode}/deployments/{deploymentCode} ### Description Retrieves the details of a specific deployment. ### Method GET ### Endpoint /subscriptions/{subscriptionCode}/deployments/{deploymentCode} ### Parameters #### Path Parameters - **subscriptionCode** (string) - Required - Customer subscription code - **deploymentCode** (string) - Required - Deployment code ### Response #### Success Response (200) - **DeploymentDetailDTO** - Contains the details of the deployment. #### Response Example ```json { "example": "DeploymentDetailDTO" } ``` ``` -------------------------------- ### Deployment Modes Source: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/66abfe678b55457fab235ce8039dda71_locale=en-US&state=PRODUCTION&version=v2211 APIs for retrieving deployment modes per environment. ```APIDOC ## GET /environments/{environmentCode}/deployment-modes ### Description Retrieves the deployment modes allowed for a specific environment. ### Method GET ### Endpoint /environments/{environmentCode}/deployment-modes ### Parameters #### Path Parameters - **environmentCode** (string) - Required - The code of the environment. ### Response #### Success Response (200 OK) - **DeploymentModesPerEnvironmentDTO** (object) - Details of deployment modes per environment. - **environmentCode** (string) - Environment code. - **deploymentModes** (array) - List of deployment modes allowed for an environment. - **DeploymentModeDTO** (object) - **dataMigrationMode** (array) - Data migration modes (e.g., NONE, UPDATE, INITIALIZE). - **deploymentMode** (array) - Deployment modes (e.g., ROLLING_UPDATE, RECREATE, GREEN). #### Response Example ```json { "environmentCode": "env-abc", "deploymentModes": [ { "dataMigrationMode": ["NONE", "UPDATE"], "deploymentMode": ["ROLLING_UPDATE"] } ] } ``` ```