How do I programmatically (via API) export then merge a Pack from one worker group to another?

I want to use the API to export a Pack from one worker group and merge it to another. How do I do that?

1 UpGoat

We’ve incorporated this example into our docs with a more detailed explanation of steps required… Managing Packs via API:

To export a pack via API and install it in a separate worker group:

GET /api/v1/m/<workergroupname>/packs/<packname>/export?mode=merge

Which returns an octet-stream attachment which you will need to download as a file. Then PUT the pack to the new worker group.

PUT /api/v1/m/<newworkergroup>/packs?filename=packname.crbl&size=12345

You will need to upload the contents of the pack as the payload to this request. This returns a JSON response:

{"source":"packname.random.crbl"}

Use this source to tell LogStream to install the pack.

POST /api/v1/m/<newworkergroup>/packs 

{"source":"packname.random.crbl"}
3 UpGoats