Exemple #1
0
        public async Task DeleteServerWideBackupConfigurationCommand()
        {
            var name = GetStringQueryString("name", required: true);

            using (ServerStore.ContextPool.AllocateOperationContext(out TransactionOperationContext context))
            {
                var(newIndex, _) = await ServerStore.DeleteServerWideBackupConfigurationAsync(name, GetRaftRequestIdFromQuery());

                await ServerStore.WaitForCommitIndexChange(RachisConsensus.CommitIndexModification.GreaterOrEqual, newIndex);

                using (var writer = new BlittableJsonTextWriter(context, ResponseBodyStream()))
                    using (context.OpenReadTransaction())
                    {
                        var deleteResponse = new PutServerWideBackupConfigurationResponse()
                        {
                            Name             = name,
                            RaftCommandIndex = newIndex
                        };

                        HttpContext.Response.StatusCode = (int)HttpStatusCode.OK;
                        context.Write(writer, deleteResponse.ToJson());
                        writer.Flush();
                    }
            }
        }