Search code examples
elasticsearchazure-storageelasticsearch-net

Create a new backup repository for elasticsearch using NEST?


For my ES backups, I use the Azure repository plugin. So far, I've just been using a scheduled task that uses CURL to issue my desired commands but I want to do this in a WebJob. Using the NEST library, I see that I can request a new .Snapshot() which is the second half of what I've been doing but I want to periodically (every month) create a full backup. So, before I invoke the snapshot, I make sure the current month's repository is created something like so:

PUT _snapshot/es-2017-12 { "type": "azure", "settings": { "container": "elasticsearch-backups", "base_path": "60-2017-12" } }

Is there a NEST-based approach to doing this or do I just have to send a raw request? If raw, so far, I've never needed to make a raw request, could this particular request even be made via a RawQuery()? If so, can you provide an example?


Solution

  • For any who may come along w/ this question, Martijn Laarman of the NEST team provided me the solution here: Create a new backup repository using NEST 6.0?