SalesforceCommerceCloud / sfcc-ci

Salesforce Commerce Cloud CLI
https://npmjs.com/package/sfcc-ci
BSD 3-Clause "New" or "Revised" License
230 stars 92 forks source link

Adopt new processing APIs for index updates #136

Open tobiaslohr opened 4 years ago

tobiaslohr commented 4 years ago

Salesforce B2C Commerce 20.4 comes with additional process APIs for search index updates (rebuild and incremental update) capabilities. Supported index types are product, content, active data, the following APIs are being made available and are subject for adoption as part of a new CLI command or set of commands.

POST https://hostname:port/dw/data/v20_4/jobs/sfcc-search-index-active-data-full-update/executions
POST https://hostname:port/dw/data/v20_4/jobs/sfcc-search-index-content-full-update/executions
POST https://hostname:port/dw/data/v20_4/jobs/sfcc-search-index-product-full-update/executions
POST https://hostname:port/dw/data/v20_4/jobs/sfcc-search-index-active-data-incremental-update/executions
POST https://hostname:port/dw/data/v20_4/jobs/sfcc-search-index-content-incremental-update/executions
POST https://hostname:port/dw/data/v20_4/jobs/sfcc-search-index-product-incremental-update/executions

This adds more capabilities in regards to a full CI/CD set up for B2C environments, as there was no out of the box support for index updates so far. Workarounds using custom jobs have been in place with requires upfront configuration to be made to the environment though.

Brief suggestion for new CLI commands that implement these new Data APIs:

sfcc-ci index:rebuild --instance <instance> --type (product|content|activedata) --sites <list-of-sites> --all-sites --sync
sfcc-ci index:update --instance <instance> --type (product|content|activedata) --sites <list-of-sites> --all-sites --sync
matt-rose-salesforce commented 4 years ago

Hey @tobiaslohr thanks for making me aware of these new APIs. Do you know if this is documented anywhere? I don't see it in the Global Jobs documentation, so I am wondering if we need to follow up on that.

gabrielfreiberg commented 4 years ago

@matt-rose-salesforce -- looks like it is in the DOC3 version of the Global Jobs documentation.

matt-rose-salesforce commented 4 years ago

Thanks @gabrielfreiberg !

GalinBresnishki commented 12 months ago

Hello. As I see index:rebuild and index:update are not available, so I am using job.run command, but I always get an error of type "InternalServerErrorException". There is no available documentation or whatsoever for sfcc-search-index-active-data-full-update/ sfcc-search-index-content-full-update and sfcc-search-index-product-full-update, so I am not 100% sure what parameters do they accept... Can I get a little help with that?